qibocal.protocols.coherence package

Submodules

qibocal.protocols.coherence.cpmg module

qibocal.protocols.coherence.cpmg.cpmg = Routine(acquisition=<function _acquisition>, fit=<function _fit>, report=<function plot>, update=<function _dummy_update>, two_qubit_gates=False)

Cpmg Routine object.

qibocal.protocols.coherence.spin_echo module

class qibocal.protocols.coherence.spin_echo.SpinEchoParameters(delay_between_pulses_start: int, delay_between_pulses_end: int, delay_between_pulses_step: int, single_shot: bool = False)[source]

Bases: SpinEchoSignalParameters

SpinEcho runcard inputs.

hardware_average: bool = False

By default hardware average will be performed.

single_shot: bool = False
delay_between_pulses_start: int

Initial delay between pulses [ns].

delay_between_pulses_end: int

Final delay between pulses [ns].

delay_between_pulses_step: int

Step delay between pulses [ns].

nshots: int

Number of executions on hardware.

relaxation_time: float

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

class qibocal.protocols.coherence.spin_echo.SpinEchoResults(t2: dict[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], float | list[float]], fitted_parameters: dict[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], dict[str, float]], pcov: dict[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], list[float]], chi2: dict[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], tuple[float, float | None]] | None = <factory>)[source]

Bases: SpinEchoSignalResults

SpinEcho outputs.

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

Chi squared estimate mean value and error.

_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)

Store results to file.

t2: dict[QubitId, float | list[float]]

T2 echo for each qubit.

fitted_parameters: dict[QubitId, dict[str, float]]

Raw fitting output.

pcov: dict[QubitId, list[float]]

Approximate covariance of fitted parameters.

qibocal.protocols.coherence.spin_echo.spin_echo = Routine(acquisition=<function _acquisition>, fit=<function _fit>, report=<function plot>, update=<function update_spin_echo>, two_qubit_gates=False)

SpinEcho Routine object.

qibocal.protocols.coherence.spin_echo_signal module

class qibocal.protocols.coherence.spin_echo_signal.SpinEchoSignalParameters(delay_between_pulses_start: int, delay_between_pulses_end: int, delay_between_pulses_step: int, single_shot: bool = False)[source]

Bases: Parameters

SpinEcho Signal runcard inputs.

delay_between_pulses_start: int

Initial delay between pulses [ns].

delay_between_pulses_end: int

Final delay between pulses [ns].

delay_between_pulses_step: int

Step delay between pulses [ns].

single_shot: bool = False
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.

class qibocal.protocols.coherence.spin_echo_signal.SpinEchoSignalResults(t2: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], float | list[float]], fitted_parameters: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], dict[str, float]], pcov: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], list[float]])[source]

Bases: Results

SpinEchoSignal outputs.

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

T2 echo for each qubit.

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

Raw fitting output.

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

Approximate covariance of fitted parameters.

_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)

Store results to file.

qibocal.protocols.coherence.spin_echo_signal.spin_echo_signal = Routine(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function update_spin_echo>, two_qubit_gates=False)

SpinEcho Routine object.

qibocal.protocols.coherence.spin_echo_signal.update_spin_echo(results: SpinEchoSignalResults, platform: CalibrationPlatform, target: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])])[source]

qibocal.protocols.coherence.t1 module

qibocal.protocols.coherence.t1.CoherenceProbType = dtype([('wait', '<f8'), ('prob', '<f8'), ('error', '<f8')])

Custom dtype for coherence routines.

class qibocal.protocols.coherence.t1.T1Data(data: dict[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy._typing._array_like._ScalarT]]] = <factory>)[source]

Bases: Data

T1 acquisition outputs.

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

Raw data acquired.

_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.

qibocal.protocols.coherence.t1.t1 = Routine(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function update_t1>, two_qubit_gates=False)

T1 Routine object.

qibocal.protocols.coherence.t1_flux module

class qibocal.protocols.coherence.t1_flux.T1FluxParameters(delay_min: int, delay_max: int, delay_step: int, amplitude_min: float, amplitude_max: float, amplitude_step: float)[source]

Bases: Parameters

T1 runcard inputs.

delay_min: int

Initial delay before readout [ns].

delay_max: int

Final delay before readout [ns].

delay_step: int

Step delay before readout [ns].

amplitude_min: float

Flux pulse minimum amplitude.

amplitude_max: float

Flux pulse maximum amplitude.

amplitude_step: float

Flux pulse amplitude step.

property delay_range: ndarray[tuple[Any, ...], dtype[_ScalarT]]

Return the delay range as a numpy array.

