-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add quantitative regression tests for exact connectivity allocations.
- Loading branch information
1 parent
26e0068
commit d5afb07
Showing
7 changed files
with
170 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,30 @@ | ||
from dataclasses import asdict | ||
|
||
import pytest | ||
|
||
from qualang_tools.wirer import * | ||
from qualang_tools.wirer.connectivity.element import QubitReference | ||
from qualang_tools.wirer.connectivity.wiring_spec import WiringLineType | ||
from qualang_tools.wirer.instruments.instrument_channel import InstrumentChannelLfFemOutput | ||
|
||
visualize_flag = pytest.visualize_flag | ||
|
||
def test_5q_allocation_flux_charge(instruments_2lf_2mw): | ||
def test_1q_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) | ||
|
||
for qubit_index in qubits: | ||
charge_channels = connectivity.elements[QubitReference(qubit_index)].channels[WiringLineType.CHARGE] | ||
assert len(charge_channels) == 1 | ||
|
||
for i, channel in enumerate(charge_channels): | ||
assert asdict(channel) == asdict([ | ||
InstrumentChannelLfFemOutput(con=1, port=qubit_index, slot=1) | ||
][i]) |