Skip to content

Commit

Permalink
feat: Add zx90 initialization in Experiment class for improved pulse …
Browse files Browse the repository at this point in the history
…scheduling
  • Loading branch information
Akinori Machino committed Dec 29, 2024
1 parent a585fa4 commit d8470b4
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/qubex/experiment/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -4526,6 +4526,12 @@ def rb_sequence_2q(
ix90 = ix90 or self.hpi_pulse[target_qubit]
z90 = VirtualZ(np.pi / 2)

if zx90 is None:
zx90 = self.zx90(
control_qubit=control_qubit,
target_qubit=target_qubit,
)

if interleaved_waveform is None:
cliffords, inverse = self.clifford_generator.create_rb_sequences(
n=n,
Expand Down Expand Up @@ -4554,22 +4560,21 @@ def add_gate(gate: str):
elif gate == "IZ90":
ps.add(target_qubit, z90)
elif gate == "ZX90":
if zx90 is not None:
ps.barrier()
if isinstance(zx90, dict):
ps.add(control_qubit, zx90[control_qubit])
ps.add(target_qubit, zx90[target_qubit])
elif isinstance(zx90, PulseSchedule):
ps.call(zx90)
ps.barrier()
ps.barrier()
if isinstance(zx90, dict):
ps.add(control_qubit, zx90[control_qubit])
ps.add(target_qubit, zx90[target_qubit])
elif isinstance(zx90, PulseSchedule):
ps.call(zx90)
ps.barrier()
else:
raise ValueError("Invalid gate.")

for clifford in cliffords:
for gate in clifford:
add_gate(gate)
ps.barrier()
if interleaved_waveform is not None:
ps.barrier()
if isinstance(interleaved_waveform, dict):
ps.add(control_qubit, interleaved_waveform[control_qubit])
ps.add(target_qubit, interleaved_waveform[target_qubit])
Expand Down

0 comments on commit d8470b4

Please sign in to comment.