qibocal.protocols.coherence package#

Submodules#

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, unrolling: bool = False, 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#

If True save single shot signal data.

unrolling: bool = False#

If True it uses sequence unrolling to deploy multiple sequences in a single instrument call. Defaults to 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_spin_echo: dict[typing.Union[str, int], typing.Union[float, list[float]]], fitted_parameters: dict[typing.Union[str, int], dict[str, float]], pcov: dict[typing.Union[str, int], list[float]], chi2: ~typing.Optional[dict[typing.Union[str, int], tuple[float, typing.Optional[float]]]] = <factory>)[source]#

Bases: SpinEchoSignalResults

SpinEcho outputs.

chi2: Optional[dict[Union[str, int], tuple[float, Optional[float]]]]#

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_spin_echo: dict[QubitId, Union[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.

class qibocal.protocols.coherence.spin_echo.SpinEchoData(data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[+_ScalarType_co]]] = <factory>)[source]#

Bases: T1Data

SpinEcho 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.spin_echo._acquisition(params: SpinEchoParameters, platform: Platform, targets: list[Union[str, int]]) SpinEchoData[source]#

Data acquisition for SpinEcho

qibocal.protocols.coherence.spin_echo._fit(data: SpinEchoData) SpinEchoResults[source]#

Post-processing for SpinEcho.

qibocal.protocols.coherence.spin_echo._plot(data: SpinEchoData, target: Union[str, int], fit: Optional[SpinEchoResults] = None)[source]#

Plotting for SpinEcho

qibocal.protocols.coherence.spin_echo.spin_echo = Routine(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function _update>, 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, unrolling: bool = False, 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].

unrolling: bool = False#

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

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.spin_echo_signal.SpinEchoSignalResults(t2_spin_echo: dict[Union[str, int], Union[float, list[float]]], fitted_parameters: dict[Union[str, int], dict[str, float]], pcov: dict[Union[str, int], list[float]])[source]#

Bases: Results

SpinEchoSignal outputs.

t2_spin_echo: dict[Union[str, int], Union[float, list[float]]]#

T2 echo for each qubit.

fitted_parameters: dict[Union[str, int], dict[str, 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)#

Store results to file.

pcov: dict[Union[str, int], list[float]]#

Approximate covariance of fitted parameters.

class qibocal.protocols.coherence.spin_echo_signal.SpinEchoSignalData(data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[+_ScalarType_co]]] = <factory>)[source]#

Bases: T1SignalData

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

qibocal.protocols.coherence.spin_echo_signal._acquisition(params: SpinEchoSignalParameters, platform: Platform, targets: list[Union[str, int]]) SpinEchoSignalData[source]#

Data acquisition for SpinEcho

qibocal.protocols.coherence.spin_echo_signal._fit(data: SpinEchoSignalData) SpinEchoSignalResults[source]#

Post-processing for SpinEcho.

qibocal.protocols.coherence.spin_echo_signal._plot(data: SpinEchoSignalData, target: Union[str, int], fit: Optional[SpinEchoSignalResults] = None)[source]#

Plotting for SpinEcho

qibocal.protocols.coherence.spin_echo_signal._update(results: SpinEchoSignalResults, platform: Platform, target: Union[str, int])[source]#
qibocal.protocols.coherence.spin_echo_signal.spin_echo_signal = Routine(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function _update>, two_qubit_gates=False)#

SpinEcho Routine object.

qibocal.protocols.coherence.t1 module#

class qibocal.protocols.coherence.t1.T1Parameters(delay_before_readout_start: int, delay_before_readout_end: int, delay_before_readout_step: int, single_shot: bool = False)[source]#

Bases: T1SignalParameters

T1 runcard inputs.

hardware_average: bool = False#

By default hardware average will be performed.

single_shot: bool = False#

