Skip to content

Commit

Permalink
Add charge lines.
Browse files Browse the repository at this point in the history
  • Loading branch information
deanpoulos committed Sep 10, 2024
1 parent 64db509 commit 8826358
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qualang_tools/octave_tools/octave_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions qualang_tools/wirer/connectivity/wiring_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class WiringLineType(Enum):
RESONATOR = "rr"
DRIVE = "xy"
FLUX = "z"
CHARGE = "q"
COUPLER = "c"

class WiringSpec:
Expand Down
1 change: 1 addition & 0 deletions qualang_tools/wirer/visualizer/visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions qualang_tools/wirer/wirer/wirer.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def allocate_wiring(connectivity: Connectivity, instruments: Instruments,
WiringLineType.RESONATOR,
WiringLineType.DRIVE,
WiringLineType.FLUX,
WiringLineType.CHARGE,
WiringLineType.COUPLER,
]

Expand Down
22 changes: 22 additions & 0 deletions tests/wirer/test_wirer_lf_charge.py
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit 8826358

Please sign in to comment.