PolynomialPauliRotations
class qiskit.circuit.library.PolynomialPauliRotations(num_state_qubits=None, coeffs=None, basis='Y', name='poly')
Bases: FunctionalPauliRotations
A circuit implementing polynomial Pauli rotations.
For a polynomial , a basis state and a target qubit this operator acts as:
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
we can write
where 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 , that means that the rotation angles are based on the coefficients value, following the formula
where is the degree of the polynomial and 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