If True save single shot signal data.

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

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.T1Results(t1: dict[typing.Union[str, int], typing.Union[float, list[float]]], fitted_parameters: dict[typing.Union[str, int], dict[str, float]], pcov: dict[typing.Union[str, int], list[float]], chi2: ~typing.Optional[dict[typing.Union[str, int], list[float]]] = <factory>)[source]#

Bases: T1SignalResults

T1 outputs.

chi2: Optional[dict[Union[str, int], list[float]]]#

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.

t1: dict[QubitId, Union[float, list[float]]]#

T1 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.t1.CoherenceProbType = dtype([('wait', '<f8'), ('prob', '<f8'), ('error', '<f8')])#

Custom dtype for coherence routines.

class qibocal.protocols.coherence.t1.T1Data(data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[+_ScalarType_co]]] = <factory>)[source]#

Bases: Data

T1 acquisition outputs.

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

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._acquisition(params: T1Parameters, platform: Platform, targets: list[Union[str, int]]) T1Data[source]#

Data acquisition for T1 experiment. In a T1 experiment, we measure an excited qubit after a delay. Due to decoherence processes (e.g. amplitude damping channel), it is possible that, at the time of measurement, after the delay, the qubit will not be excited anymore. The larger the delay time is, the more likely is the qubit to fall to the ground state. The goal of the experiment is to characterize the decay rate of the qubit towards the ground state.

Parameters:
  • params

  • platform (Platform) – Qibolab platform object

  • targets (list) – list of target qubits to perform the action

  • delay_before_readout_start (int) – Initial time delay before ReadOut

  • delay_before_readout_end (list) – Maximum time delay before ReadOut

  • delay_before_readout_step (int) – Scan range step for the delay before ReadOut

  • software_averages (int) – Number of executions of the routine for averaging results

  • points (int) – Save data results in a file every number of points

qibocal.protocols.coherence.t1._fit(data: T1Data) T1Results[source]#

Fitting routine for T1 experiment. The used model is

\[y = p_0-p_1 e^{-x p_2}.\]
qibocal.protocols.coherence.t1._plot(data: T1Data, target: Union[str, int], fit: Optional[T1Results] = None)[source]#

Plotting function for T1 experiment.

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

T1 Routine object.

qibocal.protocols.coherence.t1_sequences module#

qibocal.protocols.coherence.t1_sequences._acquisition(params: T1SignalParameters, platform: Platform, targets: list[Union[str, int]]) T1SignalData[source]#

Data acquisition for T1 experiment. In a T1 experiment, we measure an excited qubit after a delay. Due to decoherence processes (e.g. amplitude damping channel), it is possible that, at the time of measurement, after the delay, the qubit will not be excited anymore. The larger the delay time is, the more likely is the qubit to fall to the ground state. The goal of the experiment is to characterize the decay rate of the qubit towards the ground state.

Parameters:
  • params

  • platform (Platform) – Qibolab platform object

  • targets (list) – list of target qubits to perform the action

  • delay_before_readout_start (int) – Initial time delay before ReadOut

  • delay_before_readout_end (list) – Maximum time delay before ReadOut

  • delay_before_readout_step (int) – Scan range step for the delay before ReadOut

  • software_averages (int) – Number of executions of the routine for averaging results

  • points (int) – Save data results in a file every number of points

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

T1 Routine object.

qibocal.protocols.coherence.t1_signal module#

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[Union[str, int], Union[float, list[float]]], fitted_parameters: dict[Union[str, int], dict[str, float]], pcov: dict[Union[str, int], list[float]])[source]#

Bases: Results

T1 Signal outputs.

t1: dict[Union[str, int], Union[float, list[float]]]#

T1 for each qubit.

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

Raw fitting output.

pcov: dict[Union[str, int], 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.

class qibocal.protocols.coherence.t1_signal.T1SignalData(data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[+_ScalarType_co]]] = <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[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[+_ScalarType_co]]]#

Raw data acquired.

property average#
qibocal.protocols.coherence.t1_signal._acquisition(params: T1SignalParameters, platform: Platform, targets: list[Union[str, int]]) T1SignalData[source]#

