Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test for Wirer on fixed-frequency transmons for OPX+ and Octave. #245

Merged
merged 5 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]
### Fixed
- wirer - Added test-case for OPX+ and Octave with fixed-frequency tranmsons.

## [0.18.2] - 2024-12-23
### Added
- Support for Python 3.12
Expand Down
54 changes: 52 additions & 2 deletions tests/wirer/test_wirer_cross_resonance.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
from qualang_tools.wirer import *
from qualang_tools.wirer.connectivity.element import QubitPairReference, QubitReference
from qualang_tools.wirer.connectivity.wiring_spec import WiringLineType
from qualang_tools.wirer.instruments.instrument_channel import InstrumentChannelMwFemOutput
from qualang_tools.wirer.instruments.instrument_channel import InstrumentChannelMwFemOutput, InstrumentChannelOpxPlus, \
InstrumentChannelOpxPlusOutput, InstrumentChannelOctaveOutput

visualize_flag = False
visualize_flag = pytest.visualize_flag


def test_2q_allocation_cross_resonance(instruments_2lf_2mw):
Expand Down Expand Up @@ -47,3 +48,52 @@ def test_2q_allocation_cross_resonance(instruments_2lf_2mw):
InstrumentChannelMwFemOutput(con=1, port=3, slot=3)
][i]
)


def test_2q_allocation_cross_resonance_opx_plus_octave(instruments_1opx_1octave):
qubits = [1, 2]
qubit_pairs = [(1, 2), (2, 1)]

connectivity = Connectivity()

connectivity.add_resonator_line(qubits=qubits)
allocate_wiring(connectivity, instruments_1opx_1octave)

connectivity.add_qubit_drive_lines(qubits=qubits)
allocate_wiring(connectivity, instruments_1opx_1octave, block_used_channels=False)

connectivity.add_qubit_pair_zz_drive_lines(qubit_pairs)
allocate_wiring(connectivity, instruments_1opx_1octave, block_used_channels=False)

connectivity.add_qubit_pair_cross_resonance_lines(qubit_pairs)
allocate_wiring(connectivity, instruments_1opx_1octave)

if visualize_flag:
visualize(connectivity.elements, instruments_1opx_1octave.available_channels)


for i, qubit_pair in enumerate(qubit_pairs):
xy_channels = connectivity.elements[QubitReference(qubit_pair[0])].channels[WiringLineType.DRIVE]
cr_channels = connectivity.elements[QubitPairReference(*qubit_pair)].channels[WiringLineType.CROSS_RESONANCE]
zz_channels = connectivity.elements[QubitPairReference(*qubit_pair)].channels[WiringLineType.ZZ_DRIVE]
assert len(xy_channels) == 3
assert len(cr_channels) == 3
assert len(zz_channels) == 3

# For each XY, XD and ZZ should be on the same channel for the same qubit pair + control index
for channels in [xy_channels, cr_channels, zz_channels]:
for j, channel in enumerate(channels):
assert pytest.channels_are_equal(
channel, [
[
InstrumentChannelOpxPlusOutput(con=1, port=3),
InstrumentChannelOpxPlusOutput(con=1, port=4),
InstrumentChannelOctaveOutput(con=1, port=2),
],
[
InstrumentChannelOpxPlusOutput(con=1, port=5),
InstrumentChannelOpxPlusOutput(con=1, port=6),
InstrumentChannelOctaveOutput(con=1, port=3),
],
][i][j]
)
Loading