qibocal.protocols.classification package#

Submodules#

qibocal.protocols.classification.classification module#

qibocal.protocols.classification.classification.single_shot_classification = Routine(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function _update>, two_qubit_gates=False)#

Qubit classification routine object.

class qibocal.protocols.classification.classification.SingleShotClassificationData(nshots: int, savedir: str, qubit_frequencies: dict[typing.Annotated[typing.Union[int, str], FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], float] = <factory>, data: dict[typing.Annotated[typing.Union[int, str], FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], numpy.ndarray[typing.Any, numpy.dtype[+_ScalarType_co]]] = <factory>, classifiers_list: Optional[list[str]] = <factory>)[source]#

Bases: Data

nshots: int#

Number of shots.

savedir: str#

Dumping folder of the classification results.

qubit_frequencies: dict[Union[int, str], float]#

Qubit frequencies.

data: dict[typing.Union[int, str], numpy.ndarray[typing.Any, numpy.dtype[+_ScalarType_co]]]#

Raw data acquired.

classifiers_list: Optional[list[str]]#

List of models to classify the qubit states.

state_zero(qubit: Union[int, str]) ndarray[Any, dtype[_ScalarType_co]][source]#

Get state zero data.

state_one(qubit: Union[int, str]) ndarray[Any, dtype[_ScalarType_co]][source]#

Get state one data.

_to_json(path: Path, filename: str)#

Helper function to dump to json.

_to_npz(path: Path, filename: str)#

Helper function to use np.savez while converting keys into strings.

static load_data(path: Path, filename: str)#

Load data stored in a npz file.

static load_params(path: Path, filename: str)#

Load parameters stored in a json file.

property pairs#

Access qubit pairs ordered alphanumerically from data structure.

property params: dict#

Convert non-arrays attributes into dict.

property qubits#

Access qubits from data structure.

register_qubit(dtype, data_keys, data_dict)#

Store output for single qubit.

Parameters:
  • data_keys (tuple) – Keys of Data.data.

  • data_dict (dict) – The keys are the fields of dtype and

  • arrays. (the values are the related) –

save(path: Path)#

Store data to file.

class qibocal.protocols.classification.classification.SingleShotClassificationParameters(unrolling: bool = False, classifiers_list: ~typing.Optional[list[str]] = <factory>, savedir: ~typing.Optional[str] = ' ')[source]#

Bases: Parameters

SingleShotClassification runcard inputs.

unrolling: bool = False#

Whether to unroll the sequences.

If True it uses sequence unrolling to deploy multiple sequences in a single instrument call.

Defaults to False.

classifiers_list: Optional[list[str]]#

List of models to classify the qubit states.

savedir: Optional[str] = ' '#

Dumping folder of the classification results.

hardware_average: bool = False#

By default hardware average will be performed.

nshots: int#

Number of executions on hardware.

relaxation_time: float#

Wait time for the qubit to decohere back to the gnd state.

qibocal.protocols.classification.classification.ClassificationType = dtype([('i', '<f8'), ('q', '<f8'), ('state', '<i8')])#

Custom dtype for rabi amplitude.

qibocal.protocols.classification.qutrit_classification module#

qibocal.protocols.classification.qutrit_classification.qutrit_classification = Routine(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function _dummy_update>, two_qubit_gates=False)#

Qutrit classification Routine object.