property flux_range: ndarray[tuple[Any, ...], dtype[_ScalarT]]

Return the flux pulse amplitude range as a numpy array.

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.

class qibocal.protocols.coherence.t1_flux.T1FluxResults(t1: dict[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], list[float]] = <factory>)[source]

Bases: Results

T1 outputs.

t1: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], list[float]]
_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)

Store results to file.

class qibocal.protocols.coherence.t1_flux.T1FluxData(flux_range: list[float] = <factory>, wait_range: list[float] = <factory>, detuning: dict[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], float] = <factory>, data: dict[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy._typing._array_like._ScalarT]]] = <factory>)[source]

Bases: Data

T1 acquisition outputs.

flux_range: list[float]

Flux pulse amplitude range [a.u.].

wait_range: list[float]

Delay between pulses range [ns].

_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.

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

DETUNING of the qubit as a function of flux pulse amplitude.

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

Raw data acquired.

probability(qubit: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]) ndarray[tuple[Any, ...], dtype[_ScalarT]][source]

Return the probability data for a specific qubit.

error(qubit: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]) ndarray[tuple[Any, ...], dtype[_ScalarT]][source]

Return the error data for a specific qubit.

qibocal.protocols.coherence.t1_flux._acquisition(params: T1FluxParameters, platform: CalibrationPlatform, targets: list[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]]) T1FluxData[source]

Data acquisition for T1 flux experiment.

qibocal.protocols.coherence.t1_flux._fit(data: T1FluxData) T1FluxResults[source]

Fitting procedure fot T1 flux experiment.

For each detuning value we compute the T1 time using a single exponential fit.

qibocal.protocols.coherence.t1_flux._plot(data: T1FluxData, target: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], fit: T1FluxResults = None)[source]

Plotting function for T1 flux experiment.

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

T1 flux Routine object.

qibocal.protocols.coherence.t1_signal module

qibocal.protocols.coherence.t1_signal.t1_signal = Routine(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function update_t1>, two_qubit_gates=False)

T1 Signal Routine object.

class qibocal.protocols.coherence.t1_signal.T1SignalData(data: dict[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy._typing._array_like._ScalarT]]] = <factory>)[source]

Bases: Data

T1 acquisition 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 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.

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

Raw data acquired.

property average
class qibocal.protocols.coherence.t1_signal.T1SignalParameters(delay_before_readout_start: int, delay_before_readout_end: int, delay_before_readout_step: int, single_shot: bool = False)[source]

Bases: Parameters

T1 runcard inputs.

delay_before_readout_start: int

Initial delay before readout [ns].

delay_before_readout_end: int

Final delay before readout [ns].

delay_before_readout_step: int

Step delay before readout [ns].

single_shot: bool = False

If True save single shot signal data.

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.

class qibocal.protocols.coherence.t1_signal.T1SignalResults(t1: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], float | list[float]], fitted_parameters: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], dict[str, float]], pcov: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], list[float]])[source]

Bases: Results

T1 Signal outputs.

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

T1 for each qubit.

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

Raw fitting output.

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

Approximate covariance of fitted parameters.

_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)

Store results to file.

qibocal.protocols.coherence.t1_signal.t1_sequence(platform: CalibrationPlatform, targets: list[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], flux_pulse_amplitude: float | None = None)[source]

Create sequence for T1 experiment with a given optional delay.

qibocal.protocols.coherence.t1_signal.update_t1(results: T1SignalResults, platform: CalibrationPlatform, target: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])])[source]

qibocal.protocols.coherence.t2 module

class qibocal.protocols.coherence.t2.T2Parameters(delay_between_pulses_start: int, delay_between_pulses_end: int, delay_between_pulses_step: int, single_shot: bool = False)[source]

Bases: T2SignalParameters

T2 runcard inputs.

delay_between_pulses_start: int

Initial delay between RX(pi/2) pulses in ns.

delay_between_pulses_end: int

Final delay between RX(pi/2) pulses in ns.

delay_between_pulses_step: int

Step delay between RX(pi/2) pulses in ns.

hardware_average: bool = False

By default hardware average will be performed.

single_shot: bool = False

If True save single shot signal data.

nshots: int

Number of executions on hardware.

relaxation_time: float

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

class qibocal.protocols.coherence.t2.T2Results(t2: dict[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], float | list[float]], fitted_parameters: dict[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], dict[str, float]], pcov: dict[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], list[float]], chi2: dict[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], tuple[float, float | None]] | None = <factory>)[source]

Bases: T2SignalResults

T2 outputs.

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

Chi squared estimate mean value and error.

_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)

Store results to file.

