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 of the state register, and a target qubit initialized in , this operator applies a Pauli rotation to the target qubit by the angle . For the default basis="Y", this acts as:
For basis="X", the action on the target qubit is:
For basis="Z", the action on the target qubit is:
Let be the number of qubits representing the state, the degree of and the qubits, where is the least significant qubit. Then for
we can write
where are the input coefficients, coeffs.
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 . 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