74 lines
4.1 KiB
Plaintext
74 lines
4.1 KiB
Plaintext
---
|
||
title: LookupRotation (v0.29)
|
||
description: API reference for qiskit.aqua.components.reciprocals.LookupRotation in qiskit v0.29
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: class
|
||
python_api_name: qiskit.aqua.components.reciprocals.LookupRotation
|
||
---
|
||
|
||
# LookupRotation
|
||
|
||
<Class id="qiskit.aqua.components.reciprocals.LookupRotation" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-aqua/tree/stable/0.9/qiskit/aqua/components/reciprocals/lookup_rotation.py" signature="LookupRotation(pat_length=None, subpat_length=None, scale=0, negative_evals=False, evo_time=None, lambda_min=None)" modifiers="class">
|
||
Bases: `qiskit.aqua.components.reciprocals.reciprocal.Reciprocal`
|
||
|
||
The Lookup Rotation for Reciprocals.
|
||
|
||
This method applies a variable sized binning to the values. Only a specified number of bits after the most-significant bit is taken into account when assigning rotation angles to the numbers prepared as states in the input register. Using precomputed angles, the reciprocal is multiplied to the amplitude via controlled rotations. While no resolution of the result is lost for small values, towards larger values the bin size increases. The accuracy of the result is tuned by the parameters.
|
||
|
||
A calculation of reciprocals of eigenvalues is performed and controlled rotation of ancillary qubit via a lookup method. It uses a partial table lookup of rotation angles to rotate an ancillary qubit by arcsin(C/lambda).
|
||
|
||
**Parameters**
|
||
|
||
* **pat\_length** (`Optional`\[`int`]) – The number of qubits used for binning pattern. Specifies the number of bits following the most-significant bit that is used to identify a number. This leads to a binning of large values, while preserving the accuracy for smaller values. It should be chosen as $min(k-1,5)$ for an input register with k qubits to limit the error in the rotation to \< 3%.
|
||
* **subpat\_length** (`Optional`\[`int`]) – The number of qubits used for binning sub-pattern. This parameter is computed in the circuit creation routine and helps reducing the gate count. For pat\_length\<=5 it is chosen as $\left\lceil(\frac{patlength}{2})\right\rceil$.
|
||
* **scale** (`float`) – The scale of rotation angle, corresponds to HHL constant C, has values between 0 and 1. This parameter is used to scale the reciprocals such that for a scale C, the rotation is performed by an angle $\arcsin{\frac{C}{\lambda}}$. If neither the scale nor the evo\_time and lambda\_min parameters are specified, the smallest resolvable Eigenvalue is used.
|
||
* **negative\_evals** (`bool`) – Indicate if negative eigenvalues need to be handled
|
||
* **evo\_time** (`Optional`\[`float`]) – The evolution time. This parameter scales the Eigenvalues in the phase estimation onto the range (0,1] ( (-0.5,0.5] for negative Eigenvalues ).
|
||
* **lambda\_min** (`Optional`\[`float`]) – The smallest expected eigenvalue
|
||
|
||
## Methods
|
||
|
||
<span id="qiskit-aqua-components-reciprocals-lookuprotation-construct-circuit" />
|
||
|
||
### construct\_circuit
|
||
|
||
<Function id="qiskit.aqua.components.reciprocals.LookupRotation.construct_circuit" signature="LookupRotation.construct_circuit(mode, inreg)">
|
||
Construct the Lookup Rotation circuit.
|
||
|
||
**Parameters**
|
||
|
||
* **mode** (*str*) – construction mode, ‘matrix’ not supported
|
||
* **inreg** ([*QuantumRegister*](qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister")) – input register, typically output register of Eigenvalues
|
||
|
||
**Returns**
|
||
|
||
containing the Lookup Rotation circuit.
|
||
|
||
**Return type**
|
||
|
||
QuantumCircuit
|
||
|
||
**Raises:**
|
||
|
||
NotImplementedError: mode not supported
|
||
</Function>
|
||
|
||
<span id="qiskit-aqua-components-reciprocals-lookuprotation-sv-to-resvec" />
|
||
|
||
### sv\_to\_resvec
|
||
|
||
<Function id="qiskit.aqua.components.reciprocals.LookupRotation.sv_to_resvec" signature="LookupRotation.sv_to_resvec(statevector, num_q)">
|
||
Convert statevector to result vector.
|
||
|
||
**Parameters**
|
||
|
||
* **statevector** (*list*) – The statevector from simulation.
|
||
* **num\_q** (*int*) – Number of qubits of result register.
|
||
|
||
**Returns**
|
||
|
||
The result vector.
|
||
</Function>
|
||
</Class>
|
||
|