t2: dict[QubitId, float | list[float]]

T2 for each qubit [ns].

fitted_parameters: dict[QubitId, dict[str, float]]

Raw fitting output.

pcov: dict[QubitId, list[float]]

Approximate covariance of fitted parameters.

class qibocal.protocols.coherence.t2.T2Data(data: dict[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy._typing._array_like._ScalarT]]] = <factory>)[source]

Bases: T1Data

T2 acquisition 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 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.

data: dict[QubitId, npt.NDArray]

Raw data acquired.

qibocal.protocols.coherence.t2._acquisition(params: T2Parameters, platform: CalibrationPlatform, targets: list[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]]) T2Data[source]

Data acquisition for T2 experiment.

qibocal.protocols.coherence.t2._fit(data: T2Data) T2Results[source]

The used model is

\[y = p_0 - p_1 e^{-x p_2}.\]
qibocal.protocols.coherence.t2.t2 = Routine(acquisition=<function _acquisition>, fit=<function _fit>, report=<function plot>, update=<function update_t2>, two_qubit_gates=False)

T2 Routine object.

qibocal.protocols.coherence.t2_flux module

class qibocal.protocols.coherence.t2_flux.T2FluxParameters(delay_min: int, delay_max: int, delay_step: int, amplitude_min: float, amplitude_max: float, amplitude_step: float)[source]

Bases: T1FluxParameters

T2 flux runcard inputs.

property delay_range: ndarray[tuple[Any, ...], dtype[_ScalarT]]

Return the delay range as a numpy array.

property flux_range: ndarray[tuple[Any, ...], dtype[_ScalarT]]

Return the flux pulse amplitude range as a numpy array.

hardware_average: bool = False

By default hardware average will be performed.

delay_min: int

Initial delay before readout [ns].

delay_max: int

Final delay before readout [ns].

delay_step: int

Step delay before readout [ns].

amplitude_min: float

Flux pulse minimum amplitude.

amplitude_max: float

Flux pulse maximum amplitude.

amplitude_step: float

Flux pulse amplitude step.

nshots: int

Number of executions on hardware.

relaxation_time: float

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

class qibocal.protocols.coherence.t2_flux.T2FluxResults(t2: dict[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], list[float]] = <factory>)[source]

Bases: Results

T2 flux outputs.

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

List of T2 value for each detuning value.

_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)

Store results to file.

class qibocal.protocols.coherence.t2_flux.T2FluxData(flux_range: list[float] = <factory>, wait_range: list[float] = <factory>, detuning: dict[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], float] = <factory>, data: dict[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy._typing._array_like._ScalarT]]] = <factory>)[source]

Bases: T1FluxData

T2 flux acquisition 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.

error(qubit: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]) ndarray[tuple[Any, ...], dtype[_ScalarT]]

Return the error data for a specific qubit.

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.

probability(qubit: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]) ndarray[tuple[Any, ...], dtype[_ScalarT]]

Return the probability data for a specific qubit.

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.

flux_range: list[float]

Flux pulse amplitude range [a.u.].

wait_range: list[float]

Delay between pulses range [ns].

detuning: dict[QubitId, float]

DETUNING of the qubit as a function of flux pulse amplitude.

data: dict[QubitId, npt.NDArray]

Raw data acquired.

qibocal.protocols.coherence.t2_flux._acquisition(params: T2FluxParameters, platform: CalibrationPlatform, targets: list[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]]) T2FluxData[source]

Data acquisition for T2 flux experiment.

qibocal.protocols.coherence.t2_flux._fit(data: T2FluxData) T2FluxResults[source]

T2 flux fitting function.

For each detuning value we compute the T2.

qibocal.protocols.coherence.t2_flux._plot(data: T2FluxData, target: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], fit: T2FluxResults = None)[source]

Plotting function for T2 experiment.

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

T2 Routine object.

qibocal.protocols.coherence.t2_signal module

qibocal.protocols.coherence.t2_signal.t2_signal = Routine(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function update_t2>, two_qubit_gates=False)

T2Signal Routine object.

qibocal.protocols.coherence.t2_signal.update_t2(results: T2SignalResults, platform: CalibrationPlatform, target: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])])[source]
class qibocal.protocols.coherence.t2_signal.T2SignalData(data: dict[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~numpy.ndarray[tuple[~typing.Any, ...], ~numpy.dtype[~numpy._typing._array_like._ScalarT]]] = <factory>)[source]

Bases: T1SignalData

T2Signal acquisition 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.

property average
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.

data: dict[QubitId, npt.NDArray]

Raw data acquired.

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

