qibocal.protocols.flux_dependence package#

Submodules#

qibocal.protocols.flux_dependence.qubit_crosstalk module#

class qibocal.protocols.flux_dependence.qubit_crosstalk.QubitCrosstalkParameters(freq_width: int, freq_step: int, bias_width: ~typing.Optional[float] = None, bias_step: ~typing.Optional[float] = None, drive_amplitude: ~typing.Optional[float] = None, drive_duration: int = 2000, bias_point: ~typing.Optional[dict[typing.Union[int, str], float]] = <factory>, flux_qubits: ~typing.Optional[list[typing.Union[int, str]]] = None)[source]#

Bases: QubitFluxParameters

Crosstalk runcard inputs.

bias_point: Optional[dict[Union[int, str], float]]#

bias_point_qubit_id}.

Type:

Dictionary with {qubit_id

flux_qubits: Optional[list[Union[int, str]]] = None#

IDs of the qubits that we will sweep the flux on. If None flux will be swept on all qubits that we are running the routine on in a multiplex fashion. If given flux will be swept on the given qubits in a sequential fashion (n qubits will result to n different executions). Multiple qubits may be measured in each execution as specified by the qubits option in the runcard.

bias_step: Optional[float] = None#

Bias step for sweep [a.u.].

bias_width: Optional[float] = None#

Width for bias sweep [V].

drive_amplitude: Optional[float] = None#

Drive amplitude (optional). If defined, same amplitude will be used in all qubits. Otherwise the default amplitude defined on the platform runcard will be used

drive_duration: int = 2000#

Duration of the drive pulse.

hardware_average: bool = False#

By default hardware average will be performed.

freq_width: int#

Width for frequency sweep relative to the readout frequency [Hz].

freq_step: int#

Frequency step for sweep [Hz].

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.flux_dependence.qubit_crosstalk.QubitCrosstalkData(resonator_type: str, charging_energy: dict[typing.Union[int, str], float] = <factory>, qubit_frequency: dict[typing.Union[int, str], float] = <factory>, data: dict[tuple[typing.Union[int, str], typing.Union[int, str]], numpy.ndarray[typing.Any, numpy.dtype[dtype([('freq', '<f8'), ('bias', '<f8'), ('signal', '<f8'), ('phase', '<f8')])]]] = <factory>, matrix_element: dict[typing.Union[int, str], float] = <factory>, bias_point: dict[typing.Union[int, str], float] = <factory>, offset: dict[typing.Union[int, str], float] = <factory>)[source]#

Bases: QubitFluxData

Crosstalk acquisition outputs when flux_qubits are given.

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

Diagonal flux element.

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

Bias point for each qubit.

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

Phase shift for each qubit.

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

Qubit frequency for each qubit.

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

Raw data acquired for (qubit, qubit_flux) pairs saved in nested dictionaries.

register_qubit(qubit, flux_qubit, freq, bias, 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.

resonator_type: str#

Resonator type.

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

Qubit charging energy.

class qibocal.protocols.flux_dependence.qubit_crosstalk.QubitCrosstalkResults(sweetspot: dict[typing.Union[int, str], float] = <factory>, frequency: dict[typing.Union[int, str], float] = <factory>, fitted_parameters: dict[tuple[typing.Union[int, str], typing.Union[int, str]], dict] = <factory>, matrix_element: dict[typing.Union[int, str], float] = <factory>, qubit_frequency_bias_point: dict[typing.Union[int, str], float] = <factory>, crosstalk_matrix: dict[typing.Union[int, str], dict[typing.Union[int, str], float]] = <factory>)[source]#

Bases: QubitFluxResults

Qubit Crosstalk outputs.

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

Expected qubit frequency at bias point.

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

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

Sweetspot for each qubit.

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

Drive frequency for each qubit.

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

V_ii coefficient.

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

Crosstalk matrix element.

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

Fitted parameters for each couple target-flux qubit.

qibocal.protocols.flux_dependence.qubit_crosstalk._acquisition(params: QubitCrosstalkParameters, platform: CalibrationPlatform, targets: list[Union[int, str]]) QubitCrosstalkData[source]#

Data acquisition for Crosstalk Experiment.

qibocal.protocols.flux_dependence.qubit_crosstalk._fit(data: QubitCrosstalkData) QubitCrosstalkResults[source]#
qibocal.protocols.flux_dependence.qubit_crosstalk._plot(data: QubitCrosstalkData, fit: QubitCrosstalkResults, target: Union[int, str])[source]#

Plotting function for Crosstalk Experiment.

qibocal.protocols.flux_dependence.qubit_crosstalk._update(results: QubitCrosstalkResults, platform: CalibrationPlatform, qubit: Union[int, str])[source]#

Update crosstalk matrix.

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

Qubit crosstalk Routine object

qibocal.protocols.flux_dependence.qubit_flux_dependence module#

class qibocal.protocols.flux_dependence.qubit_flux_dependence.QubitFluxParameters(freq_width: int, freq_step: int, bias_width: Optional[float] = None, bias_step: Optional[float] = None, drive_amplitude: Optional[float] = None, drive_duration: int = 2000)[source]#

Bases: ResonatorFluxParameters

QubitFlux runcard inputs.

drive_amplitude: Optional[float] = None#

Drive amplitude (optional). If defined, same amplitude will be used in all qubits. Otherwise the default amplitude defined on the platform runcard will be used

drive_duration: int = 2000#

Duration of the drive pulse.

bias_step: Optional[float] = None#

Bias step for sweep [a.u.].

bias_width: Optional[float] = None#

Width for bias sweep [V].

hardware_average: bool = False#

By default hardware average will be performed.

freq_width: int#

Width for frequency sweep relative to the readout frequency [Hz].

freq_step: int#

Frequency step for sweep [Hz].

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.flux_dependence.qubit_flux_dependence.QubitFluxResults(sweetspot: dict[typing.Union[int, str], float] = <factory>, frequency: dict[typing.Union[int, str], float] = <factory>, fitted_parameters: dict[typing.Union[int, str], dict[str, float]] = <factory>, matrix_element: dict[typing.Union[int, str], float] = <factory>)[source]#

Bases: Results

QubitFlux outputs.

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

Sweetspot for each qubit.

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

Drive frequency for each qubit.

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

Raw fitting output.

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

V_ii coefficient.

_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.flux_dependence.qubit_flux_dependence.QubitFluxType = dtype([('freq', '<f8'), ('bias', '<f8'), ('signal', '<f8'), ('phase', '<f8')])#

Custom dtype for resonator flux dependence.

class qibocal.protocols.flux_dependence.qubit_flux_dependence.QubitFluxData(resonator_type: str, charging_energy: dict[typing.Union[int, str], float] = <factory>, qubit_frequency: dict[typing.Union[int, str], float] = <factory>, data: dict[typing.Union[int, str], numpy.ndarray[typing.Any, numpy.dtype[dtype([('freq', '<f8'), ('bias', '<f8'), ('signal', '<f8'), ('phase', '<f8')])]]] = <factory>)[source]#

Bases: Data

QubitFlux acquisition outputs.

resonator_type: str#

Resonator type.

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

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

Qubit charging energy.

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

Qubit charging energy.

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

Raw data acquired.

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

Store output for single qubit.

qibocal.protocols.flux_dependence.qubit_flux_dependence._acquisition(params: QubitFluxParameters, platform: CalibrationPlatform, targets: list[Union[int, str]]) QubitFluxData[source]#

Data acquisition for QubitFlux Experiment.

qibocal.protocols.flux_dependence.qubit_flux_dependence._fit(data: QubitFluxData) QubitFluxResults[source]#

Post-processing for QubitFlux Experiment. See arXiv:0703002. Fit frequency as a function of current for the flux qubit spectroscopy data. All possible sweetspots \(x\) are evaluated by the function \(x p_1 + p_2 = k\), for integers \(k\), where \(p_1\) and \(p_2\) are respectively the normalization and the offset, as defined in qibocal.protocols.flux_dependence.utils.transmon_frequency. The code returns the sweetspot that is closest to the bias in the middle of the swept interval.

qibocal.protocols.flux_dependence.qubit_flux_dependence._plot(data: QubitFluxData, fit: QubitFluxResults, target: Union[int, str])[source]#

Plotting function for QubitFlux Experiment.

qibocal.protocols.flux_dependence.qubit_flux_dependence._update(results: QubitFluxResults, platform: CalibrationPlatform, qubit: Union[int, str])[source]#
qibocal.protocols.flux_dependence.qubit_flux_dependence.qubit_flux = Routine(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function _update>, two_qubit_gates=False)#

QubitFlux Routine object.

qibocal.protocols.flux_dependence.resonator_flux_dependence module#

class qibocal.protocols.flux_dependence.resonator_flux_dependence.ResonatorFluxParameters(freq_width: int, freq_step: int, bias_width: Optional[float] = None, bias_step: Optional[float] = None)[source]#

Bases: Parameters

ResonatorFlux runcard inputs.

freq_width: int#

Width for frequency sweep relative to the readout frequency [Hz].

freq_step: int#

Frequency step for sweep [Hz].

bias_width: Optional[float] = None#

Width for bias sweep [V].

bias_step: Optional[float] = None#

Bias step for sweep [a.u.].

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.flux_dependence.resonator_flux_dependence.ResonatorFluxResults(frequency: dict[typing.Union[int, str], float] = <factory>, coupling: dict[typing.Union[int, str], float] = <factory>, asymmetry: dict[typing.Union[int, str], float] = <factory>, sweetspot: dict[typing.Union[int, str], float] = <factory>, matrix_element: dict[typing.Union[int, str], float] = <factory>, fitted_parameters: dict[typing.Union[int, str], float] = <factory>)[source]#

Bases: Results

ResonatoFlux outputs.

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

Readout frequency.

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

Qubit-resonator coupling.

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

Asymmetry between junctions.

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

Sweetspot for each qubit.

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

Sweetspot for each qubit.

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

qibocal.protocols.flux_dependence.resonator_flux_dependence.ResFluxType = dtype([('freq', '<f8'), ('bias', '<f8'), ('signal', '<f8'), ('phase', '<f8')])#

Custom dtype for resonator flux dependence.

class qibocal.protocols.flux_dependence.resonator_flux_dependence.ResonatorFluxData(resonator_type: str, qubit_frequency: dict[typing.Union[int, str], float] = <factory>, bare_resonator_frequency: dict[typing.Union[int, str], int] = <factory>, charging_energy: dict[typing.Union[int, str], float] = <factory>, data: dict[typing.Union[int, str], numpy.ndarray[typing.Any, numpy.dtype[dtype([('freq', '<f8'), ('bias', '<f8'), ('signal', '<f8'), ('phase', '<f8')])]]] = <factory>)[source]#

Bases: Data

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

save(path: Path)#

Store data to file.

resonator_type: str#

Resonator type.

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

Qubit frequencies.

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

Qubit bare resonator frequency power provided by the user.

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

Qubit charging energy in Hz.

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

Raw data acquired.

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

Store output for single qubit.

qibocal.protocols.flux_dependence.resonator_flux_dependence._acquisition(params: ResonatorFluxParameters, platform: CalibrationPlatform, targets: list[Union[int, str]]) ResonatorFluxData[source]#

Data acquisition for ResonatorFlux experiment.

qibocal.protocols.flux_dependence.resonator_flux_dependence._fit(data: ResonatorFluxData) ResonatorFluxResults[source]#

PostProcessing for resonator_flux protocol.

After applying a mask on the 2D data, the signal is fitted using the expected frequency vs flux behavior. The fitting procedure requires the knowledge of the bare resonator frequency, the charging energy Ec and the maximum qubit frequency which is assumed to be the frequency at which the qubit is placed. The protocol aims at extracting the sweetspot, the flux coefficient, the coupling, the asymmetry and the dressed resonator frequency.

qibocal.protocols.flux_dependence.resonator_flux_dependence._plot(data: ResonatorFluxData, fit: ResonatorFluxResults, target: Union[int, str])[source]#

Plotting function for ResonatorFlux Experiment.

qibocal.protocols.flux_dependence.resonator_flux_dependence._update(results: ResonatorFluxResults, platform: CalibrationPlatform, qubit: Union[int, str])[source]#
qibocal.protocols.flux_dependence.resonator_flux_dependence.resonator_flux = Routine(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function _update>, two_qubit_gates=False)#

ResonatorFlux Routine object.

qibocal.protocols.flux_dependence.utils module#

qibocal.protocols.flux_dependence.utils.is_crosstalk(data)[source]#

Check if keys are tuple which corresponds to crosstalk data structure.

qibocal.protocols.flux_dependence.utils.create_data_array(freq, bias, signal, phase, dtype)[source]#

Create custom dtype array for acquired data.

qibocal.protocols.flux_dependence.utils.flux_dependence_plot(data, fit, qubit, fit_function=None)[source]#
qibocal.protocols.flux_dependence.utils.flux_crosstalk_plot(data, qubit, fit, fit_function)[source]#
qibocal.protocols.flux_dependence.utils.G_f_d(xi, xj, offset, d, crosstalk_element, normalization)[source]#

Auxiliary function to calculate qubit frequency as a function of bias.

It also determines the flux dependence of \(E_J\),:math:E_J(phi)=E_J(0)G_f_d. For more details see: https://arxiv.org/pdf/cond-mat/0703002.pdf

Parameters:
  • xi (float) – bias of target qubit

  • xj (float) – bias of neighbor qubit

  • offset (float) – phase_offset [V].

  • d (float) – asymmetry between the two junctions of the transmon. Typically denoted as \(d\). \(d = (E_J^1 - E_J^2) / (E_J^1 + E_J^2)\).

  • crosstalk_element (float) – off-diagonal crosstalk matrix element

  • normalization (float) – diagonal crosstalk matrix element

Returns:

(float)

qibocal.protocols.flux_dependence.utils.transmon_frequency(xi, xj, w_max, d, normalization, offset, crosstalk_element, charging_energy)[source]#

Approximation to transmon frequency.

The formula holds in the transmon regime Ej / Ec >> 1.

See https://arxiv.org/pdf/cond-mat/0703002.pdf for the complete formula.

Parameters:
  • xi (float) – bias of target qubit

  • xj (float) – bias of neighbor qubit

  • w_max (float) – maximum frequency :math:`w_{max} = sqrt{8 E_j E_c}

  • d (float) – asymmetry between the two junctions of the transmon. Typically denoted as \(d\). \(d = (E_J^1 - E_J^2) / (E_J^1 + E_J^2)\).

  • normalization (float) – diagonal crosstalk matrix element

  • offset (float) – phase_offset [V].

  • crosstalk_element (float) – off-diagonal crosstalk matrix element

  • charging_energy – Ec / h (GHz)

qibocal.protocols.flux_dependence.utils.transmon_readout_frequency(xi, xj, w_max, d, normalization, crosstalk_element, offset, resonator_freq, g, charging_energy)[source]#

Approximation to flux dependent resonator frequency.

The formula holds in the transmon regime Ej / Ec >> 1.

See https://arxiv.org/pdf/cond-mat/0703002.pdf for the complete formula.

Parameters:
  • xi (float) – bias of target qubit

  • xj (float) – bias of neighbor qubit

  • w_max (float) – maximum frequency :math:`w_{max} = sqrt{8 E_j E_c}

  • d (float) – asymmetry between the two junctions of the transmon. Typically denoted as \(d\). \(d = (E_J^1 - E_J^2) / (E_J^1 + E_J^2)\).

  • normalization (float) – diagonal crosstalk matrix element

  • offset (float) – phase_offset [V].

  • crosstalk_element (float) – off-diagonal crosstalk matrix element

  • resonator_freq (float) – bare resonator frequency [GHz]

  • g (float) – readout coupling.

  • charging_energy – Ec / h (GHz)

qibocal.protocols.flux_dependence.utils.qubit_flux_dependence_fit_bounds(qubit_frequency: float)[source]#

Returns bounds for qubit flux fit.