Skip to content

Commit

Permalink
Merge pull request #245 from qua-platform/fix/wirer-fixed-freq-tranmo…
Browse files Browse the repository at this point in the history
…ns-opx-octave

Add test for Wirer on fixed-frequency transmons for OPX+ and Octave.
  • Loading branch information
HiroQM authored Jan 6, 2025
2 parents 71228b7 + 1568999 commit d58f7e1
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 2 deletions.
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]
)

0 comments on commit d58f7e1

Please sign in to comment.