Skip to main contentIBM Quantum Documentation Mirror

PolynomialPauliRotations

class qiskit.circuit.library.PolynomialPauliRotations(num_state_qubits=None, coeffs=None, basis='Y', name='poly')

GitHub

Bases: FunctionalPauliRotations

A circuit implementing polynomial Pauli rotations.

For a polynomial p(x)p(x), a basis state i|i\rangle and a target qubit 0|0\rangle this operator acts as:

i0cos(p(i)2)i0+sin(p(i)2)i1|i\rangle |0\rangle \mapsto \cos\left(\frac{p(i)}{2}\right) |i\rangle |0\rangle + \sin\left(\frac{p(i)}{2}\right) |i\rangle |1\rangle

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=i=0n12iqi,x = \sum_{i=0}^{n-1} 2^i q_i,

we can write

p(x)=j=0j=dcjxjp(x) = \sum_{j=0}^{j=d} c_j x^j

where cc are the input coefficients, coeffs.

Prepare an approximation to a state with amplitudes specified by a polynomial.

Parameters

  • num_state_qubits (int | None) – The number of qubits representing the state.
  • coeffs (list[float] | None) – The coefficients of the polynomial. coeffs[i] is the coefficient of the i-th power of x. Defaults to linear: [0, 1].
  • basis (str) – The type of Pauli rotation (‘X’, ‘Y’, ‘Z’).
  • name (str) – The name of the circuit.

Attributes

coeffs

The coefficients of the polynomial.

coeffs[i] is the coefficient of the i-th power of the function input xx, that means that the rotation angles are based on the coefficients value, following the formula

cjxj,j=0,...,dc_j x^j , j=0, ..., d

where dd is the degree of the polynomial p(x)p(x) and cc are the coefficients coeffs.

Returns

The coefficients of the polynomial.

degree

Return the degree of the polynomial, equals to the number of coefficients minus 1.

Returns

The degree of the polynomial. If the coefficients have not been set, return 0.

name

Type: str

A human-readable name for the circuit.

Example

from qiskit import QuantumCircuit
 
qc = QuantumCircuit(2, 2, name="my_circuit")
print(qc.name)
my_circuit