qibocal.protocols.rabi package#

Submodules#

qibocal.protocols.rabi.amplitude module#

class qibocal.protocols.rabi.amplitude.RabiAmplitudeParameters(min_amp_factor: float, max_amp_factor: float, step_amp_factor: float, pulse_length: Optional[float] = None)[source]#

Bases: RabiAmplitudeSignalParameters

RabiAmplitude runcard inputs.

hardware_average: bool = False#

By default hardware average will be performed.

pulse_length: Optional[float] = None#

RX pulse duration [ns].

min_amp_factor: float#

Minimum amplitude multiplicative factor.

max_amp_factor: float#

Maximum amplitude multiplicative factor.

step_amp_factor: float#

Step amplitude multiplicative factor.

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.rabi.amplitude.RabiAmplitudeResults(amplitude: dict[typing.Union[str, int], typing.Union[float, list[float]]], length: dict[typing.Union[str, int], typing.Union[float, list[float]]], fitted_parameters: dict[typing.Union[str, int], dict[str, float]], chi2: dict[typing.Union[str, int], list[float]] = <factory>)[source]#

Bases: RabiAmplitudeSignalResults

RabiAmplitude outputs.

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

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

Drive amplitude for each qubit.

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

Drive pulse duration. Same for all qubits.

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

Raw fitted parameters.

qibocal.protocols.rabi.amplitude.RabiAmpType = dtype([('amp', '<f8'), ('prob', '<f8'), ('error', '<f8')])#

Custom dtype for rabi amplitude.

class qibocal.protocols.rabi.amplitude.RabiAmplitudeData(durations: dict[typing.Union[str, int], float] = <factory>, data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[dtype([('amp', '<f8'), ('prob', '<f8'), ('error', '<f8')])]]] = <factory>)[source]#

Bases: Data

RabiAmplitude data acquisition.

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

Pulse durations provided by the user.

data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[dtype([('amp', '<f8'), ('prob', '<f8'), ('error', '<f8')])]]]#

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

Data acquisition for Rabi experiment sweeping amplitude. In the Rabi experiment we apply a pulse at the frequency of the qubit and scan the drive pulse amplitude to find the drive pulse amplitude that creates a rotation of a desired angle.

qibocal.protocols.rabi.amplitude._fit(data: RabiAmplitudeData) RabiAmplitudeResults[source]#

Post-processing for RabiAmplitude.

qibocal.protocols.rabi.amplitude._plot(data: RabiAmplitudeData, target: Union[str, int], fit: Optional[RabiAmplitudeResults] = None)[source]#

Plotting function for RabiAmplitude.

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

RabiAmplitude Routine object.

qibocal.protocols.rabi.amplitude_frequency module#

Rabi experiment that sweeps amplitude and frequency.

class qibocal.protocols.rabi.amplitude_frequency.RabiAmplitudeFrequencyParameters(min_amp_factor: float, max_amp_factor: float, step_amp_factor: float, min_freq: int, max_freq: int, step_freq: int, pulse_length: Optional[float] = None)[source]#

Bases: RabiAmplitudeFrequencySignalParameters

RabiAmplitudeFrequency runcard inputs.

hardware_average: bool = False#

By default hardware average will be performed.

pulse_length: Optional[float] = None#

RX pulse duration [ns].

min_amp_factor: float#

Minimum amplitude multiplicative factor.

max_amp_factor: float#

Maximum amplitude multiplicative factor.

step_amp_factor: float#

Step amplitude multiplicative factor.

min_freq: int#

Minimum frequency as an offset.

max_freq: int#

Maximum frequency as an offset.

step_freq: int#

Frequency to use as step for the scan.

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.rabi.amplitude_frequency.RabiAmplitudeFrequencyResults(amplitude: dict[typing.Union[str, int], typing.Union[float, list[float]]], length: dict[typing.Union[str, int], typing.Union[float, list[float]]], fitted_parameters: dict[typing.Union[str, int], dict[str, float]], frequency: dict[typing.Union[str, int], typing.Union[float, list[float]]], chi2: dict[typing.Union[str, int], list[float]] = <factory>)[source]#

Bases: RabiAmplitudeFrequencySignalResults

RabiAmplitudeFrequency outputs.

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

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

Drive frequency for each qubit.

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

