From e0120abdd2f2373b2229647c0166a6cb4cf2c915 Mon Sep 17 00:00:00 2001 From: Stavros Efthymiou <35475381+stavros11@users.noreply.github.com> Date: Fri, 6 Dec 2024 23:48:22 +0400 Subject: [PATCH] fix: revert back to using VirtualZ --- .../two_qubit_interaction/chsh/pulses.py | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/src/qibocal/protocols/two_qubit_interaction/chsh/pulses.py b/src/qibocal/protocols/two_qubit_interaction/chsh/pulses.py index 567bb2ee6..6c663d47b 100644 --- a/src/qibocal/protocols/two_qubit_interaction/chsh/pulses.py +++ b/src/qibocal/protocols/two_qubit_interaction/chsh/pulses.py @@ -21,31 +21,27 @@ def create_bell_sequence(platform, qubits, theta=np.pi / 4, bell_state=0): sequence += natives0.R(theta=np.pi / 2, phi=np.pi / 2) sequence += natives1.R(theta=np.pi / 2, phi=np.pi / 2) - cz_sequence = platform.natives.two_qubit[qubits].CZ() - sequence |= cz_sequence[:1] - phases = {ch.split("/")[0]: vz.phase for ch, vz in cz_sequence[1:]} - # sequence |= cz_sequence - # phases = {ch.split("/")[0]: 0 for ch, vz in cz_sequence[1:]} - - sequence_after = natives1.R(theta=np.pi / 2, phi=phases[qubits[1]] - np.pi / 2) - + sequence |= platform.natives.two_qubit[qubits].CZ() + + sequence_after = natives1.R(theta=np.pi / 2, phi=-np.pi / 2) + if bell_state == 0: - phases[qubits[0]] += np.pi + phase = np.pi elif bell_state == 1: - phases[qubits[0]] += 0 + phase = 0 elif bell_state == 2: - phases[qubits[0]] += 0 - sequence_after += natives0.R(theta=np.pi, phi=phases[qubits[0]]) + phase = 0 + sequence_after += natives0.R(theta=np.pi, phi=phase) elif bell_state == 3: - phases[qubits[0]] += np.pi - sequence_after += natives0.R(theta=np.pi, phi=phases[qubits[0]]) + phase = np.pi + sequence_after += natives0.R(theta=np.pi, phi=phase) - sequence_after += natives0.R(theta=np.pi / 2, phi=phases[qubits[0]]) + sequence_after += natives0.R(theta=np.pi / 2, phi=phase) - phases[qubits[0]] += theta - sequence_after += natives0.R(theta=np.pi / 2, phi=phases[qubits[0]] + np.pi) + phase += theta + sequence_after += natives0.R(theta=np.pi / 2, phi=phase + np.pi) - return sequence | sequence_after, phases + return sequence | sequence_after, phase def create_chsh_sequences( @@ -57,13 +53,13 @@ def create_chsh_sequences( ro_pulses = {} for basis in readout_basis: - sequence, phases = create_bell_sequence(platform, qubits, theta, bell_state) + sequence, phase = create_bell_sequence(platform, qubits, theta, bell_state) measurements = PulseSequence() ro_pulses[basis] = {} for i, base in enumerate(basis): natives = platform.natives.single_qubit[qubits[i]] if base == "X": - sequence += natives.R(theta=np.pi / 2, phi=phases[qubits[i]] + np.pi / 2) + sequence += natives.R(theta=np.pi / 2, phi=phase * (1 - i) + np.pi / 2) measurement_seq = natives.MZ() ro_pulses[basis][qubits[i]] = measurement_seq[0][1]