qibocal.protocols.two_qubit_interaction package#
Subpackages#
- qibocal.protocols.two_qubit_interaction.chevron package
- Submodules
- qibocal.protocols.two_qubit_interaction.chevron.chevron module
ChevronParameters
ChevronParameters.amplitude_min_factor
ChevronParameters.amplitude_max_factor
ChevronParameters.amplitude_step_factor
ChevronParameters.duration_min
ChevronParameters.duration_max
ChevronParameters.duration_step
ChevronParameters.dt
ChevronParameters.parking
ChevronParameters.native
ChevronParameters.amplitude_range
ChevronParameters.duration_range
ChevronParameters.hardware_average
ChevronParameters.nshots
ChevronParameters.relaxation_time
ChevronResults
ChevronType
ChevronData
ChevronData._to_json()
ChevronData._to_npz()
ChevronData.load_data()
ChevronData.load_params()
ChevronData.pairs
ChevronData.params
ChevronData.qubits
ChevronData.save()
ChevronData.native_amplitude
ChevronData.native
ChevronData.sweetspot
ChevronData.data
ChevronData.register_qubit()
ChevronData.amplitudes()
ChevronData.durations()
ChevronData.low_frequency()
ChevronData.high_frequency()
_aquisition()
_fit()
_plot()
_update()
chevron
- qibocal.protocols.two_qubit_interaction.chevron.chevron_signal module
ChevronSignalParameters
ChevronSignalParameters.amplitude_range
ChevronSignalParameters.dt
ChevronSignalParameters.duration_range
ChevronSignalParameters.hardware_average
ChevronSignalParameters.native
ChevronSignalParameters.parking
ChevronSignalParameters.amplitude_min_factor
ChevronSignalParameters.amplitude_max_factor
ChevronSignalParameters.amplitude_step_factor
ChevronSignalParameters.duration_min
ChevronSignalParameters.duration_max
ChevronSignalParameters.duration_step
ChevronSignalParameters.nshots
ChevronSignalParameters.relaxation_time
ChevronSignalResults
ChevronSignalType
ChevronSignalData
ChevronSignalData.data
ChevronSignalData.register_qubit()
ChevronSignalData.low_frequency()
ChevronSignalData.high_frequency()
ChevronSignalData._to_json()
ChevronSignalData._to_npz()
ChevronSignalData.amplitudes()
ChevronSignalData.durations()
ChevronSignalData.load_data()
ChevronSignalData.load_params()
ChevronSignalData.native
ChevronSignalData.pairs
ChevronSignalData.params
ChevronSignalData.qubits
ChevronSignalData.save()
ChevronSignalData.native_amplitude
ChevronSignalData.sweetspot
_aquisition()
chevron_signal
- qibocal.protocols.two_qubit_interaction.chevron.utils module
- qibocal.protocols.two_qubit_interaction.chsh package
- Submodules
- qibocal.protocols.two_qubit_interaction.chsh.circuits module
- qibocal.protocols.two_qubit_interaction.chsh.protocol module
CLASSICAL_BOUND
QUANTUM_BOUND
MITIGATION_MATRIX_FILE
CHSHParameters
CHSHData
CHSHData.bell_states
CHSHData.thetas
CHSHData.data
CHSHData.mitigation_matrix
CHSHData.save()
CHSHData.register_basis()
CHSHData.merge_frequencies()
CHSHData._to_json()
CHSHData._to_npz()
CHSHData.load_data()
CHSHData.load_params()
CHSHData.pairs
CHSHData.params
CHSHData.qubits
CHSHData.register_qubit()
CHSHResults
_acquisition_pulses()
_acquisition_circuits()
_plot()
_fit()
chsh_circuits
chsh_pulses
- qibocal.protocols.two_qubit_interaction.chsh.pulses module
- qibocal.protocols.two_qubit_interaction.chsh.utils module
Submodules#
qibocal.protocols.two_qubit_interaction.optimize module#
virtual correction experiment for two qubit gates, tune landscape.
- class qibocal.protocols.two_qubit_interaction.optimize.OptimizeTwoQubitGateParameters(theta_start: float, theta_end: float, theta_step: float, flux_pulse_amplitude_min: float, flux_pulse_amplitude_max: float, flux_pulse_amplitude_step: float, duration_min: int, duration_max: int, duration_step: int, dt: Optional[float] = 20, parking: bool = True, native: str = 'CZ')[source]#
Bases:
Parameters
OptimizeTwoQubitGate runcard inputs.
- class qibocal.protocols.two_qubit_interaction.optimize.OptimizeTwoQubitGateResults(fitted_parameters: dict[tuple[str, Union[str, int], float], list], native: str, angles: dict[tuple[Tuple[Union[str, int], Union[str, int]], float], float], virtual_phases: dict[tuple[Tuple[Union[str, int], Union[str, int]], float], dict[Union[str, int], float]], leakages: dict[tuple[Tuple[Union[str, int], Union[str, int]], float], dict[Union[str, int], float]], best_amp: dict[Tuple[Union[str, int], Union[str, int]]], best_dur: dict[Tuple[Union[str, int], Union[str, int]]], best_virtual_phase: dict[Tuple[Union[str, int], Union[str, int]]])[source]#
Bases:
Results
CzVirtualZ outputs when fitting will be done.
- virtual_phases: dict[tuple[Tuple[Union[str, int], Union[str, int]], float], dict[Union[str, int], float]]#
Virtual Z phase correction.
- leakages: dict[tuple[Tuple[Union[str, int], Union[str, int]], float], dict[Union[str, int], float]]#
Leakage on control qubit for pair.
- best_amp: dict[Tuple[Union[str, int], Union[str, int]]]#
Flux pulse amplitude of best configuration.
- class qibocal.protocols.two_qubit_interaction.optimize.OptimizeTwoQubitGateData(data: dict[tuple, numpy.ndarray[typing.Any, numpy.dtype[dtype([('amp', '<f8'), ('theta', '<f8'), ('duration', '<f8'), ('prob_target', '<f8'), ('prob_control', '<f8')])]]] = <factory>, thetas: list = <factory>, native: str = 'CZ', vphases: dict[typing.Tuple[typing.Union[str, int], typing.Union[str, int]], dict[typing.Union[str, int], float]] = <factory>, amplitudes: dict[tuple[typing.Union[str, int], typing.Union[str, int]], float] = <factory>, durations: dict[tuple[typing.Union[str, int], typing.Union[str, int]], float] = <factory>)[source]#
Bases:
Data
OptimizeTwoQubitGate data.
- _to_npz(path: Path, filename: str)#
Helper function to use np.savez while converting keys into strings.
- property pairs#
Access qubit pairs ordered alphanumerically from data structure.
- property qubits#
Access qubits from data structure.
- data: dict[tuple, numpy.ndarray[typing.Any, numpy.dtype[dtype([('amp', '<f8'), ('theta', '<f8'), ('duration', '<f8'), ('prob_target', '<f8'), ('prob_control', '<f8')])]]]#
Raw data.
- qibocal.protocols.two_qubit_interaction.optimize._acquisition(params: OptimizeTwoQubitGateParameters, platform: Platform, targets: list[Tuple[Union[str, int], Union[str, int]]]) OptimizeTwoQubitGateData [source]#
Repetition of correct virtual phase experiment for several amplitude and duration values.
- qibocal.protocols.two_qubit_interaction.optimize._fit(data: OptimizeTwoQubitGateData) OptimizeTwoQubitGateResults [source]#
Repetition of correct virtual phase fit for all configurations.
- qibocal.protocols.two_qubit_interaction.optimize._plot(data: OptimizeTwoQubitGateData, fit: OptimizeTwoQubitGateResults, target: Tuple[Union[str, int], Union[str, int]])[source]#
Plot routine for OptimizeTwoQubitGate.
- qibocal.protocols.two_qubit_interaction.optimize._update(results: OptimizeTwoQubitGateResults, platform: Platform, target: Tuple[Union[str, int], Union[str, int]])[source]#
- qibocal.protocols.two_qubit_interaction.optimize.optimize_two_qubit_gate = Routine(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function _update>, two_qubit_gates=True)#
Optimize two qubit gate protocol
qibocal.protocols.two_qubit_interaction.utils module#
- qibocal.protocols.two_qubit_interaction.utils.order_pair(pair: Tuple[Union[str, int], Union[str, int]], platform: Platform) tuple[Union[str, int], Union[str, int]] [source]#
Order a pair of qubits by drive frequency.
- qibocal.protocols.two_qubit_interaction.utils.fit_flux_amplitude(matrix, amps, times)[source]#
Estimate amplitude for CZ gate.
Given the pattern of a chevron plot (see for example Fig. 2 here https://arxiv.org/pdf/1907.04818.pdf). This function estimates the CZ amplitude by finding the amplitude which gives the standard deviation, indicating that there are oscillation along the z axis.
- Parameters:
matrix (np.ndarray) – signal matrix
amps (np.ndarray) – amplitudes swept
times (np.ndarray) – duration swept
- Returns:
estimated amplitude index (int): amplitude index delta (float): omega for estimated amplitude
- Return type:
amplitude (float)
qibocal.protocols.two_qubit_interaction.virtual_z_phases module#
CZ virtual correction experiment for two qubit gates, tune landscape.
- class qibocal.protocols.two_qubit_interaction.virtual_z_phases.VirtualZPhasesParameters(theta_start: float, theta_end: float, theta_step: float, native: str = 'CZ', flux_pulse_amplitude: Optional[float] = None, flux_pulse_duration: Optional[float] = None, dt: Optional[float] = 20, parking: bool = True)[source]#
Bases:
Parameters
VirtualZ runcard inputs.
- class qibocal.protocols.two_qubit_interaction.virtual_z_phases.VirtualZPhasesResults(fitted_parameters: dict[tuple[str, Union[str, int]]], native: str, angle: dict[Tuple[Union[str, int], Union[str, int]], float], virtual_phase: dict[Tuple[Union[str, int], Union[str, int]], dict[Union[str, int], float]], leakage: dict[Tuple[Union[str, int], Union[str, int]], dict[Union[str, int], float]], flux_pulse_amplitude: dict[Tuple[Union[str, int], Union[str, int]], float], flux_pulse_duration: dict[Tuple[Union[str, int], Union[str, int]], int])[source]#
Bases:
Results
VirtualZ outputs when fitting will be done.
- virtual_phase: dict[Tuple[Union[str, int], Union[str, int]], dict[Union[str, int], float]]#
Virtual Z phase correction.
- leakage: dict[Tuple[Union[str, int], Union[str, int]], dict[Union[str, int], float]]#
Leakage on control qubit for pair.
- flux_pulse_amplitude: dict[Tuple[Union[str, int], Union[str, int]], float]#
Amplitude of flux pulse implementing CZ.
- flux_pulse_duration: dict[Tuple[Union[str, int], Union[str, int]], int]#
Duration of flux pulse implementing CZ.
- class qibocal.protocols.two_qubit_interaction.virtual_z_phases.VirtualZPhasesData(data: dict[tuple, numpy.ndarray[typing.Any, numpy.dtype[dtype([('target', '<f8'), ('control', '<f8')])]]] = <factory>, native: str = 'CZ', thetas: list = <factory>, vphases: dict[typing.Tuple[typing.Union[str, int], typing.Union[str, int]], dict[typing.Union[str, int], float]] = <factory>, amplitudes: dict[tuple[typing.Union[str, int], typing.Union[str, int]], float] = <factory>, durations: dict[tuple[typing.Union[str, int], typing.Union[str, int]], float] = <factory>)[source]#
Bases:
Data
VirtualZPhases data.
- _to_npz(path: Path, filename: str)#
Helper function to use np.savez while converting keys into strings.
- property pairs#
Access qubit pairs ordered alphanumerically from data structure.
- property qubits#
Access qubits from data structure.
- register_qubit(dtype, data_keys, data_dict)#
Store output for single qubit.
- data: dict[tuple, numpy.ndarray[typing.Any, numpy.dtype[dtype([('target', '<f8'), ('control', '<f8')])]]]#
- qibocal.protocols.two_qubit_interaction.virtual_z_phases.create_sequence(platform: Platform, setup: str, target_qubit: Union[str, int], control_qubit: Union[str, int], ordered_pair: list[Union[str, int], Union[str, int]], native: str, parking: bool, dt: float, amplitude: Optional[float] = None, duration: Optional[float] = None) tuple[qibolab.pulses.PulseSequence, dict[Union[str, int], qibolab.pulses.Pulse], dict[Union[str, int], qibolab.pulses.Pulse], dict[Union[str, int], qibolab.pulses.Pulse], dict[Union[str, int], qibolab.pulses.Pulse]] [source]#
Create the experiment PulseSequence.
- qibocal.protocols.two_qubit_interaction.virtual_z_phases._acquisition(params: VirtualZPhasesParameters, platform: Platform, targets: list[Tuple[Union[str, int], Union[str, int]]]) VirtualZPhasesData [source]#
Acquisition for VirtualZPhases.
Check the two-qubit landscape created by a flux pulse of a given duration and amplitude. The system is initialized with a Y90 pulse on the low frequency qubit and either an Id or an X gate on the high frequency qubit. Then the flux pulse is applied to the high frequency qubit in order to perform a two-qubit interaction. The Id/X gate is undone in the high frequency qubit and a theta90 pulse is applied to the low frequency qubit before measurement. That is, a pi-half pulse around the relative phase parametereized by the angle theta. Measurements on the low frequency qubit yield the 2Q-phase of the gate and the remnant single qubit Z phase aquired during the execution to be corrected. Population of the high frequency qubit yield the leakage to the non-computational states during the execution of the flux pulse.
- qibocal.protocols.two_qubit_interaction.virtual_z_phases.fit_function(x, amplitude, offset, phase)[source]#
Sinusoidal fit function.
- qibocal.protocols.two_qubit_interaction.virtual_z_phases._fit(data: VirtualZPhasesData) VirtualZPhasesResults [source]#
Fitting routine for the experiment.
The used model is
\[y = p_0 sin\Big(x + p_2\Big) + p_1.\]
- qibocal.protocols.two_qubit_interaction.virtual_z_phases._plot(data: VirtualZPhasesData, fit: VirtualZPhasesResults, target: Tuple[Union[str, int], Union[str, int]])[source]#
Plot routine for VirtualZPhases.
- qibocal.protocols.two_qubit_interaction.virtual_z_phases._update(results: VirtualZPhasesResults, platform: Platform, target: Tuple[Union[str, int], Union[str, int]])[source]#
- qibocal.protocols.two_qubit_interaction.virtual_z_phases.correct_virtual_z_phases = Routine(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function _update>, two_qubit_gates=True)#
Virtual phases correction protocol.
qibocal.protocols.two_qubit_interaction.virtual_z_phases_signal module#
CZ virtual correction experiment for two qubit gates, tune landscape.
- class qibocal.protocols.two_qubit_interaction.virtual_z_phases_signal.VirtualZPhasesSignalParameters(theta_start: float, theta_end: float, theta_step: float, native: str = 'CZ', flux_pulse_amplitude: Optional[float] = None, flux_pulse_duration: Optional[float] = None, dt: Optional[float] = 20, parking: bool = True)[source]#
Bases:
VirtualZPhasesParameters
VirtualZ runcard inputs.
- class qibocal.protocols.two_qubit_interaction.virtual_z_phases_signal.VirtualZPhasesSignalResults(fitted_parameters: dict[tuple[str, Union[str, int]]], native: str, angle: dict[Tuple[Union[str, int], Union[str, int]], float], virtual_phase: dict[Tuple[Union[str, int], Union[str, int]], dict[Union[str, int], float]], leakage: dict[Tuple[Union[str, int], Union[str, int]], dict[Union[str, int], float]], flux_pulse_amplitude: dict[Tuple[Union[str, int], Union[str, int]], float], flux_pulse_duration: dict[Tuple[Union[str, int], Union[str, int]], int])[source]#
Bases:
VirtualZPhasesResults
VirtualZ outputs when fitting will be done.
- class qibocal.protocols.two_qubit_interaction.virtual_z_phases_signal.VirtualZPhasesSignalData(data: dict[tuple, numpy.ndarray[typing.Any, numpy.dtype[dtype([('target', '<f8'), ('control', '<f8')])]]] = <factory>, native: str = 'CZ', thetas: list = <factory>, vphases: dict[typing.Tuple[typing.Union[str, int], typing.Union[str, int]], dict[typing.Union[str, int], float]] = <factory>, amplitudes: dict[tuple[typing.Union[str, int], typing.Union[str, int]], float] = <factory>, durations: dict[tuple[typing.Union[str, int], typing.Union[str, int]], float] = <factory>)[source]#
Bases:
VirtualZPhasesData
VirtualZPhases data.
- _to_npz(path: Path, filename: str)#
Helper function to use np.savez while converting keys into strings.
- property pairs#
Access qubit pairs ordered alphanumerically from data structure.
- property qubits#
Access qubits from data structure.
- register_qubit(dtype, data_keys, data_dict)#
Store output for single qubit.
- qibocal.protocols.two_qubit_interaction.virtual_z_phases_signal._acquisition(params: VirtualZPhasesSignalParameters, platform: Platform, targets: list[Tuple[Union[str, int], Union[str, int]]]) VirtualZPhasesSignalData [source]#
Acquisition for VirtualZPhases. See https://arxiv.org/pdf/1904.06560.pdf
Check the two-qubit landscape created by a flux pulse of a given duration and amplitude. The system is initialized with a Y90 pulse on the low frequency qubit and either an Id or an X gate on the high frequency qubit. Then the flux pulse is applied to the high frequency qubit in order to perform a two-qubit interaction. The Id/X gate is undone in the high frequency qubit and a theta90 pulse is applied to the low frequency qubit before measurement. That is, a pi-half pulse around the relative phase parametereized by the angle theta. Measurements on the low frequency qubit yield the 2Q-phase of the gate and the remnant single qubit Z phase aquired during the execution to be corrected. Population of the high frequency qubit yield the leakage to the non-computational states during the execution of the flux pulse.
- qibocal.protocols.two_qubit_interaction.virtual_z_phases_signal._plot(data: VirtualZPhasesSignalData, fit: VirtualZPhasesSignalResults, target: Tuple[Union[str, int], Union[str, int]])[source]#
Plot routine for VirtualZPhases.
- qibocal.protocols.two_qubit_interaction.virtual_z_phases_signal.correct_virtual_z_phases_signal = Routine(acquisition=<function _acquisition>, fit=<function _fit>, report=<function _plot>, update=<function _update>, two_qubit_gates=True)#
Virtual Z correction routine.