Skip to content

Commit

Permalink
Merge pull request #908 from qiboteam/qmdrivefreqfix
Browse files Browse the repository at this point in the history
Fixes late comments on #905
  • Loading branch information
Edoardo-Pedicillo authored May 30, 2024
2 parents 7868bfe + d70c0b5 commit 485f416
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/qibolab/instruments/qm/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ def _new_frequency_element(self, qubit, intermediate_frequency, mode="drive"):
f"Cannot play two different frequencies on the same {mode} line."
)
new_element = f"{element}_{intermediate_frequency}"
self.elements[new_element] = dict(self.elements[f"drive{qubit.name}"])
self.elements[new_element] = dict(self.elements[element])
self.elements[new_element]["intermediate_frequency"] = intermediate_frequency
return new_element

Expand Down Expand Up @@ -251,7 +251,7 @@ def register_element(self, qubit, pulse, time_of_flight=0, smearing=0):
element = self.register_flux_element(qubit, pulse.frequency)
return element

def register_pulse(self, qubit, qmpulse, element=None):
def register_pulse(self, qubit, qmpulse):
"""Registers pulse, waveforms and integration weights in QM config.
Args:
Expand Down
2 changes: 1 addition & 1 deletion src/qibolab/instruments/qm/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ def create_sequence(self, qubits, sequence, sweepers):
qmpulse = QMPulse(pulse, element)
if pulse.type is PulseType.READOUT:
ro_pulses.append(qmpulse)
self.config.register_pulse(qubit, qmpulse, element)
self.config.register_pulse(qubit, qmpulse)
qmsequence.add(qmpulse)

qmsequence.shift()
Expand Down
15 changes: 15 additions & 0 deletions tests/test_instruments_qm.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,21 @@ def test_qm_register_pulses_with_different_frequencies(qmplatform):
assert len(qmsequence.qmpulses) == 4
elements = {qmpulse.element for qmpulse in qmsequence.qmpulses}
assert len(elements) == 4
for element in elements:
if "readout" in element:
assert (
controller.config.elements[element]["RF_inputs"]
== controller.config.elements["readout0"]["RF_inputs"]
)
assert (
controller.config.elements[element]["RF_outputs"]
== controller.config.elements["readout0"]["RF_outputs"]
)
else:
assert (
controller.config.elements[element]["RF_inputs"]
== controller.config.elements["drive0"]["RF_inputs"]
)
else:
with pytest.raises(NotImplementedError):
qmsequence, ro_pulses = controller.create_sequence(
Expand Down

0 comments on commit 485f416

Please sign in to comment.