Data acquisition for T1 experiment. In a T1 experiment, we measure an excited qubit after a delay. Due to decoherence processes (e.g. amplitude damping channel), it is possible that, at the time of measurement, after the delay, the qubit will not be excited anymore. The larger the delay time is, the more likely is the qubit to fall to the ground state. The goal of the experiment is to characterize the decay rate of the qubit towards the ground state.

Parameters:
  • params

  • platform (Platform) – Qibolab platform object

  • targets (list) – list of target qubits to perform the action

  • delay_before_readout_start (int) – Initial time delay before ReadOut

  • delay_before_readout_end (list) – Maximum time delay before ReadOut

  • delay_before_readout_step (int) – Scan range step for the delay before ReadOut

  • software_averages (int) – Number of executions of the routine for averaging results

  • points (int) – Save data results in a file every number of points

qibocal.protocols.coherence.t1_signal._fit(data: T1SignalData) T1SignalResults[source]#

Fitting routine for T1 experiment. The used model is

\[y = p_0-p_1 e^{-x p_2}.\]
qibocal.protocols.coherence.t1_signal._plot(data: T1SignalData, target: Union[str, int], fit: Optional[T1SignalResults] = None)[source]#

Plotting function for T1 experiment.

qibocal.protocols.coherence.t1_signal._update(results: T1SignalResults, platform: Platform, target: Union[str, int])[source]#
qibocal.protocols.coherence.t1_signal.t1_signal = Routine(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function _update>, two_qubit_gates=False)#

T1 Signal Routine object.

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.Union[str, int], typing.Union[float, list[float]]], fitted_parameters: dict[typing.Union[str, int], dict[str, float]], pcov: dict[typing.Union[str, int], list[float]], chi2: ~typing.Optional[dict[typing.Union[str, int], tuple[float, typing.Optional[float]]]] = <factory>)[source]#

Bases: T2SignalResults

T2 outputs.

chi2: Optional[dict[Union[str, int], tuple[float, Optional[float]]]]#

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, Union[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.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[+_ScalarType_co]]] = <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: Platform, targets: list[Union[str, int]]) T2Data[source]#

Data acquisition for Ramsey Experiment (detuned).

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._plot(data: T2Data, target: Union[str, int], fit: Optional[T2Results] = None)[source]#

Plotting function for Ramsey Experiment.

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

T2 Routine object.

qibocal.protocols.coherence.t2_sequences module#

qibocal.protocols.coherence.t2_sequences._acquisition(params: T2SignalParameters, platform: Platform, targets: list[Union[str, int]]) T2SignalData[source]#

Data acquisition for Ramsey Experiment (detuned).

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

T2 Routine object.

qibocal.protocols.coherence.t2_signal module#

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.

class qibocal.protocols.coherence.t2_signal.T2SignalResults(t2: dict[Union[str, int], Union[float, list[float]]], fitted_parameters: dict[Union[str, int], dict[str, float]], pcov: dict[Union[str, int], list[float]])[source]#

Bases: Results

T2Signal outputs.

t2: dict[Union[str, int], Union[float, list[float]]]#

T2 for each qubit [ns].

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

Raw fitting output.

pcov: dict[Union[str, int], 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.

class qibocal.protocols.coherence.t2_signal.T2SignalData(data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[+_ScalarType_co]]] = <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[Union[str, int], float]#

T2 for each qubit [ns].

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

Raw fitting output.

qibocal.protocols.coherence.t2_signal._acquisition(params: T2SignalParameters, platform: Platform, targets: list[Union[str, int]]) T2SignalData[source]#

Data acquisition for Ramsey Experiment (detuned).

qibocal.protocols.coherence.t2_signal._fit(data: T2SignalData) T2SignalResults[source]#

The used model is

\[y = p_0 - p_1 e^{-x p_2}.\]
qibocal.protocols.coherence.t2_signal._plot(data: T2SignalData, target: Union[str, int], fit: Optional[T2SignalResults] = None)[source]#