Drive amplitude for each qubit.

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

Drive pulse duration. Same for all qubits.

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

Raw fitted parameters.

qibocal.protocols.rabi.amplitude_frequency.RabiAmpFreqType = dtype([('amp', '<f8'), ('freq', '<f8'), ('prob', '<f8'), ('error', '<f8')])#

Custom dtype for rabi amplitude.

class qibocal.protocols.rabi.amplitude_frequency.RabiAmplitudeFreqData(durations: dict[typing.Union[str, int], float] = <factory>, data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[dtype([('amp', '<f8'), ('freq', '<f8'), ('prob', '<f8'), ('error', '<f8')])]]] = <factory>)[source]#

Bases: RabiAmplitudeFreqSignalData

RabiAmplitudeFreq data acquisition.

data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[dtype([('amp', '<f8'), ('freq', '<f8'), ('prob', '<f8'), ('error', '<f8')])]]]#

Raw data acquired.

register_qubit(qubit, freq, amp, prob, error)[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.

amplitudes(qubit)#

Unique qubit amplitudes.

frequencies(qubit)#

Unique qubit frequency.

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.

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

Pulse durations provided by the user.

qibocal.protocols.rabi.amplitude_frequency._acquisition(params: RabiAmplitudeFrequencyParameters, platform: Platform, targets: list[Union[str, int]]) RabiAmplitudeFreqData[source]#

Data acquisition for Rabi experiment sweeping amplitude.

qibocal.protocols.rabi.amplitude_frequency._fit(data: RabiAmplitudeFreqData) RabiAmplitudeFrequencyResults[source]#

Do not perform any fitting procedure.

qibocal.protocols.rabi.amplitude_frequency._plot(data: RabiAmplitudeFreqData, target: Union[str, int], fit: Optional[RabiAmplitudeFrequencyResults] = None)[source]#

Plotting function for RabiAmplitudeFrequency.

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

Rabi amplitude with frequency tuning.

qibocal.protocols.rabi.amplitude_frequency_signal module#

Rabi experiment that sweeps amplitude and frequency (with probability).

class qibocal.protocols.rabi.amplitude_frequency_signal.RabiAmplitudeFrequencySignalParameters(min_amp_factor: float, max_amp_factor: float, step_amp_factor: float, min_freq: int, max_freq: int, step_freq: int, pulse_length: Optional[float] = None)[source]#

Bases: Parameters

RabiAmplitudeFrequency runcard inputs.

min_amp_factor: float#

Minimum amplitude multiplicative factor.

max_amp_factor: float#

Maximum amplitude multiplicative factor.

step_amp_factor: float#

Step amplitude multiplicative factor.

min_freq: int#

Minimum frequency as an offset.

max_freq: int#

Maximum frequency as an offset.

step_freq: int#

Frequency to use as step for the scan.

pulse_length: Optional[float] = None#

RX pulse duration [ns].

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.rabi.amplitude_frequency_signal.RabiAmplitudeFrequencySignalResults(amplitude: dict[Union[str, int], Union[float, list[float]]], length: dict[Union[str, int], Union[float, list[float]]], fitted_parameters: dict[Union[str, int], dict[str, float]], frequency: dict[Union[str, int], Union[float, list[float]]])[source]#

Bases: RabiAmplitudeSignalResults

RabiAmplitudeFrequency outputs.

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

Drive frequency 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 params: dict#

Convert non-arrays attributes into dict.

save(path: Path)#

Store results to file.

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

Drive amplitude for each qubit.

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

Drive pulse duration. Same for all qubits.

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

Raw fitted parameters.

qibocal.protocols.rabi.amplitude_frequency_signal.RabiAmpFreqSignalType = dtype([('amp', '<f8'), ('freq', '<f8'), ('signal', '<f8'), ('phase', '<f8')])#

Custom dtype for rabi amplitude.

class qibocal.protocols.rabi.amplitude_frequency_signal.RabiAmplitudeFreqSignalData(durations: dict[typing.Union[str, int], float] = <factory>, data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[dtype([('amp', '<f8'), ('freq', '<f8'), ('signal', '<f8'), ('phase', '<f8')])]]] = <factory>)[source]#

Bases: Data

RabiAmplitudeFreqSignal data acquisition.

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

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

