qibocal.protocols.twpa package

Submodules

qibocal.protocols.twpa.twpa module

Protocol to calibrate TWPA power and frequency for a specific probe frequency.

class qibocal.protocols.twpa.twpa.TwpaCalibrationParameters(freq_width: float, freq_step: float, twpa_freq_width: int, twpa_freq_step: int, twpa_pow_width: int, twpa_pow_step: int, nshots: int | None = None, relaxation_time: int | None = None)[source]

Bases: Parameters

TwpaCalibration runcard inputs.

freq_width: float

Width for frequency sweep of readout pulse (Hz).

freq_step: float

Frequency step for sweep of readout pulse (Hz).

twpa_freq_width: int

Width for TPWA frequency sweep (Hz).

twpa_freq_step: int

TPWA frequency step (Hz).

twpa_pow_width: int

Width for TPWA power sweep (dBm).

twpa_pow_step: int

TPWA power step (dBm).

nshots: int | None = None

Number of shots.

relaxation_time: int | None = None

Relaxation time (ns).

hardware_average: bool = False

By default hardware average will be performed.

class qibocal.protocols.twpa.twpa.TwpaCalibrationResults(data: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ndarray[tuple[Any, ...], dtype[_ScalarT]]], twpa_frequency: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], float], twpa_power: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], float])[source]

Bases: Results

TwpaCalibration outputs.

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

Array with average gain for each qubit.

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

TWPA frequency [GHz].

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

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

TWPA power [dBm].

class qibocal.protocols.twpa.twpa.TwpaCalibrationData(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>, twpa_frequency: dict[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], list[float]] = <class 'list'>, twpa_power: dict[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], list[float]] = <class 'list'>, reference_value: dict[~typing.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], list[float]] = <class 'list'>)[source]

Bases: Data

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

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.

twpa_frequency

List with twpa frequency values swept.

alias of list

twpa_power

List with twpa power values swept.

alias of list

reference_value

Values for readout frequency sweep with TWPA off.

alias of list

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

Return reference value as a numpy array.

qibocal.protocols.twpa.twpa._acquisition(params: TwpaCalibrationParameters, platform: Platform, targets: list[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]]) TwpaCalibrationData[source]

Acquisition function for TwpaCalibration.

First perform a scan over the readout probe with the TWPA off, then we sweep the TWPA power and frequency. The gain is computed as the norm of the complex readout signal divided the norm of the complex readout signal without TWPA.

qibocal.protocols.twpa.twpa._fit(data: TwpaCalibrationData) TwpaCalibrationResults[source]

Post-processing function for TwpaCalibration.

After computing the averaged gain we select the corresponding twpa frequency and power that maximizes the gain for each qubit.

qibocal.protocols.twpa.twpa._plot(data: TwpaCalibrationData, fit: TwpaCalibrationResults, target)[source]

Plotting for TwpaCalibration.

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

Resonator TWPA Frequency Routine object.