PolynomialRotation¶
- class PolynomialRotation(px, num_state_qubits, basis='Y')[source]¶
DEPRECATED. Polynomial rotation.
Deprecated since version 0.7.0: Use Terra’s qiskit.circuit.library.PolynomialPauliRotations instead.
For a polynomial p(x), a basis state |i> and a target qubit |0> this operator acts as:|i>|0> –> |i>( cos(p(i))|0> + sin(p(i))|1> )Let n be the number of qubits representing the state, d the degree of p(x) and q_i the qubits,where q_0 is the least significant qubit. Then forx = sum_{i=0}^{n-1} 2^{i}*q_i,we can writep(x) = sum_{j=0}^{j=d} px[j]*(q_0 + 2*q_1 + … + 2^{n-1}*q_n-1)^{j}.The expression above is used to obtain the list of controls and rotation angles for the circuit.
Prepare an approximation to a state with amplitudes specified by a polynomial.
- Parameters
px (list) – coefficients of the polynomial, px[i] is the coefficient of x^i
num_state_qubits (int) – number of qubits representing the state
basis (str) – type of Pauli rotation (‘X’, ‘Y’, ‘Z’)
- Raises
ValueError – invalid input
Attributes
Returns the number of target qubits
Methods
PolynomialRotation.build
(qc, q, q_target[, …])Build the circuit.
PolynomialRotation.build_controlled
(qc, q, …)Adds corresponding controlled sub-circuit to given circuit
Adds controlled inverse of corresponding sub-circuit to given circuit
Adds controlled, inverse, power of corresponding circuit.
Adds controlled power of corresponding circuit.
PolynomialRotation.build_inverse
(qc, q[, …])Adds inverse of corresponding sub-circuit to given circuit
Adds inverse power of corresponding circuit.
PolynomialRotation.build_power
(qc, q, power)Adds power of corresponding circuit.
returns number of qubits
returns number of qubits controlled
returns required ancillas
returns required ancillas controlled