Pulse durations provided by the user.

data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[dtype([('amp', '<f8'), ('freq', '<f8'), ('signal', '<f8'), ('phase', '<f8')])]]]#

Raw data acquired.

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

Store output for single qubit.

amplitudes(qubit)[source]#

Unique qubit amplitudes.

frequencies(qubit)[source]#

Unique qubit frequency.

qibocal.protocols.rabi.amplitude_frequency_signal._acquisition(params: RabiAmplitudeFrequencySignalParameters, platform: Platform, targets: list[Union[str, int]]) RabiAmplitudeFreqSignalData[source]#

Data acquisition for Rabi experiment sweeping amplitude.

qibocal.protocols.rabi.amplitude_frequency_signal._fit(data: RabiAmplitudeFreqSignalData) RabiAmplitudeFrequencySignalResults[source]#

Do not perform any fitting procedure.

qibocal.protocols.rabi.amplitude_frequency_signal._plot(data: RabiAmplitudeFreqSignalData, target: Union[str, int], fit: Optional[RabiAmplitudeFrequencySignalResults] = None)[source]#

Plotting function for RabiAmplitudeFrequency.

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

Rabi amplitude with frequency tuning.

qibocal.protocols.rabi.amplitude_signal module#

class qibocal.protocols.rabi.amplitude_signal.RabiAmplitudeSignalParameters(min_amp_factor: float, max_amp_factor: float, step_amp_factor: float, pulse_length: Optional[float] = None)[source]#

Bases: Parameters

RabiAmplitude runcard inputs.

min_amp_factor: float#

Minimum amplitude multiplicative factor.

max_amp_factor: float#

Maximum amplitude multiplicative factor.

step_amp_factor: float#

Step amplitude multiplicative factor.

pulse_length: Optional[float] = None#

RX pulse duration [ns].

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.rabi.amplitude_signal.RabiAmplitudeSignalResults(amplitude: dict[Union[str, int], Union[float, list[float]]], length: dict[Union[str, int], Union[float, list[float]]], fitted_parameters: dict[Union[str, int], dict[str, float]])[source]#

Bases: Results

RabiAmplitude outputs.

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

Drive amplitude for each qubit.

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

Drive pulse duration. Same for all qubits.

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

Raw 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.rabi.amplitude_signal.RabiAmpSignalType = dtype([('amp', '<f8'), ('signal', '<f8'), ('phase', '<f8')])#

Custom dtype for rabi amplitude.

class qibocal.protocols.rabi.amplitude_signal.RabiAmplitudeSignalData(durations: dict[typing.Union[str, int], float] = <factory>, data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[dtype([('amp', '<f8'), ('signal', '<f8'), ('phase', '<f8')])]]] = <factory>)[source]#

Bases: Data

RabiAmplitudeSignal data acquisition.

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

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

Pulse durations provided by the user.

data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[dtype([('amp', '<f8'), ('signal', '<f8'), ('phase', '<f8')])]]]#

Raw data acquired.

qibocal.protocols.rabi.amplitude_signal._acquisition(params: RabiAmplitudeSignalParameters, platform: Platform, targets: list[Union[str, int]]) RabiAmplitudeSignalData[source]#

Data acquisition for Rabi experiment sweeping amplitude. In the Rabi experiment we apply a pulse at the frequency of the qubit and scan the drive pulse amplitude to find the drive pulse amplitude that creates a rotation of a desired angle.

qibocal.protocols.rabi.amplitude_signal._fit(data: RabiAmplitudeSignalData) RabiAmplitudeSignalResults[source]#

Post-processing for RabiAmplitude.

qibocal.protocols.rabi.amplitude_signal._plot(data: RabiAmplitudeSignalData, target: Union[str, int], fit: Optional[RabiAmplitudeSignalResults] = None)[source]#

Plotting function for RabiAmplitude.

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

RabiAmplitude Routine object.

qibocal.protocols.rabi.ef module#

class qibocal.protocols.rabi.ef.RabiAmplitudeEFParameters(min_amp_factor: float, max_amp_factor: float, step_amp_factor: float, pulse_length: Optional[float] = None)[source]#

Bases: RabiAmplitudeSignalParameters

RabiAmplitudeEF runcard inputs.

