diff --git a/qualang_tools/octave_tools/octave_tools.py b/qualang_tools/octave_tools/octave_tools.py index b1ad6604..c2304c77 100644 --- a/qualang_tools/octave_tools/octave_tools.py +++ b/qualang_tools/octave_tools/octave_tools.py @@ -208,10 +208,10 @@ def octave_calibration_tool( :param lo_frequencies: single value or list of LO frequencies to calibrate in Hz. :param intermediate_frequencies: single value or list of Intermediate frequencies to calibrate in Hz. """ - if not isinstance(lo_frequencies, Union[list, np.ndarray]): + if not isinstance(lo_frequencies, (list, np.ndarray)): lo_frequencies = [lo_frequencies] - if not isinstance(intermediate_frequencies, Union[list, np.ndarray]): + if not isinstance(intermediate_frequencies, (list, np.ndarray)): intermediate_frequencies = [intermediate_frequencies] for lo in lo_frequencies: diff --git a/qualang_tools/wirer/connectivity/connectivity_transmon_interface.py b/qualang_tools/wirer/connectivity/connectivity_transmon_interface.py index 19156fb8..6541de46 100644 --- a/qualang_tools/wirer/connectivity/connectivity_transmon_interface.py +++ b/qualang_tools/wirer/connectivity/connectivity_transmon_interface.py @@ -28,6 +28,12 @@ def add_qubit_drive_lines(self, qubits: QubitsType, triggered: bool = False, con triggered, constraints, elements) + def add_qubit_charge_lines(self, qubits: QubitsType, constraints: ChannelSpec = None): + elements = self._make_qubit_elements(qubits) + return self.add_wiring_spec(WiringFrequency.DC, WiringIOType.OUTPUT, WiringLineType.CHARGE, + False, constraints, elements) + + def add_qubit_flux_lines(self, qubits: QubitsType, constraints: ChannelSpec = None): elements = self._make_qubit_elements(qubits) return self.add_wiring_spec(WiringFrequency.DC, WiringIOType.OUTPUT, WiringLineType.FLUX, diff --git a/qualang_tools/wirer/connectivity/wiring_spec.py b/qualang_tools/wirer/connectivity/wiring_spec.py index 29bafa83..d5ef351e 100644 --- a/qualang_tools/wirer/connectivity/wiring_spec.py +++ b/qualang_tools/wirer/connectivity/wiring_spec.py @@ -15,6 +15,7 @@ class WiringLineType(Enum): RESONATOR = "rr" DRIVE = "xy" FLUX = "z" + CHARGE = "q" COUPLER = "c" class WiringSpec: diff --git a/qualang_tools/wirer/visualizer/visualizer.py b/qualang_tools/wirer/visualizer/visualizer.py index 3c3156e3..b712c86c 100644 --- a/qualang_tools/wirer/visualizer/visualizer.py +++ b/qualang_tools/wirer/visualizer/visualizer.py @@ -43,6 +43,7 @@ def prepare_available_channel_annotations(available_channels: InstrumentChannels def get_color_for_line_type(line_type) -> str: color_map = { WiringLineType.FLUX: "powderblue", + WiringLineType.CHARGE: "lavender", WiringLineType.RESONATOR: "peachpuff", WiringLineType.DRIVE: "lemonchiffon", WiringLineType.COUPLER: "thistle" diff --git a/qualang_tools/wirer/wirer/wirer.py b/qualang_tools/wirer/wirer/wirer.py index 18f09b0e..23175745 100644 --- a/qualang_tools/wirer/wirer/wirer.py +++ b/qualang_tools/wirer/wirer/wirer.py @@ -22,6 +22,7 @@ def allocate_wiring(connectivity: Connectivity, instruments: Instruments, WiringLineType.RESONATOR, WiringLineType.DRIVE, WiringLineType.FLUX, + WiringLineType.CHARGE, WiringLineType.COUPLER, ] diff --git a/tests/wirer/test_wirer_lf_charge.py b/tests/wirer/test_wirer_lf_charge.py new file mode 100644 index 00000000..a2694bf1 --- /dev/null +++ b/tests/wirer/test_wirer_lf_charge.py @@ -0,0 +1,22 @@ +import pytest + +from qualang_tools.wirer import * + +visualize_flag = pytest.visualize_flag + +def test_5q_allocation_flux_charge(instruments_2lf_2mw): + qubits = [1, 2, 3, 4, 5] + qubit_pairs = [(1, 2), (2, 3), (3, 4), (4, 5)] + + connectivity = Connectivity() + connectivity.add_resonator_line(qubits=qubits, constraints=mw_fem_spec(slot=7)) + connectivity.add_qubit_flux_lines(qubits=qubits) + connectivity.add_qubit_charge_lines(qubits=qubits) + connectivity.add_qubit_pair_flux_lines(qubit_pairs=qubit_pairs, constraints=lf_fem_spec(out_slot=2)) + + allocate_wiring(connectivity, instruments_2lf_2mw) + + print(connectivity.elements) + + if visualize_flag: + visualize(connectivity.elements, instruments_2lf_2mw.available_channels)