176 lines
6.1 KiB
Plaintext
176 lines
6.1 KiB
Plaintext
---
|
||
title: IQPE
|
||
description: API reference for qiskit.aqua.algorithms.IQPE
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: class
|
||
python_api_name: qiskit.aqua.algorithms.IQPE
|
||
---
|
||
|
||
# IQPE
|
||
|
||
<Class id="qiskit.aqua.algorithms.IQPE" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-aqua/tree/stable/0.9/qiskit/aqua/algorithms/minimum_eigen_solvers/iqpe.py" signature="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)" modifiers="class">
|
||
Bases: `qiskit.aqua.algorithms.quantum_algorithm.QuantumAlgorithm`, `qiskit.aqua.algorithms.minimum_eigen_solvers.minimum_eigen_solver.MinimumEigensolver`
|
||
|
||
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`](qiskit.aqua.algorithms.QPE "qiskit.aqua.algorithms.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](https://arxiv.org/abs/quant-ph/0610214)
|
||
|
||
**Parameters**
|
||
|
||
* **operator** (`Union`\[`OperatorBase`, `LegacyBaseOperator`, `None`]) – The hamiltonian Operator
|
||
* **state\_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
|
||
|
||
### compute\_minimum\_eigenvalue
|
||
|
||
<Function id="qiskit.aqua.algorithms.IQPE.compute_minimum_eigenvalue" signature="IQPE.compute_minimum_eigenvalue(operator=None, aux_operators=None)">
|
||
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.
|
||
|
||
**Parameters**
|
||
|
||
* **operator** (`Union`\[`OperatorBase`, `LegacyBaseOperator`, `None`]) – If not None replaces operator in algorithm
|
||
* **aux\_operators** (`Optional`\[`List`\[`Union`\[`OperatorBase`, `LegacyBaseOperator`]]]) – If not None replaces aux\_operators in algorithm
|
||
|
||
**Return type**
|
||
|
||
`MinimumEigensolverResult`
|
||
|
||
**Returns**
|
||
|
||
MinimumEigensolverResult
|
||
</Function>
|
||
|
||
### construct\_circuit
|
||
|
||
<Function id="qiskit.aqua.algorithms.IQPE.construct_circuit" signature="IQPE.construct_circuit(k=None, omega=0, measurement=False)">
|
||
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](https://arxiv.org/pdf/quant-ph/0610214.pdf).
|
||
|
||
**Parameters**
|
||
|
||
* **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.
|
||
|
||
**Returns**
|
||
|
||
the quantum circuit per iteration
|
||
|
||
**Return type**
|
||
|
||
[QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")
|
||
</Function>
|
||
|
||
### run
|
||
|
||
<Function id="qiskit.aqua.algorithms.IQPE.run" signature="IQPE.run(quantum_instance=None, **kwargs)">
|
||
Execute the algorithm with selected backend.
|
||
|
||
**Parameters**
|
||
|
||
* **quantum\_instance** (`Union`\[`QuantumInstance`, `Backend`, `BaseBackend`, `None`]) – the experimental setting.
|
||
* **kwargs** (*dict*) – kwargs
|
||
|
||
**Returns**
|
||
|
||
results of an algorithm.
|
||
|
||
**Return type**
|
||
|
||
dict
|
||
|
||
**Raises**
|
||
|
||
[**AquaError**](qiskit.aqua.AquaError "qiskit.aqua.AquaError") – If a quantum instance or backend has not been provided
|
||
</Function>
|
||
|
||
### set\_backend
|
||
|
||
<Function id="qiskit.aqua.algorithms.IQPE.set_backend" signature="IQPE.set_backend(backend, **kwargs)">
|
||
Sets backend with configuration.
|
||
|
||
**Return type**
|
||
|
||
`None`
|
||
</Function>
|
||
|
||
### supports\_aux\_operators
|
||
|
||
<Function id="qiskit.aqua.algorithms.IQPE.supports_aux_operators" signature="IQPE.supports_aux_operators()" modifiers="classmethod">
|
||
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.
|
||
|
||
**Return type**
|
||
|
||
`bool`
|
||
|
||
**Returns**
|
||
|
||
True if aux\_operator expectations can be evaluated, False otherwise
|
||
</Function>
|
||
|
||
## Attributes
|
||
|
||
### aux\_operators
|
||
|
||
<Attribute id="qiskit.aqua.algorithms.IQPE.aux_operators">
|
||
Returns aux operators
|
||
|
||
**Return type**
|
||
|
||
`Optional`\[`List`\[`Union`\[`OperatorBase`, `LegacyBaseOperator`]]]
|
||
</Attribute>
|
||
|
||
### backend
|
||
|
||
<Attribute id="qiskit.aqua.algorithms.IQPE.backend">
|
||
Returns backend.
|
||
|
||
**Return type**
|
||
|
||
`Union`\[`Backend`, `BaseBackend`]
|
||
</Attribute>
|
||
|
||
### operator
|
||
|
||
<Attribute id="qiskit.aqua.algorithms.IQPE.operator">
|
||
Returns operator
|
||
|
||
**Return type**
|
||
|
||
`Union`\[`OperatorBase`, `LegacyBaseOperator`, `None`]
|
||
</Attribute>
|
||
|
||
### quantum\_instance
|
||
|
||
<Attribute id="qiskit.aqua.algorithms.IQPE.quantum_instance">
|
||
Returns quantum instance.
|
||
|
||
**Return type**
|
||
|
||
`Optional`\[`QuantumInstance`]
|
||
</Attribute>
|
||
|
||
### random
|
||
|
||
<Attribute id="qiskit.aqua.algorithms.IQPE.random">
|
||
Return a numpy random.
|
||
</Attribute>
|
||
</Class>
|
||
|