Skip to content

Commit

Permalink
Align is no longer a macro
Browse files Browse the repository at this point in the history
  • Loading branch information
nulinspiratie committed Dec 12, 2024
1 parent 4e20b0d commit e7addc7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions quam/components/quantum_components/qubit.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,8 @@ def get_pulse(self, pulse_name: str) -> Pulse:
else:
return pulses[0]

@QuantumComponent.register_macro
def align(self, other_qubits: Union["Qubit", Iterable["Qubit"]]):
def align(self, *other_qubits: "Qubit"):
"""Aligns the execution of all channels of this qubit and all other qubits"""
if isinstance(other_qubits, Qubit):
other_qubits = [other_qubits]
channel_names = [channel.name for channel in self.channels.values()]
for qubit in other_qubits:
channel_names.extend([channel.name for channel in qubit.channels.values()])
Expand Down
8 changes: 4 additions & 4 deletions tests/components/quantum_components/test_qubit.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ def test_qubit_get_pulse_unique(mock_qubit):
assert mock_qubit.get_pulse("test_pulse") == pulse


def test_qubit_align(mock_qubit_with_resonator, mocker):
def test_qubit_align(mock_qubit_with_resonator, mock_qubit, mocker):
mocker.patch("quam.components.quantum_components.qubit.align")
mock_qubit_with_resonator.align(mock_qubit_with_resonator)
mock_qubit_with_resonator.align(mock_qubit)

from quam.components.quantum_components.qubit import align

align.assert_called_once_with("q1.xy", "q1.resonator")
align.assert_called_once_with("q1.xy", "q1.resonator", "q0.xy")


def test_qubit_get_macros(mock_qubit):
Expand All @@ -73,7 +73,7 @@ def test_qubit_get_macros(mock_qubit):

def test_qubit_apply_align(mock_qubit_with_resonator, mocker):
mocker.patch("quam.components.quantum_components.qubit.align")
mock_qubit_with_resonator.apply("align")
mock_qubit_with_resonator.align()

from quam.components.quantum_components.qubit import align

Expand Down

0 comments on commit e7addc7

Please sign in to comment.