Skip to content

Commit

Permalink
fix: revert back to using VirtualZ
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros11 committed Dec 6, 2024
1 parent 669b6ea commit e0120ab
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions src/qibocal/protocols/two_qubit_interaction/chsh/pulses.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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]
Expand Down

0 comments on commit e0120ab

Please sign in to comment.