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 for
x = sum_{i=0}^{n-1} 2^{i}*q_i,
we can write
p(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

PolynomialRotation.num_target_qubits

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

PolynomialRotation.build_controlled_inverse(qc, …)

Adds controlled inverse of corresponding sub-circuit to given circuit

PolynomialRotation.build_controlled_inverse_power(qc, …)

Adds controlled, inverse, power of corresponding circuit.

PolynomialRotation.build_controlled_power(qc, …)

Adds controlled power of corresponding circuit.

PolynomialRotation.build_inverse(qc, q[, …])

Adds inverse of corresponding sub-circuit to given circuit

PolynomialRotation.build_inverse_power(qc, …)

Adds inverse power of corresponding circuit.

PolynomialRotation.build_power(qc, q, power)

Adds power of corresponding circuit.

PolynomialRotation.get_num_qubits()

returns number of qubits

PolynomialRotation.get_num_qubits_controlled()

returns number of qubits controlled

PolynomialRotation.required_ancillas()

returns required ancillas

PolynomialRotation.required_ancillas_controlled()

returns required ancillas controlled