T2 for each qubit [ns].

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

Raw fitting output.

class qibocal.protocols.coherence.t2_signal.T2SignalParameters(delay_between_pulses_start: int, delay_between_pulses_end: int, delay_between_pulses_step: int, single_shot: bool = False)[source]

Bases: Parameters

T2Signal runcard inputs.

delay_between_pulses_start: int

Initial delay between RX(pi/2) pulses in ns.

delay_between_pulses_end: int

Final delay between RX(pi/2) pulses in ns.

delay_between_pulses_step: int

Step delay between RX(pi/2) pulses in ns.

single_shot: bool = False

If True save single shot signal data.

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.coherence.utils module

qibocal.protocols.coherence.utils.CoherenceType = dtype([('wait', '<f8'), ('signal', '<f8'), ('phase', '<f8')])

Custom dtype for coherence routines.

qibocal.protocols.coherence.utils.average_single_shots(data_type, single_shots)[source]

Convert single shot acquisition results of signal routines to averaged.

Parameters:
  • data_type – Type of produced data object (eg. T1SignalData, T2SignalData etc.).

  • single_shots (dict) – Dictionary containing acquired single shot data.

qibocal.protocols.coherence.utils.dynamical_decoupling_sequence(platform: Platform, targets: list[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], wait: int = 0, n: int = 1, kind: str = 'CPMG') tuple[PulseSequence, list[Delay]][source]

Create dynamical decoupling sequence.

Two sequences are available: - CP: RX90 (wait RX wait )^N RX90 - CPMG: RX90 (wait RY wait )^N RX90

qibocal.protocols.coherence.utils.exp_decay(x, *p)[source]
qibocal.protocols.coherence.utils.exponential_fit(data, zeno=False)[source]
qibocal.protocols.coherence.utils.single_exponential_fit(x, y, error, zeno=False)[source]

Fitting for single exponential decay.

qibocal.protocols.coherence.utils.exponential_fit_probability(data, zeno=False)[source]
qibocal.protocols.coherence.utils.plot(data, target: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], fit=None) tuple[list[Figure], str][source]

Plotting function for spin-echo or CPMG protocol.

qibocal.protocols.coherence.zeno module

class qibocal.protocols.coherence.zeno.ZenoParameters(readouts: int)[source]

Bases: Parameters

Zeno runcard inputs.

readouts: int

Number of readout pulses

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.

class qibocal.protocols.coherence.zeno.ZenoResults(zeno_t1: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], int], fitted_parameters: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], dict[str, float]], pcov: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], list[float]], chi2: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], tuple[float, float | None]])[source]

Bases: Results

Zeno outputs.

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

T1 for each qubit.

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

Raw fitting output.

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

Approximate covariance of fitted parameters.

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

Chi squared estimate mean value and error.

_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)

Store results to file.

qibocal.protocols.coherence.zeno.zeno_sequence(platform: CalibrationPlatform, targets: list[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], readouts: int) tuple[PulseSequence, dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], int]][source]

Generating sequence for Zeno experiment.

class qibocal.protocols.coherence.zeno.ZenoData(data: dict[typing.Annotated[typing.Union[int, str], FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], numpy.ndarray[tuple[typing.Any, ...], numpy.dtype[~_ScalarT]]] = <factory>, readout_duration: dict[typing.Annotated[typing.Union[int, str], FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], float] = <factory>)[source]

Bases: T1Data

_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.

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

Readout durations for each qubit

data: dict[QubitId, npt.NDArray]

Raw data acquired.

qibocal.protocols.coherence.zeno._acquisition(params: ZenoParameters, platform: CalibrationPlatform, targets: list[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]]) ZenoData[source]

In a T1_Zeno experiment, we measure an excited qubit repeatedly. Due to decoherence processes, it is possible that, at the time of measurement, the qubit will not be excited anymore. The quantum zeno effect consists of measuring allowing a particle’s time evolution to be slowed down by measuring it frequently enough. However, in the experiments we see that due the QND-ness of the readout pulse that the qubit decoheres faster. Reference: https://link.aps.org/accepted/10.1103/PhysRevLett.118.240401.

qibocal.protocols.coherence.zeno._fit(data: ZenoData) ZenoResults[source]

Fitting routine for T1 experiment. The used model is

\[y = p_0-p_1 e^{-x p_2}.\]
qibocal.protocols.coherence.zeno._plot(data: ZenoData, fit: ZenoResults, target: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])])[source]

Plotting function for T1 experiment.

qibocal.protocols.coherence.zeno._update(results: ZenoResults, platform: CalibrationPlatform, qubit: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])])[source]