diff --git a/qw11qD/parameters.json b/qw11qD/parameters.json index 47340172..15004339 100644 --- a/qw11qD/parameters.json +++ b/qw11qD/parameters.json @@ -177,22 +177,22 @@ ] ], "MZ": [ - [ - "D1/probe", - { - "kind": "pulse", - "duration": 2000.0, - "amplitude": 0.003, - "envelope": { - "kind": "rectangular" - } - } - ], [ "D1/acquisition", { - "kind": "acquisition", - "duration": 2000.0 + "kind": "readout", + "acquisition": { + "kind": "acquisition", + "duration": 2000.0 + }, + "probe": { + "kind": "pulse", + "duration": 2000.0, + "amplitude": 0.003, + "envelope": { + "kind": "rectangular" + } + } } ] ] @@ -213,22 +213,22 @@ ] ], "MZ": [ - [ - "D2/probe", - { - "kind": "pulse", - "duration": 2000.0, - "amplitude": 0.0024, - "envelope": { - "kind": "rectangular" - } - } - ], [ "D2/acquisition", { - "kind": "acquisition", - "duration": 2000.0 + "kind": "readout", + "acquisition": { + "kind": "acquisition", + "duration": 2000.0 + }, + "probe": { + "kind": "pulse", + "duration": 2000.0, + "amplitude": 0.0024, + "envelope": { + "kind": "rectangular" + } + } } ] ] @@ -249,22 +249,22 @@ ] ], "MZ": [ - [ - "D3/probe", - { - "kind": "pulse", - "duration": 2000.0, - "amplitude": 0.0018, - "envelope": { - "kind": "rectangular" - } - } - ], [ "D3/acquisition", { - "kind": "acquisition", - "duration": 2000.0 + "kind": "readout", + "acquisition": { + "kind": "acquisition", + "duration": 2000.0 + }, + "probe": { + "kind": "pulse", + "duration": 2000.0, + "amplitude": 0.0018, + "envelope": { + "kind": "rectangular" + } + } } ] ] @@ -285,22 +285,22 @@ ] ], "MZ": [ - [ - "D4/probe", - { - "kind": "pulse", - "duration": 2000.0, - "amplitude": 0.004, - "envelope": { - "kind": "rectangular" - } - } - ], [ "D4/acquisition", { - "kind": "acquisition", - "duration": 2000.0 + "kind": "readout", + "acquisition": { + "kind": "acquisition", + "duration": 2000.0 + }, + "probe": { + "kind": "pulse", + "duration": 2000.0, + "amplitude": 0.004, + "envelope": { + "kind": "rectangular" + } + } } ] ] @@ -321,22 +321,22 @@ ] ], "MZ": [ - [ - "D5/probe", - { - "kind": "pulse", - "duration": 2000.0, - "amplitude": 0.0036, - "envelope": { - "kind": "rectangular" - } - } - ], [ "D5/acquisition", { - "kind": "acquisition", - "duration": 2000.0 + "kind": "readout", + "acquisition": { + "kind": "acquisition", + "duration": 2000.0 + }, + "probe": { + "kind": "pulse", + "duration": 2000.0, + "amplitude": 0.0036, + "envelope": { + "kind": "rectangular" + } + } } ] ] diff --git a/qw11qD/platform.py b/qw11qD/platform.py index 9ab7029d..c9e7cd16 100644 --- a/qw11qD/platform.py +++ b/qw11qD/platform.py @@ -1,10 +1,12 @@ import pathlib -from qibolab.components import AcquireChannel, DcChannel, IqChannel -from qibolab.instruments.qm import Octave, QmChannel, QmConfigs, QmController +from qibolab.components import AcquireChannel, Channel, DcChannel, IqChannel +from qibolab.identifier import ChannelId +from qibolab.instruments.qm import Octave, QmConfigs, QmController from qibolab.instruments.rohde_schwarz import SGS100A from qibolab.parameters import ConfigKinds from qibolab.platform import Platform +from qibolab.platform.platform import QubitMap from qibolab.qubits import Qubit FOLDER = pathlib.Path(__file__).parent @@ -22,58 +24,61 @@ def create(): calibrated with TWPA and latest status in: https://github.com/qiboteam/qibolab_platforms_qrc/pull/149 """ - lo_map = {q: f"{q}/drive_lo" for q in ["D1", "D4", "D5"]} - lo_map["D2"] = lo_map["D3"] = "D2D3/drive_lo" - twpa_d = SGS100A(name="twpaD", address="192.168.0.33") - qubits = {} - for i in range(1, 6): - q = f"D{i}" - qubits[q] = Qubit( - name=q, - probe=IqChannel( - name=f"{q}/probe", - mixer=None, - lo=f"D/probe_lo", - acquisition=f"{q}/acquisition", - ), - acquisition=AcquireChannel( - name=f"{q}/acquisition", twpa_pump=twpa_d.name, probe=f"{q}/probe" - ), - drive=IqChannel(name=f"{q}/drive", mixer=None, lo=lo_map[q]), - flux=DcChannel(name=f"{q}/flux"), + qubits: QubitMap = { + f"D{i}": Qubit( + drive=f"D{i}/drive", + flux=f"D{i}/flux", + probe=f"D{i}/probe", + acquisition=f"D{i}/acquisition", ) + for i in range(1, 6) + } + for q in qubits.values(): + assert q.probe is not None - # Connect logical channels to instrument channels (ports) + # Create channels and connect to instrument ports # Readout - channels = [QmChannel(qubit.probe, "octave5", port=1) for qubit in qubits.values()] + channels: dict[ChannelId, Channel] = {} + for q in qubits.values(): + assert q.probe is not None + channels[q.probe] = IqChannel( + device="octave5", path="1", mixer=None, lo="D/probe_lo" + ) + # Acquire - channels.extend( - QmChannel(qubit.acquisition, "octave5", port=1) for qubit in qubits.values() - ) + for q in qubits.values(): + assert q.acquisition is not None + channels[q.acquisition] = AcquireChannel( + device="octave5", path="1", twpa_pump=twpa_d.name, probe=q.probe + ) + # Drive - channels.extend( - [ - QmChannel(qubits["D1"].drive, "octave5", port=2), - QmChannel(qubits["D2"].drive, "octave5", port=4), - QmChannel(qubits["D3"].drive, "octave5", port=5), - QmChannel(qubits["D4"].drive, "octave6", port=5), - QmChannel(qubits["D5"].drive, "octave6", port=3), - ] - ) + def define_drive(q: str, device: str, port: int, lo: str): + drive = qubits[q].drive + assert drive is not None + channels[drive] = IqChannel(device=device, path=str(port), mixer=None, lo=lo) + + define_drive("D1", "octave5", 2, "D1/drive_lo") + define_drive("D2", "octave5", 4, "D2D3/drive_lo") + define_drive("D3", "octave5", 5, "D2D3/drive_lo") + define_drive("D4", "octave6", 5, "D4/drive_lo") + define_drive("D5", "octave6", 3, "D5/drive_lo") + # Flux - channels.extend( - QmChannel(qubits[f"D{q}"].flux, "con9", port=q + 2) for q in range(1, 6) - ) + for q in range(1, 6): + qubit = qubits[f"D{q}"] + assert qubit.flux is not None + channels[qubit.flux] = DcChannel(device="con9", path=str(q + 2)) octaves = { "octave5": Octave("octave5", port=104, connectivity="con6"), "octave6": Octave("octave6", port=105, connectivity="con8"), } controller = QmController( - "qm", - "192.168.0.101:80", + name="qm", + address="192.168.0.101:80", octaves=octaves, channels=channels, calibration_path=FOLDER,