Skip to content

Commit 6289658

Browse files
alecandidoYour Name
authored andcommitted
fix: Simplify conditional oscillations sequence
Remove gate repetitions. Assuming they were a leftover, initially used for debugging the repeated application, when discovering the charge accumulation
1 parent fa2d7a8 commit 6289658

1 file changed

Lines changed: 18 additions & 40 deletions

File tree

src/qibocal/protocols/two_qubit_interaction/virtual_z_phases.py

Lines changed: 18 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ def create_sequence(
134134
`flux_pulse_max_duration` parameter.
135135
136136
The function returns:
137-
- The full experiment pulse sequence.
138-
- The applied flux pulse.
139-
- The final `VirtualZPhase` pulses to be used for phase sweeping.
137+
- The full experiment pulse sequence.
138+
- The applied flux pulse.
139+
- The final `VirtualZPhase` pulses to be used for phase sweeping.
140140
"""
141141

142142
target_natives = platform.natives.single_qubit[target_qubit]
@@ -158,58 +158,36 @@ def create_sequence(
158158
if flux_pulse is None:
159159
cz_sequence = platform.natives.two_qubit[ordered_pair].CZ
160160
flux_pulse = list(cz_sequence.channel(flux_channel))[0]
161-
162161
assert isinstance(flux_pulse, Pulse), "Flux pulse must be a Pulse object."
163162

164163
if flux_pulse_max_duration is not None:
165164
flux_pulse = replace(flux_pulse, duration=flux_pulse_max_duration)
166-
flux_sequence = PulseSequence([(flux_channel, flux_pulse)])
167-
virtual_phases: list[VirtualZ] = []
168-
align_channels = [
169-
platform.qubits[control_qubit].drive,
170-
platform.qubits[target_qubit].drive,
171-
flux_channel,
172-
platform.qubits[target_qubit].acquisition,
173-
platform.qubits[control_qubit].acquisition,
174-
]
175-
176-
sequence.align(align_channels)
177-
178-
for _ in range(gate_repetition):
179-
sequence.append((flux_channel, Delay(duration=dt)))
180-
sequence += flux_sequence
181-
sequence.append((flux_channel, Delay(duration=dt)))
182-
183-
# Instead of having many RZ as expressed in gate_repetition,
184-
# a single RZ with angle (theta*gate_repetition) is added because qm ignores the first one.
185-
# This work for CZ since it commutes with the RZ, but break the iSWAP compatibility.
186-
# See https://github.com/qiboteam/qibolab/discussions/1198.
187-
188-
virtual_phases.append(VirtualZ(phase=0))
189-
sequence.append((platform.qubits[target_qubit].drive, virtual_phases[-1]))
190-
191-
theta_sequence = PulseSequence()
192-
# RX90 (angle to be swept)
193-
sequence.align(align_channels)
194-
theta_sequence += target_natives.R(theta=np.pi / 2)
195-
196-
sequence += theta_sequence
165+
166+
sequence |= PulseSequence(
167+
[
168+
(flux_channel, Delay(duration=dt)),
169+
(flux_channel, flux_pulse),
170+
(flux_channel, Delay(duration=dt)),
171+
]
172+
)
173+
174+
vz = VirtualZ(phase=0)
175+
sequence.append((platform.qubits[target_qubit].drive, vz))
176+
177+
sequence |= target_natives.R(theta=np.pi / 2)
197178

198179
# X gate for the leakage
199180
if setup == "X":
200181
sequence += control_natives.RX()
201182

202-
sequence.align(align_channels)
203-
204-
ro_sequence = PulseSequence(
183+
sequence |= PulseSequence(
205184
[
206185
target_natives.MZ()[0],
207186
control_natives.MZ()[0],
208187
]
209188
)
210189

211-
sequence += ro_sequence
212-
return sequence, flux_pulse, virtual_phases
190+
return sequence, flux_pulse, vz
213191

214192

215193
def _acquisition(

0 commit comments

Comments
 (0)