qiskit.aqua.algorithms.IQPE¶
-
class
IQPE
(operator=None, state_in=None, num_time_slices=1, num_iterations=1, expansion_mode='suzuki', expansion_order=2, shallow_circuit_concat=False, quantum_instance=None)[source]¶ The Iterative Quantum Phase Estimation algorithm.
IQPE, as its name suggests, iteratively computes the phase so as to require fewer qubits. It has the same set of parameters as
QPE
, except for the number of ancillary qubits num_ancillae, being replaced by num_iterations and that an Inverse Quantum Fourier Transform (IQFT) is not used for IQPE.Reference:
- [1]: Dobsicek et al. (2006), Arbitrary accuracy iterative phase estimation algorithm as a two
qubit benchmark, arxiv/quant-ph/0610214
- Paramètres
operator (
Union
[OperatorBase
,LegacyBaseOperator
,None
]) – The hamiltonian Operatorstate_in (
Union
[QuantumCircuit
,InitialState
,None
]) – An InitialState component representing an initial quantum state.num_time_slices (
int
) – The number of time slices, has a minimum value of 1.num_iterations (
int
) – The number of iterations, has a minimum value of 1.expansion_mode (
str
) – The expansion mode (“trotter”|”suzuki”)expansion_order (
int
) – The suzuki expansion order, has a min. value of 1.shallow_circuit_concat (
bool
) – Set True to use shallow (cheap) mode for circuit concatenation of evolution slices. By default this is False.quantum_instance (
Union
[QuantumInstance
,Backend
,BaseBackend
,None
]) – Quantum Instance or Backend
-
__init__
(operator=None, state_in=None, num_time_slices=1, num_iterations=1, expansion_mode='suzuki', expansion_order=2, shallow_circuit_concat=False, quantum_instance=None)[source]¶ - Paramètres
operator (
Union
[OperatorBase
,LegacyBaseOperator
,None
]) – The hamiltonian Operatorstate_in (
Union
[QuantumCircuit
,InitialState
,None
]) – An InitialState component representing an initial quantum state.num_time_slices (
int
) – The number of time slices, has a minimum value of 1.num_iterations (
int
) – The number of iterations, has a minimum value of 1.expansion_mode (
str
) – The expansion mode (“trotter”|”suzuki”)expansion_order (
int
) – The suzuki expansion order, has a min. value of 1.shallow_circuit_concat (
bool
) – Set True to use shallow (cheap) mode for circuit concatenation of evolution slices. By default this is False.quantum_instance (
Union
[QuantumInstance
,Backend
,BaseBackend
,None
]) – Quantum Instance or Backend
Methods
__init__
([operator, state_in, …])- type operator
Union
[OperatorBase
,LegacyBaseOperator
,None
]
compute_minimum_eigenvalue
([operator, …])Computes minimum eigenvalue.
construct_circuit
([k, omega, measurement])Construct the kth iteration Quantum Phase Estimation circuit.
run
([quantum_instance])Execute the algorithm with selected backend.
set_backend
(backend, **kwargs)Sets backend with configuration.
Whether computing the expectation value of auxiliary operators is supported.
Attributes
Returns aux operators
Returns backend.
Returns operator
Returns quantum instance.
Return a numpy random.
-
property
aux_operators
¶ Returns aux operators
- Type renvoyé
Optional
[List
[Union
[OperatorBase
,LegacyBaseOperator
]]]
-
property
backend
¶ Returns backend.
- Type renvoyé
Union
[Backend
,BaseBackend
]
-
compute_minimum_eigenvalue
(operator=None, aux_operators=None)[source]¶ Computes minimum eigenvalue. Operator and aux_operators can be supplied here and if not None will override any already set into algorithm so it can be reused with different operators. While an operator is required by algorithms, aux_operators are optional. To “remove” a previous aux_operators array use an empty list here.
- Paramètres
operator (
Union
[OperatorBase
,LegacyBaseOperator
,None
]) – If not None replaces operator in algorithmaux_operators (
Optional
[List
[Union
[OperatorBase
,LegacyBaseOperator
]]]) – If not None replaces aux_operators in algorithm
- Type renvoyé
MinimumEigensolverResult
- Renvoie
MinimumEigensolverResult
-
construct_circuit
(k=None, omega=0, measurement=False)[source]¶ Construct the kth iteration Quantum Phase Estimation circuit.
For details of parameters, please see Fig. 2 in https://arxiv.org/pdf/quant-ph/0610214.pdf.
- Paramètres
k (
Optional
[int
]) – the iteration idx.omega (
float
) – the feedback angle.measurement (
bool
) – Boolean flag to indicate if measurement should be included in the circuit.
- Renvoie
the quantum circuit per iteration
- Type renvoyé
-
property
operator
¶ Returns operator
- Type renvoyé
Union
[OperatorBase
,LegacyBaseOperator
,None
]
-
property
quantum_instance
¶ Returns quantum instance.
- Type renvoyé
Optional
[QuantumInstance
]
-
property
random
¶ Return a numpy random.
-
run
(quantum_instance=None, **kwargs)¶ Execute the algorithm with selected backend.
- Paramètres
quantum_instance (
Union
[QuantumInstance
,Backend
,BaseBackend
,None
]) – the experimental setting.kwargs (dict) – kwargs
- Renvoie
results of an algorithm.
- Type renvoyé
dict
- Lève
AquaError – If a quantum instance or backend has not been provided
-
set_backend
(backend, **kwargs)¶ Sets backend with configuration.
- Type renvoyé
None
-
classmethod
supports_aux_operators
()¶ Whether computing the expectation value of auxiliary operators is supported.
If the minimum eigensolver computes an eigenstate of the main operator then it can compute the expectation value of the aux_operators for that state. Otherwise they will be ignored.
- Type renvoyé
bool
- Renvoie
True if aux_operator expectations can be evaluated, False otherwise