Skip to main contentIBM Quantum Documentation
This page is from an old version of Qiskit SDK and does not exist in the latest version. We recommend you migrate to the latest version. See the release notes for more information.

qiskit.aqua.components.reciprocals.LookupRotation

class LookupRotation(pat_length=None, subpat_length=None, scale=0, negative_evals=False, evo_time=None, lambda_min=None)

GitHub

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(k1,5)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 (patlength2)\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 arcsinCλ\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

__init__

__init__(pat_length=None, subpat_length=None, scale=0, negative_evals=False, evo_time=None, lambda_min=None)

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(k1,5)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 (patlength2)\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 arcsinCλ\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

__init__([pat_length, subpat_length, scale, …])type pat_lengthOptional[int]
construct_circuit(mode, inreg)Construct the Lookup Rotation circuit.
sv_to_resvec(statevector, num_q)Convert statevector to result vector.

construct_circuit

construct_circuit(mode, inreg)

Construct the Lookup Rotation circuit.

Parameters

  • mode (str) – construction mode, ‘matrix’ not supported
  • inreg (QuantumRegister) – input register, typically output register of Eigenvalues

Returns

containing the Lookup Rotation circuit.

Return type

QuantumCircuit

Raises:

NotImplementedError: mode not supported

sv_to_resvec

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.

Was this page helpful?
Report a bug or request content on GitHub.