- class PhaseEstimationResult(num_evaluation_qubits, circuit_result, phases)#
Store and manipulate results from running PhaseEstimation.
This class is instantiated by the
PhaseEstimationclass, not via user code. The
PhaseEstimationclass generates a list of phases and corresponding weights. Upon completion it returns the results as an instance of this class. The main method for accessing the results is filter_phases.
The canonical phase satisfying the
PhaseEstimatorinterface, returned by the attribute phase, is the most likely phase.
Return the result object returned by running the QPE circuit (on hardware or simulator).
This is useful for inspecting and troubleshooting the QPE algorithm.
Return the most likely phase as a number in \([0.0, 1.0)\).
1.0 corresponds to a phase of \(2\pi\). This selects the phase corresponding to the bit string with the highest probability. This is the most likely phase.
Return all phases and their frequencies computed by QPE.
This is an array or dict whose values correspond to weights on bit strings.
Any property from the argument that exists in the receiver is updated. :param result: Argument result with properties to be set.
TypeError – Argument is None
- filter_phases(cutoff=0.0, as_float=True)#
Return a filtered dict of phases (keys) and frequencies (values).
Only phases with frequencies (counts) larger than cutoff are included. It is assumed that the run method has been called so that the phases have been computed. When using a noiseless, shot-based simulator to read a single phase that can be represented exactly by num_evaluation_qubits, all the weight will be concentrated on a single phase. In all other cases, many, or all, bit strings will have non-zero weight. This method is useful for filtering out these uninteresting bit strings.
A filtered dict of phases (keys) and frequencies (values).
- Return type: