Skip to content

Commit

Permalink
remove outdated comments, delete hpars, update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Edoardo-Pedicillo committed Oct 25, 2023
1 parent 2ee95b9 commit b3040cf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/qibocal/protocols/characterization/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,9 @@ def _update(
update.threshold(results.threshold[qubit], platform, qubit)
update.mean_gnd_states(results.mean_gnd_states[qubit], platform, qubit)
update.mean_exc_states(results.mean_exc_states[qubit], platform, qubit)
update.classifiers_hpars(results.classifiers_hpars[qubit], platform, qubit)
update.readout_fidelity(results.fidelity[qubit], platform, qubit)
update.assignment_fidelity(results.assignment_fidelity[qubit], platform, qubit)


single_shot_classification = Routine(_acquisition, _fit, _plot, _update)
"""Qubit classification routine object."""
21 changes: 5 additions & 16 deletions src/qibocal/protocols/characterization/qutrit_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
from qibolab import AcquisitionType, ExecutionParameters
from qibolab.platform import Platform
from qibolab.pulses import PulseSequence
from qibolab.qubits import QubitId

from qibocal import update
from qibocal.auto.operation import Qubits, Routine
from qibocal.fitting.classifier import run
from qibocal.protocols.characterization.classification import (
Expand Down Expand Up @@ -53,6 +51,9 @@ def _acquisition(
qubits: Qubits,
) -> QutritClassificationData:
"""
This Routine prepares the qubits in 0,1 and 2 states and measures their
respective I, Q values.
Args:
nshots (int): number of times the pulse sequence will be repeated.
classifiers (list): list of classifiers, the available ones are:
Expand All @@ -66,10 +67,6 @@ def _acquisition(
relaxation_time (float): Relaxation time.
"""

# create two sequences of pulses:
# state0_sequence: I - MZ
# state1_sequence: RX - MZ

# taking advantage of multiplexing, apply the same set of gates to all qubits in parallel
states_sequences = [PulseSequence() for _ in range(3)]
ro_pulses = {}
Expand All @@ -88,7 +85,6 @@ def _acquisition(
)
sequence.add(ro_pulses[qubit][-1])

# create a DataUnits object to store the results
data = QutritClassificationData(
nshots=params.nshots,
classifiers_list=params.classifiers_list,
Expand Down Expand Up @@ -178,12 +174,5 @@ def _plot(data: QutritClassificationData, qubit, fit: SingleShotClassificationRe
return figures, fitting_report


def _update(
results: SingleShotClassificationResults, platform: Platform, qubit: QubitId
):
update.qutrit_classifiers_hpars(
results.classifiers_hpars[qubit], platform, qubit
) # TODO: implement a qutrit classifiers hpars (?)


qutrit_classification = Routine(_acquisition, _fit, _plot, _update)
qutrit_classification = Routine(_acquisition, _fit, _plot)
"""Qutrit classification Routine object."""
10 changes: 0 additions & 10 deletions src/qibocal/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,6 @@ def assignment_fidelity(fidelity: float, platform: Platform, qubit: QubitId):
platform.qubits[qubit].assignment_fidelity = float(fidelity)


def classifiers_hpars(hpars: list, platform: Platform, qubit: QubitId):
"""Update classifier hyperparameters in platform for specific qubit."""
platform.qubits[qubit].classifiers_hpars = hpars


def qutrit_classifiers_hpars(hpars: list, platform: Platform, qubit: QubitId):
"""Update qutrit classifier hyperparameters in platform for specific qubit."""
platform.qubits[qubit].qutrit_classifiers_hpars = hpars


def virtual_phases(phases: dict[QubitId, float], platform: Platform, pair: QubitPairId):
"""Update virtual phases for given qubits in pair in results."""
virtual_z_pulses = {
Expand Down

0 comments on commit b3040cf

Please sign in to comment.