fit_cz_phase_ramsey_results

forest.benchmarking.qubit_spectroscopy.fit_cz_phase_ramsey_results(angles: Sequence[float], y_expectations: Sequence[float], y_std_errs: Sequence[float] = None, param_guesses: tuple = (0.5, 0, 0.5, 1.0)) → lmfit.model.ModelResult

Wrapper for fitting the results of a ObservablesExperiment; simply extracts key parameters and passes on to the standard fit.

Note the following interpretation of the model fit:

x
the independent variable is the control angle that we specify when writing a gate instruction. If our gates are incorrectly calibrated then a given control angle will result in a different angle than intended by the multiplicative ‘frequency’ of the model
amplitude
this will have magnitude (p1_given_1 - p1_given_0) / 2 where p1_given_1 is the probability of measuring 1 when the qubit is in the |1> state. p1_given_0 is the probability of measuring 1 when the qubit is in the |0> state.
offset
this is the offset phase, in radians, with respect to the true rotation frequency. e.g. say that our RZ gate is perfectly calibrated and the CZ gate imparts an effective RZ(pi/5) rotation to the measure qubit; in this case offset is pi/5, and frequency is one, so the offset phase could be corrected by applying the gate RZ(-pi/5, qubit) after CZ. If our RZ gate was instead found to be mis-calibrated, a correction using our mis-calibrated RZ gate would require a control angle of RZ(-pi/5 / frequency, qubit)
baseline
this is the amplitude + p1_given_0
frequency
the ratio of the actual angle rotated over the intended control angle e.g. If our gates are incorrectly calibrated to apply an over-rotation then frequency will be greater than 1; the intended control angle will be smaller than the true angle rotated.
Parameters:
  • angles – the angles at which the z_expectations were measured.
  • y_expectations – expectation of Y measured at each time for a qubit
  • y_std_errs – std_err of the Y expectation, optionally used to weight the fit.
  • param_guesses – guesses for the (amplitude, offset, baseline, frequency) parameters
Returns:

a ModelResult fit with estimates of the Model parameters, including the offset which is an estimate of the phase imparted on the measure qubit by the CZ gate.