Skip to content

Commit

Permalink
Merge pull request #1031 from qiboteam/czphaseremoved
Browse files Browse the repository at this point in the history
Removing virtual phase from CZ routine, as it might interfere with the calibration of the virtual phase
  • Loading branch information
Edoardo-Pedicillo authored Nov 7, 2024
2 parents 2cb2090 + 535f5e6 commit 31efd4d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
10 changes: 3 additions & 7 deletions src/qibocal/protocols/two_qubit_interaction/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ class OptimizeTwoQubitGateData(Data):
"""Angles swept."""
native: str = "CZ"
"""Native two qubit gate."""
vphases: dict[QubitPairId, dict[QubitId, float]] = field(default_factory=dict)
"""Virtual phases for each qubit."""
amplitudes: dict[tuple[QubitId, QubitId], float] = field(default_factory=dict)
""""Amplitudes swept."""
durations: dict[tuple[QubitId, QubitId], float] = field(default_factory=dict)
Expand Down Expand Up @@ -166,7 +164,6 @@ def _acquisition(
for setup in ("I", "X"):
(
sequence,
virtual_z_phase,
theta_pulse,
amplitude,
data.durations[ord_pair],
Expand All @@ -181,7 +178,6 @@ def _acquisition(
params.parking,
params.flux_pulse_amplitude_min,
)
data.vphases[ord_pair] = dict(virtual_z_phase)
theta = np.arange(
params.theta_start,
params.theta_end,
Expand All @@ -208,7 +204,7 @@ def _acquisition(

sweeper_theta = Sweeper(
Parameter.relative_phase,
theta - data.vphases[ord_pair][target_q],
theta,
pulses=[theta_pulse],
type=SweeperType.ABSOLUTE,
)
Expand Down Expand Up @@ -246,7 +242,7 @@ def _acquisition(
target_q,
control_q,
setup,
theta - data.vphases[ord_pair][target_q],
theta,
data.amplitudes[ord_pair],
data.durations[ord_pair],
result_control,
Expand Down Expand Up @@ -293,7 +289,7 @@ def _fit(
try:
popt, _ = curve_fit(
fit_function,
np.array(data.thetas) - data.vphases[ord_pair][target],
np.array(data.thetas),
target_data,
p0=pguess,
bounds=(
Expand Down
14 changes: 3 additions & 11 deletions src/qibocal/protocols/two_qubit_interaction/virtual_z_phases.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ class VirtualZPhasesData(Data):
data: dict[tuple, npt.NDArray[VirtualZPhasesType]] = field(default_factory=dict)
native: str = "CZ"
thetas: list = field(default_factory=list)
vphases: dict[QubitPairId, dict[QubitId, float]] = field(default_factory=dict)
amplitudes: dict[tuple[QubitId, QubitId], float] = field(default_factory=dict)
durations: dict[tuple[QubitId, QubitId], float] = field(default_factory=dict)

Expand Down Expand Up @@ -127,9 +126,7 @@ def create_sequence(
)
RX_pulse_start = platform.create_RX_pulse(control_qubit, start=0, relative_phase=0)

flux_sequence, virtual_z_phase = getattr(
platform, f"create_{native}_pulse_sequence"
)(
flux_sequence, _ = getattr(platform, f"create_{native}_pulse_sequence")(
(ordered_pair[1], ordered_pair[0]),
start=max(Y90_pulse.finish, RX_pulse_start.finish),
)
Expand All @@ -139,16 +136,15 @@ def create_sequence(

if duration is not None:
flux_sequence.get_qubit_pulses(ordered_pair[1])[0].duration = duration

theta_pulse = platform.create_RX90_pulse(
target_qubit,
start=flux_sequence.finish + dt,
relative_phase=virtual_z_phase[target_qubit],
relative_phase=0,
)
RX_pulse_end = platform.create_RX_pulse(
control_qubit,
start=flux_sequence.finish + dt,
relative_phase=virtual_z_phase[control_qubit],
relative_phase=0,
)
measure_target = platform.create_qubit_readout_pulse(
target_qubit, start=theta_pulse.finish
Expand Down Expand Up @@ -177,10 +173,8 @@ def create_sequence(
if pulse.qubit not in ordered_pair:
pulse.duration = theta_pulse.finish
sequence.add(pulse)

return (
sequence,
virtual_z_phase,
theta_pulse,
flux_sequence.get_qubit_pulses(ordered_pair[1])[0].amplitude,
flux_sequence.get_qubit_pulses(ordered_pair[1])[0].duration,
Expand Down Expand Up @@ -222,7 +216,6 @@ def _acquisition(
for setup in ("I", "X"):
(
sequence,
virtual_z_phase,
theta_pulse,
data.amplitudes[ord_pair],
data.durations[ord_pair],
Expand All @@ -237,7 +230,6 @@ def _acquisition(
params.parking,
params.flux_pulse_amplitude,
)
data.vphases[ord_pair] = dict(virtual_z_phase)
theta = np.arange(
params.theta_start,
params.theta_end,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ def _acquisition(
for setup in ("I", "X"):
(
sequence,
virtual_z_phase,
theta_pulse,
data.amplitudes[ord_pair],
data.durations[ord_pair],
Expand All @@ -90,7 +89,6 @@ def _acquisition(
params.parking,
params.flux_pulse_amplitude,
)
data.vphases[ord_pair] = dict(virtual_z_phase)
theta = np.arange(
params.theta_start,
params.theta_end,
Expand Down

0 comments on commit 31efd4d

Please sign in to comment.