Skip to content

Commit

Permalink
refactor: use sequence creation helpers in single shot routine
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros11 committed Sep 18, 2024
1 parent 7619202 commit f165d4f
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions src/qibocal/protocols/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy.typing as npt
import pandas as pd
import plotly.graph_objects as go
from qibolab import AcquisitionType, Delay, ExecutionParameters, Platform, PulseSequence
from qibolab import AcquisitionType, ExecutionParameters, Platform, PulseSequence
from sklearn.metrics import roc_auc_score, roc_curve

from qibocal import update
Expand Down Expand Up @@ -188,21 +188,19 @@ def _acquisition(
# state1_sequence: RX - MZ

# taking advantage of multiplexing, apply the same set of gates to all qubits in parallel
native = platform.natives.single_qubit
sequences, all_ro_pulses = [], []
for state in [0, 1]:
sequence = PulseSequence()
ro_pulses = {}
sequence = PulseSequence()
for q in targets:
native = platform.natives.single_qubit[q]
rx_sequence = native.RX.create_sequence(theta=np.pi, phi=0)
ro_sequence = native.MZ.create_sequence()
if state == 1:
sequence.extend(rx_sequence)

qubit = platform.qubits[q]
sequence.append((qubit.acquisition, Delay(duration=rx_sequence.duration)))
sequence.extend(ro_sequence)
ro_sequence = native.MZ()
ro_pulses[q] = ro_sequence[0][1].id
sequence += ro_sequence

if state == 1:
rx_sequence = sum([native[q].RX() for q in targets], PulseSequence)
sequence = rx_sequence | sequence

sequences.append(sequence)
all_ro_pulses.append(ro_pulses)
Expand Down

0 comments on commit f165d4f

Please sign in to comment.