Skip to content

Commit

Permalink
access iq_angle directly from qubit instead of collecting them into a…
Browse files Browse the repository at this point in the history
…nother dict
  • Loading branch information
hay-k committed Feb 14, 2024
1 parent 0e460f6 commit dae7eee
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/qibolab/instruments/zhinst.py
Original file line number Diff line number Diff line change
Expand Up @@ -1008,21 +1008,17 @@ def measure_relax(self, exp, qubits, couplers, relaxation_time, acquisition_type
"""Qubit readout pulse, data acquisition and qubit relaxation."""
readout_schedule = defaultdict(list)
qubit_readout_schedule = defaultdict(list)
iq_angle_readout_schedule = defaultdict(list)
for qubit in qubits.values():
iq_angle = qubit.iq_angle
channel_name = measure_signal_name(qubit)
for i, pulse in enumerate(self.sequence[channel_name]):
readout_schedule[i].append(pulse)
qubit_readout_schedule[i].append(qubit)
iq_angle_readout_schedule[i].append(iq_angle)

weights = {}
for i, (pulses, qubits_readout, iq_angles) in enumerate(
for i, (pulses, qubits_readout) in enumerate(
zip(
readout_schedule.values(),
qubit_readout_schedule.values(),
iq_angle_readout_schedule.values(),
)
):
qd_finish = self.find_subsequence_finish(i, "drive", qubits_readout)
Expand All @@ -1043,7 +1039,7 @@ def measure_relax(self, exp, qubits, couplers, relaxation_time, acquisition_type
play_after = f"sequence_{latest_sequence['line']}_{i}"
# Section on the outside loop allows for multiplex
with exp.section(uid=f"sequence_measure_{i}", play_after=play_after):
for pulse, qubit, iq_angle in zip(pulses, qubits_readout, iq_angles):
for pulse, qubit in zip(pulses, qubits_readout):
q = qubit.name
pulse.zhpulse.uid += str(i)

Expand All @@ -1053,13 +1049,12 @@ def measure_relax(self, exp, qubits, couplers, relaxation_time, acquisition_type
)

if (
qubits[q].kernel is not None
qubit.kernel is not None
and acquisition_type == lo.AcquisitionType.DISCRIMINATION
):
kernel = qubits[q].kernel
weight = lo.pulse_library.sampled_pulse_complex(
uid="weight" + str(q),
samples=kernel * np.exp(1j * iq_angle),
samples=qubit.kernel * np.exp(1j * qubit.iq_angle),
)

else:
Expand All @@ -1074,7 +1069,7 @@ def measure_relax(self, exp, qubits, couplers, relaxation_time, acquisition_type
)
]
)
* np.exp(1j * iq_angle),
* np.exp(1j * qubit.iq_angle),
uid="weights" + str(q),
)
weights[q] = weight
Expand Down

0 comments on commit dae7eee

Please sign in to comment.