qibocal.protocols.qubit_spectroscopies package

Submodules

qibocal.protocols.qubit_spectroscopies.qubit_power_spectroscopy module

qibocal.protocols.qubit_spectroscopies.qubit_power_spectroscopy.qubit_power_spectroscopy = Protocol(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function _dummy_update>, two_qubit_gates=False)

QubitPowerSpectroscopy Protocol object.

qibocal.protocols.qubit_spectroscopies.qubit_spectroscopy module

class qibocal.protocols.qubit_spectroscopies.qubit_spectroscopy.QubitSpectroscopyData(amplitudes: dict[~types.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], float], data: dict[~types.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~numpy.ndarray[tuple[int, ...], ~numpy.dtype[~numpy._typing._array_like._ScalarType_co]]] = <factory>)[source]

Bases: Data

QubitSpectroscopy acquisition outputs.

amplitudes: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], float]

Amplitudes provided by the user.

_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: list[~typing.Annotated[tuple[~types.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~types.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)]]

Access qubit pairs from data structure.

property params: dict

Convert non-arrays attributes into dict.

property qubits: list[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]]

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, filename: str = 'data')

Store data to file.

data: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ndarray[tuple[int, ...], dtype[_ScalarType_co]]]

Raw data acquired.

class qibocal.protocols.qubit_spectroscopies.qubit_spectroscopy.QubitSpectroscopyParameters(freq_width: int, freq_step: int, drive_duration: int, drive_amplitude: float | None = None)[source]

Bases: Parameters

QubitSpectroscopy runcard inputs.

freq_width: int

Width [Hz] for frequency sweep relative to the qubit frequency.

freq_step: int

Frequency [Hz] step for sweep.

drive_duration: int

Drive pulse duration [ns]. Same for all qubits.

drive_amplitude: float | None = None

Drive pulse amplitude (optional). Same for all qubits.

nshots: int

Number of executions on hardware.

relaxation_time: float

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

class qibocal.protocols.qubit_spectroscopies.qubit_spectroscopy.QubitSpectroscopyResults(frequency: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], dict[str, float]], amplitude: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], float], fitted_parameters: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], list[float]])[source]

Bases: Results

QubitSpectroscopy outputs.

frequency: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], dict[str, float]]

Drive frequecy [GHz] for each qubit.

amplitude: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], float]

Input drive amplitude. Same for all qubits.

fitted_parameters: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], list[float]]

Raw fitting output.

_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 params: dict

Convert non-arrays attributes into dict.

save(path: Path, filename: str = 'results')

Store results to file.

qibocal.protocols.qubit_spectroscopies.qubit_spectroscopy._fit(data: QubitSpectroscopyData) QubitSpectroscopyResults[source]

Post-processing function for QubitSpectroscopy.

qibocal.protocols.qubit_spectroscopies.qubit_spectroscopy.qubit_spectroscopy = Protocol(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function _update>, two_qubit_gates=False)

Qubit Spectroscopy routine.

qibocal.protocols.qubit_spectroscopies.qubit_spectroscopy_ef module

qibocal.protocols.qubit_spectroscopies.qubit_spectroscopy_ef.qubit_spectroscopy_ef = Protocol(acquisition=<function _acquisition>, fit=<function fit_ef>, report=<function _plot>, update=<function _update>, two_qubit_gates=False)

QubitSpectroscopyEF Protocol object.

qibocal.protocols.qubit_spectroscopies.two_levels_crossing module

