qibocal.protocols.ramsey package¶
Submodules¶
qibocal.protocols.ramsey.acquisition module¶
- exception qibocal.protocols.ramsey.acquisition.InputError[source]¶
Bases:
Exception- add_note()¶
Exception.add_note(note) – add a note to the exception
- args¶
- with_traceback()¶
Exception.with_traceback(tb) – set self.__traceback__ to tb and return self.
- class qibocal.protocols.ramsey.acquisition.RamseyParameters(delay: tuple[float, float, float] | None = None, delay_between_pulses_start: float | None = None, delay_between_pulses_end: float | None = None, delay_between_pulses_step: float | None = None, detuning: float | None = None)[source]¶
Bases:
ParametersRamsey runcard inputs.
- delay: tuple[float, float, float] | None = None¶
(start, stop, step).
- Type:
Tuple of the sweeper parameters in the form
- detuning: float | None = None¶
Frequency detuning [Hz] (optional). If 0 standard Ramsey experiment is performed.
- class qibocal.protocols.ramsey.acquisition.RamseyResults(detuning: float | None = None, frequency: dict[~types.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], list[float]] = <factory>, t2: dict[~types.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], list[float]] = <factory>, delta_phys: dict[~types.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], list[float]] = <factory>, delta_fitting: dict[~types.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], list[float]] = <factory>, fitted_parameters: dict[~types.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], list[float]] = <factory>)[source]¶
Bases:
ResultsRamsey outputs.
- frequency: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], list[float]]¶
Drive frequency [GHz] for each qubit.
- t2: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], list[float]]¶
T2 for each qubit [ns].
- delta_phys: dict[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], list[float]]¶
Drive frequency [Hz] correction for each qubit.
- _to_npz(path: Path, filename: str)¶
Helper function to use np.savez while converting keys into strings.
- class qibocal.protocols.ramsey.acquisition.RamseyData(detuning: float | None = None, qubit_freqs: dict[~types.Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], float] = <factory>)[source]¶
Bases:
DataRamsey acquisition outputs.
- _to_npz(path: Path, filename: str)¶
Helper function to use np.savez while converting keys into strings.
- 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 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.
- qibocal.protocols.ramsey.acquisition.single_qubit_ramsey_sequence(platform: Platform, target: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], wait: int = 0, flux_pulse_amplitude: float | None = None) tuple[PulseSequence, PulseSequence, list[Pulse | Delay]][source]¶
Pulse sequence used in Ramsey (detuned) experiments.
The pulse sequence is the following:
RX90 – wait – RX90 – MZ
- qibocal.protocols.ramsey.acquisition.ramsey_sequence(platform: Platform, targets: list[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], wait: int = 0, flux_pulse_amplitude: float | None = None) tuple[PulseSequence, PulseSequence, list[Pulse | Delay]][source]¶
Pulse sequence used in Ramsey (detuned) experiments. To be used to run in parallel multiple Ramsey sequences on a qubit list.
The pulse sequence is the following:
RX90 – wait – RX90 – MZ
- qibocal.protocols.ramsey.acquisition.ramsey_and_acquisition_sequence(platform: Platform, targets: list[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], wait: int = 0, flux_pulse_amplitude: float | None = None) dict[PulseSequence, list[Pulse | Delay]][source]¶
Wrapper to generate the Ramsey sequence and the acquisition sequence together, where no other pulse has to be added.
- qibocal.protocols.ramsey.acquisition.execute_experiment(sequence: PulseSequence, delays: list[Annotated[Align | Pulse | Delay | VirtualZ | Acquisition | Readout, FieldInfo(annotation=NoneType, required=True, discriminator='kind')]], platform: Platform, targets: list[Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]], params: RamseyParameters, return_probs: bool) dict[Annotated[UUID, UuidVersion(uuid_version=4)], Results][source]¶
Execute Ramsey experiment on the platform.
qibocal.protocols.ramsey.classification module¶
- qibocal.protocols.ramsey.classification.ramsey = Protocol(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function ramsey_update>, two_qubit_gates=False)¶
Ramsey Protocol object.
The protocol consists in applying the following pulse sequence: RX90 - wait - RX90 - MZ for different waiting times wait. The range of waiting times is defined through the attributes delay_between_pulses_* available in RamseyParameters. The final range will be constructed using np.arange. It is possible to detune the drive frequency using the parameter detuning in RamseyParameters which will increment the drive frequency accordingly. Currently when detuning==0 it will be performed a sweep over the waiting values if detuning is not zero, all sequences with different waiting value will be executed sequentially. The following protocol will display on the y-axis the probability of finding the ground state, therefore it is advise to execute it only after having performed the single shot classification.
qibocal.protocols.ramsey.processing module¶
RAMSEY protocol processing utilities.
Contains fitting routines, result transformations, and figure generation helpers for Ramsey experiments.
- qibocal.protocols.ramsey.processing.QUANTILE_CONSTANT_RAMSEY = 1.5¶
See
rabi.utils.QUANTILE_CONSTANT_RABIfor details.In general in Ramsey it’s intended to observe the decay of the signal due to decoherence, hence we need to correct and decrease a little the value of
rabi.utils.DAMPED_CONSTANT; Indeed, for damped oscillations, the factor is not easily determined, since the value associated to a certain quantile depends on the observation window extent, and the ratio between the decay rate and the oscillation.Assuming a mild decay, and we can approximate this factor with the same one for the pure oscillation. This can be assumed to be slightly decreased because of the dampening, but there is no general control about how much. By reducing the amplitude by this rough 30%, the estimation will lend closer to the actual amplitude. We rely anyhow on the fit to determine the precise value.
- qibocal.protocols.ramsey.processing.ramsey_update(results: RamseyResults, platform: CalibrationPlatform, target: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])]) None[source]¶
Update the platform calibration with the results of the Ramsey experiment.
- qibocal.protocols.ramsey.processing.ramsey_fit(x, offset, amplitude, delta, phase, decay) ndarray[tuple[int, ...], dtype[_ScalarType_co]] | float[source]¶
Dumped sinusoidal fit.
- qibocal.protocols.ramsey.processing.fitting(x: ndarray[tuple[int, ...], dtype[_ScalarType_co]], y: ndarray[tuple[int, ...], dtype[_ScalarType_co]], y_err: ndarray[tuple[int, ...], dtype[_ScalarType_co]] | None = None) tuple[list[float], list[float]][source]¶
Given the inputs list x and outputs one y, this function fits the ramsey_fit function and returns a list with the fit parameters.
- qibocal.protocols.ramsey.processing.process_fit(popt: list[float], perr: list[float], qubit_frequency: float, detuning: float | None) tuple[list[float], list[float], list[float], list[float], list[float]][source]¶
Processing Ramsey fitting results.
- qibocal.protocols.ramsey.processing.fit_plot(target: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], fit: RamseyResults, waits: ndarray[tuple[int, ...], dtype[_ScalarType_co]], fig: Figure) str[source]¶
Generate the fit trace and summary table for Ramsey data.
- qibocal.protocols.ramsey.processing.signal_plot(waits: ndarray[tuple[int, ...], dtype[_ScalarType_co]], signal: ndarray[tuple[int, ...], dtype[_ScalarType_co]], target: Annotated[int | str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(union_mode='left_to_right')])], fit: RamseyResults | None, yaxis_title: str, error_bar: ndarray[tuple[int, ...], dtype[_ScalarType_co]] | None = None) tuple[list[Figure], str][source]¶
Create a signal scatter plot and optional fit report.
qibocal.protocols.ramsey.signal module¶
- qibocal.protocols.ramsey.signal.ramsey_signal = Protocol(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function ramsey_update>, two_qubit_gates=False)¶
Ramsey Protocol object.
The protocol consists in applying the following pulse sequence: RX90 - wait - RX90 - MZ for different waiting times wait. The range of waiting times is defined through the attributes delay_between_pulses_* available in RamseyParameters. The final range will be constructed using np.arange. It is possible to detune the drive frequency using the parameter detuning in RamseyParameters which will increment the drive frequency accordingly. Currently when detuning==0 it will be performed a sweep over the waiting values if detuning is not zero, all sequences with different waiting value will be executed sequentially. The following protocol will display on the y-axis the signal amplitude.