qiskit.algorithms.HamiltonianPhaseEstimation.estimate¶
- HamiltonianPhaseEstimation.estimate(hamiltonian, state_preparation=None, evolution=None, bound=None)[source]¶
Run the Hamiltonian phase estimation algorithm.
- Parameters
hamiltonian (PauliOp | MatrixOp | SummedOp | Pauli | SparsePauliOp | PauliSumOp) – A Hermitian operator. If the algorithm is used with a
Sampler
primitive, the allowed types arePauli
,SparsePauliOp
, andPauliSumOp
. If the algorithm is used with aQuantumInstance
,PauliOp, ``MatrixOp
,PauliSumOp
, andSummedOp
types are allowed.state_preparation (StateFn | QuantumCircuit | Statevector | None) – The
StateFn
to be prepared, 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.evolution (EvolutionSynthesis | EvolutionBase | None) – An evolution converter that generates a unitary from
hamiltonian
. IfNone
, then the defaultPauliTrotterEvolution
is used.bound (float | None) – An upper bound on the absolute value of the eigenvalues of
hamiltonian
. If omitted, thenhamiltonian
must be a Pauli sum, or aPauliOp
, in which case a bound will be computed. Ifhamiltonian
is aMatrixOp
, thenbound
may not beNone
. The tighter the bound, the higher the resolution of computed phases.
- Returns
HamiltonianPhaseEstimationResult
instance containing the result of the estimation and diagnostic information.- Raises
TypeError – If
evolution
is not of typeEvolutionSynthesis
when aSampler
is provided.TypeError – If
hamiltonian
type is notPauli
orSparsePauliOp
orPauliSumOp
when aSampler
is provided.ValueError – If
bound
isNone
andhamiltonian
is not a Pauli sum, i.e. aPauliSumOp
or aSummedOp
whose terms are of typePauliOp
.TypeError – If
evolution
is not of typeEvolutionBase
when noSampler
is provided.
- Return type