IterativePhaseEstimation#
- class qiskit.algorithms.IterativePhaseEstimation(num_iterations, quantum_instance=None, sampler=None)[소스]#
기반 클래스:
PhaseEstimator
Run the Iterative quantum phase estimation (QPE) algorithm.
Given a unitary circuit and a circuit preparing an eigenstate, return the phase of the eigenvalue as a number in \([0,1)\) using the iterative phase estimation algorithm.
- [1]: Dobsicek et al. (2006), Arbitrary accuracy iterative phase estimation algorithm as a two
qubit benchmark, arxiv/quant-ph/0610214
버전 0.24.0부터 폐지됨:
qiskit.algorithms.phase_estimators.ipe.IterativePhaseEstimation.__init__()
’s argumentquantum_instance
is deprecated as of qiskit-terra 0.24.0. It will be removed no earlier than 3 months after the release date. Instead, use thesampler
argument. See https://qisk.it/algo_migration for a migration guide.- 매개변수:
num_iterations (int) – The number of iterations (rounds) of the phase estimation to run.
quantum_instance (QuantumInstance | Backend | None) – Deprecated: The quantum instance on which the circuit will be run.
sampler (BaseSampler | None) – The sampler primitive on which the circuit will be sampled.
- 예외 발생:
ValueError – if num_iterations is not greater than zero.
AlgorithmError – If neither sampler nor quantum instance is provided.
Methods
- construct_circuit(unitary, state_preparation, k, omega=0.0, measurement=False)[소스]#
Construct the kth iteration Quantum Phase Estimation circuit.
For details of parameters, see Fig. 2 in https://arxiv.org/pdf/quant-ph/0610214.pdf.
- 매개변수:
unitary (QuantumCircuit) – The circuit representing the unitary operator whose eigenvalue (via phase) will be measured.
state_preparation (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 all-zero state in the computational basis.
k (int) – the iteration idx.
omega (float) – the feedback angle.
measurement (bool) – Boolean flag to indicate if measurement should be included in the circuit.
- 반환:
the quantum circuit per iteration
- 반환 형식:
- estimate(unitary, state_preparation)[소스]#
Estimate the eigenphase of the input unitary and initial-state pair.
- 매개변수:
unitary (QuantumCircuit) – The circuit representing the unitary operator whose eigenvalue (via phase) will be measured.
state_preparation (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 all-zero state in the computational basis.
- 반환:
Estimated phase in an IterativePhaseEstimationResult object.
- 예외 발생:
AlgorithmError – If neither sampler nor quantum instance is provided.
- 반환 형식:
IterativePhaseEstimationResult