class qibocal.protocols.qubit_spectroscopies.two_levels_crossing.TwoLevelsCrossingParameters(drive1: tuple[float, float, float] | tuple[Literal['linspace'], float, float, int] | tuple[Literal['window'], float, float, float] | tuple[Literal['linwindow'], float, float, int] | tuple[Literal['center'], float, float] | tuple[Literal['lincenter'], float, int] | tuple[Literal['asym'], tuple[float, float], float] | tuple[Literal['linasym'], tuple[float, float], int], drive2: tuple[float, float, float] | tuple[Literal['linspace'], float, float, int] | tuple[Literal['window'], float, float, float] | tuple[Literal['linwindow'], float, float, int] | tuple[Literal['center'], float, float] | tuple[Literal['lincenter'], float, int] | tuple[Literal['asym'], tuple[float, float], float] | tuple[Literal['linasym'], tuple[float, float], int], duration: float = 4000, amplitude: float | tuple[float, float] = 1.0)[source]

Bases: Parameters

drive1: tuple[float, float, float] | tuple[Literal['linspace'], float, float, int] | tuple[Literal['window'], float, float, float] | tuple[Literal['linwindow'], float, float, int] | tuple[Literal['center'], float, float] | tuple[Literal['lincenter'], float, int] | tuple[Literal['asym'], tuple[float, float], float] | tuple[Literal['linasym'], tuple[float, float], int]

First tone frequency range for sweep [Hz].

drive2: tuple[float, float, float] | tuple[Literal['linspace'], float, float, int] | tuple[Literal['window'], float, float, float] | tuple[Literal['linwindow'], float, float, int] | tuple[Literal['center'], float, float] | tuple[Literal['lincenter'], float, int] | tuple[Literal['asym'], tuple[float, float], float] | tuple[Literal['linasym'], tuple[float, float], int]

Second tone frequency range for sweep [Hz].

duration: float = 4000

Spectroscopic pulses duration.

amplitude: float | tuple[float, float] = 1.0

Spectroscopic pulses amplitude.

nshots: int

Number of executions on hardware.

relaxation_time: float

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

qibocal.protocols.qubit_spectroscopies.two_levels_crossing.TwoLevelsType = dtype([('i', '<f8'), ('q', '<f8')])

Two levels crossing spectroscopy results quadratures.

class qibocal.protocols.qubit_spectroscopies.two_levels_crossing.TwoLevelsCrossingData(drive1: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], tuple[float, float, float]], drive2: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], tuple[float, float, float]], data: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ndarray])[source]

Bases: Data

Data.

drive1: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], tuple[float, float, float]]
drive2: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], tuple[float, float, float]]
data: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ndarray]

Raw data acquired, IQ components of the readout signal.

signal(qubit: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]) ndarray[source]
phase(qubit: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]) ndarray[source]
grid(qubit: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]) tuple[ndarray, ndarray][source]
coords(qubit: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]) tuple[ndarray, ndarray][source]
_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: list[~typing.Annotated[tuple[~types.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~types.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)]]

Access qubit pairs from data structure.

property params: dict

Convert non-arrays attributes into dict.

property qubits: list[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]]

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, filename: str = 'data')

Store data to file.

class qibocal.protocols.qubit_spectroscopies.two_levels_crossing.TwoLevelsCrossingResults[source]

Bases: Results

Fits outputs.

_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 params: dict

Convert non-arrays attributes into dict.

save(path: Path, filename: str = 'results')

Store results to file.

qibocal.protocols.qubit_spectroscopies.two_levels_crossing._acquisition(params: TwoLevelsCrossingParameters, platform: CalibrationPlatform, targets: list[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]]) TwoLevelsCrossingData[source]
qibocal.protocols.qubit_spectroscopies.two_levels_crossing._fit(data: TwoLevelsCrossingData) TwoLevelsCrossingResults[source]
qibocal.protocols.qubit_spectroscopies.two_levels_crossing._plot(data: TwoLevelsCrossingData, target: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], fit: TwoLevelsCrossingResults)[source]
qibocal.protocols.qubit_spectroscopies.two_levels_crossing._update(results: TwoLevelsCrossingResults, platform: CalibrationPlatform, target: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])])[source]
qibocal.protocols.qubit_spectroscopies.two_levels_crossing.two_levels_crossing = Protocol(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function _update>, two_qubit_gates=False)

Two levels crossing spectroscopy protocol.