hardware_average: bool = False#

By default hardware average will be performed.

pulse_length: Optional[float] = None#

RX pulse duration [ns].

min_amp_factor: float#

Minimum amplitude multiplicative factor.

max_amp_factor: float#

Maximum amplitude multiplicative factor.

step_amp_factor: float#

Step amplitude multiplicative factor.

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.rabi.ef.RabiAmplitudeEFResults(amplitude: dict[Union[str, int], Union[float, list[float]]], length: dict[Union[str, int], Union[float, list[float]]], fitted_parameters: dict[Union[str, int], dict[str, float]])[source]#

Bases: RabiAmplitudeSignalResults

RabiAmplitudeEF 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)#

Store results to file.

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

Drive amplitude for each qubit.

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

Drive pulse duration. Same for all qubits.

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

Raw fitted parameters.

class qibocal.protocols.rabi.ef.RabiAmplitudeEFData(durations: dict[typing.Union[str, int], float] = <factory>, data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[dtype([('amp', '<f8'), ('signal', '<f8'), ('phase', '<f8')])]]] = <factory>)[source]#

Bases: RabiAmplitudeSignalData

RabiAmplitude data acquisition.

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

durations: dict[QubitId, float]#

Pulse durations provided by the user.

data: dict[QubitId, npt.NDArray[RabiAmpSignalType]]#

Raw data acquired.

qibocal.protocols.rabi.ef._acquisition(params: RabiAmplitudeEFParameters, platform: Platform, targets: list[Union[str, int]]) RabiAmplitudeEFData[source]#

Data acquisition for Rabi EF experiment sweeping amplitude.

The rabi protocol is performed after exciting the qubit to state 1. This protocol allows to compute the amplitude of the RX12 pulse to excite the qubit to state 2 starting from state 1.

qibocal.protocols.rabi.ef._plot(data: RabiAmplitudeEFData, target: Union[str, int], fit: Optional[RabiAmplitudeEFResults] = None)[source]#

Plotting function for RabiAmplitude.

qibocal.protocols.rabi.ef._update(results: RabiAmplitudeEFResults, platform: Platform, target: Union[str, int])[source]#

Update RX2 amplitude_signal

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

RabiAmplitudeEF Routine object.

qibocal.protocols.rabi.length module#

class qibocal.protocols.rabi.length.RabiLengthParameters(pulse_duration_start: float, pulse_duration_end: float, pulse_duration_step: float, pulse_amplitude: Optional[float] = None)[source]#

Bases: Parameters

RabiLength runcard inputs.

pulse_duration_start: float#

Initial pi pulse duration [ns].

pulse_duration_end: float#

Final pi pulse duration [ns].

pulse_duration_step: float#

Step pi pulse duration [ns].

pulse_amplitude: Optional[float] = None#

Pi pulse amplitude. Same for all qubits.

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.rabi.length.RabiLengthResults(length: dict[typing.Union[str, int], typing.Union[int, list[float]]], amplitude: dict[typing.Union[str, int], typing.Union[float, list[float]]], fitted_parameters: dict[typing.Union[str, int], dict[str, float]], chi2: dict[typing.Union[str, int], list[float]] = <factory>)[source]#

Bases: RabiLengthSignalResults

RabiLength outputs.

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

length: dict[QubitId, Union[int, list[float]]]#

Pi pulse duration for each qubit.

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

Pi pulse amplitude. Same for all qubits.

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

Raw fitting output.

qibocal.protocols.rabi.length.RabiLenType = dtype([('length', '<f8'), ('prob', '<f8'), ('error', '<f8')])#

Custom dtype for rabi amplitude.

class qibocal.protocols.rabi.length.RabiLengthData(amplitudes: dict[typing.Union[str, int], float] = <factory>, data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[dtype([('length', '<f8'), ('prob', '<f8'), ('error', '<f8')])]]] = <factory>)[source]#

Bases: RabiLengthSignalData

RabiLength 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[dtype([('length', '<f8'), ('prob', '<f8'), ('error', '<f8')])]]]#

Raw data acquired.

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

Pulse durations provided by the user.

qibocal.protocols.rabi.length._acquisition(params: RabiLengthParameters, platform: Platform, targets: list[Union[str, int]]) RabiLengthData[source]#

