qiskit.algorithms.HamiltonianPhaseEstimationResult¶
-
class
HamiltonianPhaseEstimationResult
(phase_estimation_result, phase_estimation_scale, id_coefficient)[소스]¶ Store and manipulate results from running HamiltonianPhaseEstimation.
This API of this class is nearly the same as PhaseEstimatorResult, differing only in the presence of an additional keyword argument in the methods. If scaled is False, then the phases are not translated and scaled to recover the eigenvalues of the Hamiltonian. Instead phi in \([0, 1)\) is returned, as is the case when then unitary is not derived from a Hamiltonian.
This class is meant to be instantiated via HamiltonianPhaseEstimation.estimate.
- 매개변수
phase_estimation_result (
PhaseEstimationResult
) – The result object returned by PhaseEstimation.estimate.phase_estimation_scale (
PhaseEstimationScale
) – object used to scale phases to obtain eigenvalues.id_coefficient (
float
) – The coefficient of the identity term in the Hamiltonian. Eigenvalues are computed without this term so that the coefficient must added to give correct eigenvalues. This is done automatically when retrieving eigenvalues.
-
__init__
(phase_estimation_result, phase_estimation_scale, id_coefficient)[소스]¶ - 매개변수
phase_estimation_result (
PhaseEstimationResult
) – The result object returned by PhaseEstimation.estimate.phase_estimation_scale (
PhaseEstimationScale
) – object used to scale phases to obtain eigenvalues.id_coefficient (
float
) – The coefficient of the identity term in the Hamiltonian. Eigenvalues are computed without this term so that the coefficient must added to give correct eigenvalues. This is done automatically when retrieving eigenvalues.
Methods
__init__
(phase_estimation_result, …)- type phase_estimation_result
PhaseEstimationResult
combine
(result)Any property from the argument that exists in the receiver is updated.
filter_phases
([cutoff, scaled, as_float])Filter phases as does PhaseEstimatorResult.filter_phases, with the addition that phi is shifted and translated to return eigenvalues of the Hamiltonian.
Attributes
The most likely eigenvalue of the Hamiltonian.
The most likely phase of the unitary corresponding to the Hamiltonian.
-
combine
(result)¶ Any property from the argument that exists in the receiver is updated. :type result:
AlgorithmResult
:param result: Argument result with properties to be set.- 예외
TypeError – Argument is None
- 반환 형식
None
-
filter_phases
(cutoff=0.0, scaled=True, as_float=True)[소스]¶ Filter phases as does PhaseEstimatorResult.filter_phases, with the addition that phi is shifted and translated to return eigenvalues of the Hamiltonian.
- 매개변수
cutoff (
float
) – Minimum weight of number of counts required to keep a bit string. The default value is 0.0.scaled (
bool
) – If False, return phi in \([0, 1)\) rather than the eigenvalues of the Hamiltonian.as_float (
bool
) – If True, returned keys are floats in \([0.0, 1.0)\). If False returned keys are bit strings.
- 예외
ValueError – if as_float is False and scaled is True.
- 반환 형식
Dict
[Union
[str
,float
],float
]- 반환값
A dict of filtered phases.
-
property
most_likely_eigenvalue
¶ The most likely eigenvalue of the Hamiltonian.
This method calls most_likely_phase and scales the result to obtain an eigenvalue.
- 반환 형식
float
- 반환값
The most likely eigenvalue of the Hamiltonian.
-
property
most_likely_phase
¶ The most likely phase of the unitary corresponding to the Hamiltonian.
- 반환 형식
float
- 반환값
The most likely phase.