exa.core.util.phase_helper.get_phase_2_points

exa.core.util.phase_helper.get_phase_2_points#

get_phase_2_points(phases, data)#

Calculate the qubit phase, assuming two points in the phase sweep were used, and the excited state probability is well-calibrated, so the data offset is 0.5. Find optimal parameters (A, delta) for the least-squares approximation of the model.

data[k] = A*cos(phases[k] + delta) + 0.5

Parameters:
  • phases (ndarray) – an array of size 2, phases used

  • data (ndarray) – experimental data, assumed to be excited state probability

Returns:

a dict containing the phase and amplitude of the oscillation, and the data back. This would be a fit, but

Return type:

tuple[dict, ndarray]

there are no free parameters in this model, so the fit would be equal to the data anyway