Data acquisition for RabiLength Experiment. In the Rabi experiment we apply a pulse at the frequency of the qubit and scan the drive pulse length to find the drive pulse length that creates a rotation of a desired angle.

qibocal.protocols.rabi.length._fit(data: RabiLengthData) RabiLengthResults[source]#

Post-processing for RabiLength experiment.

qibocal.protocols.rabi.length._update(results: RabiLengthResults, platform: Platform, target: Union[str, int])[source]#
qibocal.protocols.rabi.length._plot(data: RabiLengthData, fit: RabiLengthResults, target: Union[str, int])[source]#

Plotting function for RabiLength experiment.

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

RabiLength Routine object.

qibocal.protocols.rabi.length_frequency module#

Rabi experiment that sweeps length and frequency (with probability).

class qibocal.protocols.rabi.length_frequency.RabiLengthFrequencyParameters(pulse_duration_start: float, pulse_duration_end: float, pulse_duration_step: float, min_freq: int, max_freq: int, step_freq: int, pulse_amplitude: Optional[float] = None)[source]#

Bases: RabiLengthFrequencySignalParameters

RabiLengthFrequency runcard inputs.

hardware_average: bool = False#

By default hardware average will be performed.

pulse_amplitude: Optional[float] = None#

Pi pulse amplitude. Same for all qubits.

pulse_duration_start: float#

Initial pi pulse duration [ns].

pulse_duration_end: float#

Final pi pulse duration [ns].

pulse_duration_step: float#

Step pi pulse duration [ns].

min_freq: int#

Minimum frequency as an offset.

max_freq: int#

Maximum frequency as an offset.

step_freq: int#

Frequency to use as step for the scan.

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.rabi.length_frequency.RabiLengthFrequencyResults(length: dict[typing.Union[str, int], typing.Union[int, list[float]]], amplitude: dict[typing.Union[str, int], typing.Union[float, list[float]]], fitted_parameters: dict[typing.Union[str, int], dict[str, float]], frequency: dict[typing.Union[str, int], typing.Union[float, list[float]]], chi2: dict[typing.Union[str, int], list[float]] = <factory>)[source]#

Bases: RabiLengthFrequencySignalResults

RabiLengthFrequency outputs.

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

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

Drive frequency for each qubit.

length: dict[QubitId, Union[int, list[float]]]#

Pi pulse duration for each qubit.

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

Pi pulse amplitude. Same for all qubits.

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

Raw fitting output.

qibocal.protocols.rabi.length_frequency.RabiLenFreqType = dtype([('len', '<f8'), ('freq', '<f8'), ('prob', '<f8'), ('error', '<f8')])#

Custom dtype for rabi length.

class qibocal.protocols.rabi.length_frequency.RabiLengthFreqData(amplitudes: dict[typing.Union[str, int], float] = <factory>, data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[dtype([('len', '<f8'), ('freq', '<f8'), ('prob', '<f8'), ('error', '<f8')])]]] = <factory>)[source]#

Bases: RabiLengthFreqSignalData

RabiLengthFreq data acquisition.

data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[dtype([('len', '<f8'), ('freq', '<f8'), ('prob', '<f8'), ('error', '<f8')])]]]#

Raw data acquired.

