# Robust Phase Estimation¶

Is a kind of iterative phase estimation formalized by Kimmel, Low, Yoder Phys. Rev. A 92, 062315 (2015). It is ideal for measuring gate calibration errors.

## API Reference¶

 do_rpe(qc, rotation, changes_of_basis, …) A wrapper around experiment generation, data acquisition, and estimation that runs robust phase estimation. bloch_rotation_to_eigenvectors(theta, phi) Provides convenient conversion from a 1q rotation about some Bloch vector to the two eigenvectors of rotation that lay along the rotation axis. get_change_of_basis_from_eigvecs(eigenvectors) Generates a unitary matrix that sends each computational basis state to the corresponding eigenvector. change_of_basis_matrix_to_quil(qc, qubits, …) Helper to return a native quil program for the given qc to implement the change_of_basis matrix. generate_rpe_experiments(rotation, …) Generate a dataframe containing all the experiments needed to perform robust phase estimation to estimate the angle of rotation of the given rotation program. get_additive_error_factor(M_j, …) Calculate the factor in Equation V.17 of [RPE]. num_trials(depth, max_depth, …) Calculate the optimal number of shots per program with a given depth. acquire_rpe_data(qc, experiments, …) Run each experiment in the sequence of experiments.

Analysis

 _p_max(M_j) Calculate an upper bound on the probability of error in the estimate on the jth iteration. _xci(h) Calculate the maximum error in the estimate after h iterations given that no errors occurred in all previous iterations. get_variance_upper_bound(num_depths, …) Equation V.9 in [RPE] estimate_phase_from_moments(xs, ys, x_stds, …) Estimate the phase in an iterative fashion as described in section V. robust_phase_estimate(results, qubits) Provides the estimate of the phase for an RPE experiment with results. plot_rpe_iterations(xs, ys, x_stds, y_stds, …) Creates a polar plot of the estimated location of the state in the plane perpendicular to the axis of rotation for each iteration of RPE.