qiskit.algorithms.PhaseEstimation¶

class
PhaseEstimation
(num_evaluation_qubits, quantum_instance=None)[código fonte]¶ Run the Quantum Phase Estimation (QPE) algorithm.
This runs QPE with a multiqubit register for reading the phases [1] of input states.
The algorithm takes as input a unitary \(U\) and a state \(\psi\rangle\), which may be written
\[\psi\rangle = \sum_j c_j \phi_j\rangle,\]where \(\phi_j\rangle\) are eigenstates of \(U\). We prepare the quantum register in the state \(\psi\rangle\) then apply \(U\) leaving the register in the state
\[U\psi\rangle = \sum_j \exp(i \phi_j) c_j \phi_j\rangle.\]In the ideal case, one then measures the phase \(\phi_j\) with probability \(c_j^2\). In practice, many (or all) of the bit strings may be measured due to noise and the possibility that \(\phi_j\) may not be representable exactly by the output register. In the latter case the probability for each eigenphase will be spread across bitstrings, with amplitudes that decrease with distance from the bitstring most closely approximating the eigenphase.
The main input to the constructor is the number of qubits in the phasereading register. For phase estimation, there are two methods:
 first. estimate, which takes a state preparation circuit to prepare an input state, and
a unitary that will act on the the input state. In this case, an instance of
qiskit.circuit.PhaseEstimation
, a QPE circuit, containing the state preparation and input unitary will be constructed. second. estimate_from_pe_circuit, which takes a quantumphaseestimation circuit in which
the unitary and state preparation are already embedded.
In both estimation methods, the QPE circuit is run on a backend and the frequencies or counts of the phases represented by bitstrings are recorded. The results are returned as an instance of
PhaseEstimationResult
.Reference:
 [1]: Michael A. Nielsen and Isaac L. Chuang. 2011.
Quantum Computation and Quantum Information: 10th Anniversary Edition (10th ed.). Cambridge University Press, New York, NY, USA.
 Parâmetros
num_evaluation_qubits (
int
) – The number of qubits used in estimating the phase. The phase will be estimated as a binary string with this many bits.quantum_instance (
Union
[Backend
,BaseBackend
,QuantumInstance
,None
]) – The quantum instance on which the circuit will be run.

__init__
(num_evaluation_qubits, quantum_instance=None)[código fonte]¶  Parâmetros
num_evaluation_qubits (
int
) – The number of qubits used in estimating the phase. The phase will be estimated as a binary string with this many bits.quantum_instance (
Union
[Backend
,BaseBackend
,QuantumInstance
,None
]) – The quantum instance on which the circuit will be run.
Methods
__init__
(num_evaluation_qubits[, …]) type num_evaluation_qubits
int
construct_circuit
(unitary[, state_preparation])Return the circuit to be executed to estimate phases.
estimate
([unitary, state_preparation, …])Build a phase estimation circuit and run the corresponding algorithm.
estimate_from_pe_circuit
(pe_circuit, …)Run the the phase estimation algorithm on a phase estimation circuit

construct_circuit
(unitary, state_preparation=None)[código fonte]¶ Return the circuit to be executed to estimate phases.
This circuit includes as subcircuits the core phase estimation circuit, with the addition of the statepreparation circuit and possibly measurement instructions.
 Tipo de retorno
QuantumCircuit

estimate
(unitary=None, state_preparation=None, pe_circuit=None, num_unitary_qubits=None)[código fonte]¶ Build a phase estimation circuit and run the corresponding algorithm.
 Parâmetros
unitary (
Optional
[QuantumCircuit
]) – The circuit representing the unitary operator whose eigenvalues (via phase) will be measured.state_preparation (
Optional
[QuantumCircuit
]) – The circuit that prepares the state whose eigenphase will be measured. If this parameter is omitted, no preparation circuit will be run and input state will be the allzero state in the computational basis.
 Tipo de retorno
PhaseEstimationResult
 Retorna
An instance of qiskit.algorithms.phase_estimator_result.PhaseEstimationResult.

estimate_from_pe_circuit
(pe_circuit, num_unitary_qubits)[código fonte]¶ Run the the phase estimation algorithm on a phase estimation circuit
 Parâmetros
pe_circuit (
QuantumCircuit
) – The phase estimation circuit.num_unitary_qubits (
int
) – Must agree with the number of qubits in the unitary in pe_circuit.
 Tipo de retorno
PhaseEstimationResult
 Retorna
An instance of qiskit.algorithms.phase_estimator_result.PhaseEstimationResult.