register_qubit(qubit, freq, lens, prob, error)[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.

durations(qubit)#

Unique qubit lengths.

frequencies(qubit)#

Unique qubit frequency.

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.

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

Pulse amplitudes provided by the user.

qibocal.protocols.rabi.length_frequency._acquisition(params: RabiLengthFrequencyParameters, platform: Platform, targets: list[Union[str, int]]) RabiLengthFreqData[source]#

Data acquisition for Rabi experiment sweeping length.

qibocal.protocols.rabi.length_frequency._fit(data: RabiLengthFreqData) RabiLengthFrequencyResults[source]#

Do not perform any fitting procedure.

qibocal.protocols.rabi.length_frequency._plot(data: RabiLengthFreqData, target: Union[str, int], fit: Optional[RabiLengthFrequencyResults] = None)[source]#

Plotting function for RabiLengthFrequency.

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

Rabi length with frequency tuning.

qibocal.protocols.rabi.length_frequency_signal module#

Rabi experiment that sweeps length and frequency.

class qibocal.protocols.rabi.length_frequency_signal.RabiLengthFrequencySignalParameters(pulse_duration_start: float, pulse_duration_end: float, pulse_duration_step: float, min_freq: int, max_freq: int, step_freq: int, pulse_amplitude: Optional[float] = None)[source]#

Bases: Parameters

RabiLengthFrequency runcard inputs.

pulse_duration_start: float#

Initial pi pulse duration [ns].

pulse_duration_end: float#

Final pi pulse duration [ns].

pulse_duration_step: float#

Step pi pulse duration [ns].

min_freq: int#

Minimum frequency as an offset.

max_freq: int#

Maximum frequency as an offset.

step_freq: int#

Frequency to use as step for the scan.

pulse_amplitude: Optional[float] = None#

Pi pulse amplitude. Same for all qubits.

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.rabi.length_frequency_signal.RabiLengthFrequencySignalResults(length: dict[Union[str, int], Union[int, list[float]]], amplitude: dict[Union[str, int], Union[float, list[float]]], fitted_parameters: dict[Union[str, int], dict[str, float]], frequency: dict[Union[str, int], Union[float, list[float]]])[source]#

Bases: RabiLengthSignalResults

RabiLengthFrequency outputs.

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

Drive frequency 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 params: dict#

Convert non-arrays attributes into dict.

save(path: Path)#

Store results to file.

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

Pi pulse duration for each qubit.

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

Pi pulse amplitude. Same for all qubits.

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

Raw fitting output.

qibocal.protocols.rabi.length_frequency_signal.RabiLenFreqSignalType = dtype([('len', '<f8'), ('freq', '<f8'), ('signal', '<f8'), ('phase', '<f8')])#

Custom dtype for rabi length.

class qibocal.protocols.rabi.length_frequency_signal.RabiLengthFreqSignalData(amplitudes: dict[typing.Union[str, int], float] = <factory>, data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[dtype([('len', '<f8'), ('freq', '<f8'), ('signal', '<f8'), ('phase', '<f8')])]]] = <factory>)[source]#

Bases: Data

RabiLengthFreqSignal data acquisition.

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

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

Pulse amplitudes provided by the user.

data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[dtype([('len', '<f8'), ('freq', '<f8'), ('signal', '<f8'), ('phase', '<f8')])]]]#

Raw data acquired.

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

Store output for single qubit.

durations(qubit)[source]#

Unique qubit lengths.

frequencies(qubit)[source]#

Unique qubit frequency.

qibocal.protocols.rabi.length_frequency_signal._acquisition(params: RabiLengthFrequencySignalParameters, platform: Platform, targets: list[Union[str, int]]) RabiLengthFreqSignalData[source]#

Data acquisition for Rabi experiment sweeping length.

qibocal.protocols.rabi.length_frequency_signal._fit(data: RabiLengthFreqSignalData) RabiLengthFrequencySignalResults[source]#

Do not perform any fitting procedure.

qibocal.protocols.rabi.length_frequency_signal._plot(data: RabiLengthFreqSignalData, target: Union[str, int], fit: Optional[RabiLengthFrequencySignalResults] = None)[source]#

Plotting function for RabiLengthFrequency.

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

Rabi length with frequency tuning.

qibocal.protocols.rabi.length_sequences module#

qibocal.protocols.rabi.length_sequences._acquisition(params: RabiLengthSignalParameters, platform: Platform, targets: list[Union[str, int]]) RabiLengthSignalData[source]#

Data acquisition for RabiLength Experiment. In the Rabi experiment we apply a pulse at the frequency of the qubit and scan the drive pulse length to find the drive pulse length that creates a rotation of a desired angle.

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

RabiLength Routine object.

qibocal.protocols.rabi.length_signal module#

class qibocal.protocols.rabi.length_signal.RabiLengthSignalParameters(pulse_duration_start: float, pulse_duration_end: float, pulse_duration_step: float, pulse_amplitude: Optional[float] = None)[source]#

Bases: Parameters

RabiLengthSignal runcard inputs.

pulse_duration_start: float#

Initial pi pulse duration [ns].

pulse_duration_end: float#

Final pi pulse duration [ns].

pulse_duration_step: float#

Step pi pulse duration [ns].

pulse_amplitude: Optional[float] = None#

