exa.core.util.phase_helper.get_phase_more_points

exa.core.util.phase_helper.get_phase_more_points#

get_phase_more_points(phases, data)#

Calculate the qubit phase, assuming more than two points in the phase sweep were used. Find optimal parameters (A, B, delta) for the least-squares approximation of the model.

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

Note that if the number of phases is exactly 3, the calculated fit is equal to the data.

Parameters:
  • phases (ndarray) – an array of size >=3, 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 fit.

Return type:

tuple[dict, ndarray]