robust_phase_estimate

forest.benchmarking.robust_phase_estimation.robust_phase_estimate(results: List[List[forest.benchmarking.observable_estimation.ExperimentResult]], qubits: Sequence[int]) → Union[float, Sequence[float]]

Provides the estimate of the phase for an RPE experiment with results.

In the 1q case this is simply a convenient wrapper around estimate_phase_from_moments() which does all of the analysis.

For multiple qubits this method determines which possible outputs are consistent with the post-selection-state and the possible non-z-basis measurement qubit. For each choice of the latter, all such possible outcomes correspond to measurement of a different relative phase.

Returns:an estimate of the phase of the rotation program passed into generate_rpe_experiments If the rotation program is multi-qubit then there will be:
2**(len(meas_qubits) - len(post_select_state) - 1)

different relative phases estimated and returned.