Skip to content

Commit

Permalink
fix: add dummy_qrc/platform.py & fix import
Browse files Browse the repository at this point in the history
  • Loading branch information
changsookim committed Nov 12, 2024
1 parent 0723cba commit 7d7aab3
Show file tree
Hide file tree
Showing 5 changed files with 80 additions and 9 deletions.
6 changes: 5 additions & 1 deletion src/qibolab/_core/instruments/rfsoc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""RFSoC module driver for qibosoq."""

from .driver import RFSoC
from . import driver
from .driver import *

__all__ = []
__all__ += driver.__all__
6 changes: 0 additions & 6 deletions src/qibolab/_core/instruments/rfsoc/constants.py

This file was deleted.

11 changes: 9 additions & 2 deletions src/qibolab/_core/instruments/rfsoc/driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,15 @@
from qibolab._core.sequence import PulseSequence
from qibolab._core.sweeper import BIAS, ParallelSweepers, Sweeper

from .constants import NS_TO_US, SAMPLING_RATE
from .convert import convert, convert_units_sweeper

# update docstring
# self.host -> self.address

__all__ = ["RFSoC"]
SAMPLING_RATE = 9.8304
NANO_TO_SECONDS = 1e-9
HZ_TO_MHZ = 1e-6
NS_TO_US = 1e-3


class RFSoC(Controller):
Expand Down Expand Up @@ -73,6 +77,9 @@ def disconnect(self):

# ========================================================================

# def configure_channel(self, channel, config):
# pass

@staticmethod
def _try_to_execute(server_commands, host, port):
try:
Expand Down
7 changes: 7 additions & 0 deletions src/qibolab/instruments/rfsoc.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
"""RFSoC module driver for qibosoq."""

from qibolab._core.instruments import rfsoc
from qibolab._core.instruments.rfsoc import * # noqa: F403

__all__ = []
__all__ += rfsoc.__all__
59 changes: 59 additions & 0 deletions tests/dummy_qrc/rfsoc/platform.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import pathlib

from qibolab import AcquisitionChannel, DcChannel, IqChannel, Qubit
from qibolab.instruments.era import ERASynth
from qibolab.instruments.rfsoc import RFSoC
from qibolab.instruments.rohde_schwarz import SGS100A
from qibolab.platform import Platform

FOLDER = pathlib.Path(__file__).parent


def create():
"""Dummy platform using QICK project on the RFSoC4x2 board.
Used in ``test_instruments_rfsoc.py``.
"""

qubit = Qubit.default("q0")

# offset?

channels = {}

# Readout
assert qubit.probe is not None
channels[qubit.probe] = IqChannel(
device="L3-18_ro", path="0", mixer=None, lo="ErasynthLO"
)

# Acquire (feedback)
assert qubit.acquisition is not None
channels[qubit.acquisition] = AcquisitionChannel(
device="L2-RO",
path="0",
probe=qubit.probe, # twpa_pump="twpa_a" ?
)

# Drive
assert qubit.drive is not None
channels[qubit.drive] = IqChannel(
device="L3-18_qd",
path="1",
mixer=None, # lo="ErasynthLO" ?
)

# Flux
assert qubit.flux is not None
channels[qubit.flux] = DcChannel(device="L2-22_qf", path="2")

lo_twpa = SGS100A(address="192.168.0.32")
lo_era = ERASynth(address="192.168.0.212", ethernet=True)
controller = RFSoC(
address="0.0.0.0",
channels=channels,
port=0,
)

instruments = {"tii_rfsoc4x2": controller, "twpa_a": lo_twpa, "ErasynthLO": lo_era}
return Platform.load(path=FOLDER, instruments=instruments, qubits={"q0": qubit})

0 comments on commit 7d7aab3

Please sign in to comment.