qibocal.protocols.zz_interaction package

Submodules

qibocal.protocols.zz_interaction.jazz module

qibocal.protocols.zz_interaction.jazz.jazz = Protocol(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function zz_update>, two_qubit_gates=False)

JAZZ Protocol object.

qibocal.protocols.zz_interaction.ramsey_zz module

qibocal.protocols.zz_interaction.ramsey_zz.ramsey_zz = Protocol(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function zz_update>, two_qubit_gates=False)

Ramsey ZZ Protocol object.

This protocol measures the state-dependent frequency shift (ZZ interaction) between a selected target qubit and one spectator qubit. It performs two Ramsey experiments for each qubit in the target list:

  • “I” setup: spectator qubit remain in the ground state.

  • “X” setup: spectator qubit is excited before the Ramsey sequence.

The fitted Ramsey frequencies from these two experiments are compared to extract the conditional ZZ shift experienced by each measured qubit. The difference between the two fitted frequencies is reported as the ZZ interaction strength. Using the measured qubit frequencies, the target qubit frequency, and the anharmonicities, the routine also estimates the effective coupling strength between each qubit and the target qubit. This protocol is useful for characterizing residual static coupling and frequency shifts induced by an excited neighboring qubit. The plot output shows Ramsey traces in probability for both the I and X setups.

qibocal.protocols.zz_interaction.utils module

qibocal.protocols.zz_interaction.utils.EPS = 1

we add 1Hz when computing Delta frequency between the two qubit frequencies in order to avoid numerical error.

class qibocal.protocols.zz_interaction.utils.ZZInteractionParameters(delay_range: tuple[float, float, float])[source]

Bases: Parameters

Parameters for ZZ-interaction experiments.

delay_range: tuple[float, float, float]

delay time range (start, stop, step) in the sequence. Applied twice.

nshots: int

Number of executions on hardware.

relaxation_time: float

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

qibocal.protocols.zz_interaction.utils.ZZIntType = dtype([('delay', '<f8'), ('targ_prob', '<f8'), ('targ_error', '<f8'), ('spect_prob', '<f8'), ('spect_error', '<f8')])

Custom dtype for ZZ-Interaction routines.

class qibocal.protocols.zz_interaction.utils.ZZInteractionData(qubit_freqs: dict[~types.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], float] = <factory>, anharmonicity: dict[~types.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], float] = <factory>)[source]

Bases: Data

Data for ZZ-interaction experiments.

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

Qubit freqs for each qubit.

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

Targets qubit anharmonicity.

property delays: ndarray[tuple[int, ...], dtype[_ScalarType_co]]

Return a list with the delay times without repetitions.

_to_json(path: Path, filename: str)

Helper function to dump to json.

_to_npz(path: Path, filename: str)

Helper function to use np.savez while converting keys into strings.

static load_data(path: Path, filename: str)

Load data stored in a npz file.

static load_params(path: Path, filename: str)

Load parameters stored in a json file.

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

Access qubit pairs from data structure.

property params: dict

Convert non-arrays attributes into dict.

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

Access qubits from data structure.

register_qubit(dtype, data_keys, data_dict)

Store output for single qubit.

Parameters:
  • data_keys (tuple) – Keys of Data.data.

  • data_dict (dict) – The keys are the fields of dtype and

  • arrays. (the values are the related)

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

Store data to file.

class qibocal.protocols.zz_interaction.utils.ZZInteractionResults(zz: dict[~typing.Annotated[tuple[~types.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~types.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], list[float]] = <factory>, coupling: dict[~typing.Annotated[tuple[~types.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~types.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], list[float]] = <factory>)[source]

Bases: Results

Container for ZZ-interaction experiments results.

_to_json(path: Path, filename: str)

Helper function to dump to json.

_to_npz(path: Path, filename: str)

Helper function to use np.savez while converting keys into strings.

static load_data(path: Path, filename: str)

Load data stored in a npz file.

static load_params(path: Path, filename: str)

Load parameters stored in a json file.

property params: dict

Convert non-arrays attributes into dict.

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

Store results to file.

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

Estimated ZZ coupling of a qubit pair.

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

Estimated coupling strength of a qubit pair.

qibocal.protocols.zz_interaction.utils.coupling_strength(omega1: float, omega2: float, anharmonicity1: float, anharmonicity2: float, zz: list[float]) list[float][source]

Compute the ZZ coupling from the difference in frequency and anharmonicity.

coupling computing by inverting the following formula delta_q = omega1 - omega2 xi = 2 g**2 (1 / (delta_q - alpha_2) - 1 / (delta_q + alpha_1)) where delta_q is the difference in frequency and alpha_i is the anharmonicity

qibocal.protocols.zz_interaction.utils.signal_plot(signal: ndarray[tuple[int, ...], dtype[dtype(['delay', '<f8', 'targ_prob', '<f8', 'targ_error', '<f8', 'spect_prob', '<f8', 'spect_error', '<f8'])]], module: Callable, fit_params: list[float] | None = None, label: Literal['I', 'X', ''] = '') tuple[list[Scatter], list[Scatter]][source]

Plotting function for ZZ Interaction experiments.

qibocal.protocols.zz_interaction.utils.create_report_table(target: ~typing.Annotated[tuple[~types.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~types.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)], fit: ~qibocal.protocols.zz_interaction.utils.ZZInteractionResults)[source]

Create an HTML table summarizing ZZ-interaction fit results for a qubit pair.

qibocal.protocols.zz_interaction.utils.zz_update(results: ~qibocal.protocols.zz_interaction.utils.ZZInteractionResults, platform: ~qibocal.calibration.platform.CalibrationPlatform, target: ~typing.Annotated[tuple[~types.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], ~types.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], ~pydantic.functional_validators.BeforeValidator(func=~qibocal.calibration.calibration.<lambda>, json_schema_input_type=PydanticUndefined), ~pydantic.functional_serializers.PlainSerializer(func=~qibocal.calibration.calibration.<lambda>, return_type=PydanticUndefined, when_used=always)]) None[source]

Update the platform calibration with the results of the Ramsey ZZ experiment.