Pi pulse amplitude. Same for all qubits.

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.rabi.length_signal.RabiLengthSignalResults(length: dict[Union[str, int], Union[int, list[float]]], amplitude: dict[Union[str, int], Union[float, list[float]]], fitted_parameters: dict[Union[str, int], dict[str, float]])[source]#

Bases: Results

RabiLengthSignal outputs.

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

Pi pulse duration for each qubit.

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

Pi pulse amplitude. Same for all qubits.

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.

qibocal.protocols.rabi.length_signal.RabiLenSignalType = dtype([('length', '<f8'), ('signal', '<f8'), ('phase', '<f8')])#

Custom dtype for rabi amplitude.

class qibocal.protocols.rabi.length_signal.RabiLengthSignalData(amplitudes: dict[typing.Union[str, int], float] = <factory>, data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[dtype([('length', '<f8'), ('signal', '<f8'), ('phase', '<f8')])]]] = <factory>)[source]#

Bases: Data

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

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

Pulse durations provided by the user.

data: dict[typing.Union[str, int], numpy.ndarray[typing.Any, numpy.dtype[dtype([('length', '<f8'), ('signal', '<f8'), ('phase', '<f8')])]]]#

Raw data acquired.

qibocal.protocols.rabi.length_signal._acquisition(params: RabiLengthSignalParameters, platform: Platform, targets: list[Union[str, int]]) RabiLengthSignalData[source]#

Data acquisition for RabiLength Experiment. In the Rabi experiment we apply a pulse at the frequency of the qubit and scan the drive pulse length to find the drive pulse length that creates a rotation of a desired angle.

qibocal.protocols.rabi.length_signal._fit(data: RabiLengthSignalData) RabiLengthSignalResults[source]#

Post-processing for RabiLength experiment.

qibocal.protocols.rabi.length_signal._update(results: RabiLengthSignalResults, platform: Platform, target: Union[str, int])[source]#
qibocal.protocols.rabi.length_signal._plot(data: RabiLengthSignalData, fit: RabiLengthSignalResults, target: Union[str, int])[source]#

Plotting function for RabiLength experiment.

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

RabiLength Routine object.

qibocal.protocols.rabi.utils module#

qibocal.protocols.rabi.utils.rabi_amplitude_function(x, offset, amplitude, period, phase)[source]#

Fit function of Rabi amplitude signal experiment.

Parameters:

x – Input data.

qibocal.protocols.rabi.utils.rabi_length_function(x, offset, amplitude, period, phase, t2_inv)[source]#

Fit function of Rabi length signal experiment.

Parameters:

x – Input data.

qibocal.protocols.rabi.utils.plot(data, qubit, fit)[source]#
qibocal.protocols.rabi.utils.plot_probabilities(data, qubit, fit)[source]#
qibocal.protocols.rabi.utils.extract_rabi(data)[source]#

Extract Rabi fit info.

qibocal.protocols.rabi.utils.period_correction_factor(phase: float)[source]#

Correct period by taking phase into account.

https://github.com/qiboteam/qibocal/issues/656

We want to find the first maximum or minimum which will correspond to an exchange of population between 0 and 1. To find it we need to solve the following equation \(\cos(2 \pi x / T + \phi) = \pm 1\) which will give us the following solution

\[x = ( k - \phi / \pi) T / 2\]

for integer \(k\), which is chosen such that we get the smallest multiplicative correction compared to \(T/2\).

qibocal.protocols.rabi.utils.sequence_amplitude(targets: list[Union[str, int]], params: Parameters, platform: Platform) tuple[qibolab.pulses.PulseSequence, dict, dict, dict][source]#

Return sequence for rabi amplitude.

qibocal.protocols.rabi.utils.sequence_length(targets: list[Union[str, int]], params: Parameters, platform: Platform) tuple[qibolab.pulses.PulseSequence, dict, dict, dict][source]#

Return sequence for rabi length.

qibocal.protocols.rabi.utils.fit_length_function(x, y, guess, sigma=None, signal=True, x_limits=(None, None), y_limits=(None, None))[source]#
qibocal.protocols.rabi.utils.fit_amplitude_function(x, y, guess, sigma=None, signal=True, x_limits=(None, None), y_limits=(None, None))[source]#