Plotting function for Ramsey Experiment.

qibocal.protocols.coherence.t2_signal._update(results: T2SignalResults, platform: Platform, target: Union[str, int])[source]#
qibocal.protocols.coherence.t2_signal.t2_signal = Routine(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function _update>, two_qubit_gates=False)#

T2Signal Routine object.

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.exp_decay(x, *p)[source]#
qibocal.protocols.coherence.utils.exponential_fit(data, zeno=False)[source]#
qibocal.protocols.coherence.utils.exponential_fit_probability(data, zeno=False)[source]#

qibocal.protocols.coherence.zeno module#

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

Bases: ZenoSignalParameters

Zeno runcard inputs.

hardware_average: bool = False#

By default hardware average will be performed.

readouts: int#

Number of readout pulses

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.ZenoData(data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[+_ScalarType_co]]] = <factory>, readout_duration: dict[typing.Union[str, int], float] = <factory>)[source]#

Bases: T1Data

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

Readout durations for each qubit

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

class qibocal.protocols.coherence.zeno.ZenoResults(zeno_t1: dict[Union[str, int], int], fitted_parameters: dict[Union[str, int], dict[str, float]], pcov: dict[Union[str, int], list[float]], chi2: dict[Union[str, int], tuple[float, Optional[float]]])[source]#

Bases: ZenoSignalResults

Zeno outputs.

chi2: dict[Union[str, int], tuple[float, Optional[float]]]#

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.

zeno_t1: dict[Union[str, int], int]#

T1 for each qubit.

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

Raw fitting output.

pcov: dict[Union[str, int], list[float]]#

Approximate covariance of fitted parameters.

qibocal.protocols.coherence.zeno._acquisition(params: ZenoParameters, platform: Platform, targets: list[Union[str, int]]) 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: Union[str, int])[source]#

Plotting function for T1 experiment.

qibocal.protocols.coherence.zeno_signal module#

class qibocal.protocols.coherence.zeno_signal.ZenoSignalParameters(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.

qibocal.protocols.coherence.zeno_signal.ZenoSignalType = dtype([('signal', '<f8'), ('phase', '<f8')])#

Custom dtype for Zeno.

class qibocal.protocols.coherence.zeno_signal.ZenoSignalData(readout_duration: dict[typing.Union[str, int], float] = <factory>, data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[+_ScalarType_co]]] = <factory>)[source]#

Bases: Data

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

Readout durations for each qubit

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

Raw data acquired.

register_qubit(qubit, signal, phase)[source]#

Store output for single qubit.

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

save(path: Path)#

Store data to file.

class qibocal.protocols.coherence.zeno_signal.ZenoSignalResults(zeno_t1: dict[Union[str, int], int], fitted_parameters: dict[Union[str, int], dict[str, float]], pcov: dict[Union[str, int], list[float]])[source]#

Bases: Results

Zeno outputs.

zeno_t1: dict[Union[str, int], int]#

T1 for each qubit.

fitted_parameters: dict[Union[str, int], dict[str, 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)#

Store results to file.

pcov: dict[Union[str, int], list[float]]#

Approximate covariance of fitted parameters.

qibocal.protocols.coherence.zeno_signal._acquisition(params: ZenoSignalParameters, platform: Platform, targets: list[Union[str, int]]) ZenoSignalData[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_signal._fit(data: ZenoSignalData) ZenoSignalResults[source]#

Fitting routine for T1 experiment. The used model is

\[y = p_0-p_1 e^{-x p_2}.\]
qibocal.protocols.coherence.zeno_signal._plot(data: ZenoSignalData, fit: ZenoSignalResults, target: Union[str, int])[source]#

Plotting function for T1 experiment.

qibocal.protocols.coherence.zeno_signal._update(results: ZenoSignalResults, platform: Platform, qubit: Union[str, int])[source]#