LinearRotation¶
- class LinearRotation(slope, offset, num_state_qubits, basis='Y', i_state=None, i_target=None)[source]¶
DEPRECATED. Linearly-controlled X, Y or Z rotation.
Deprecated since version 0.7.0: Use Terra’s qiskit.circuit.library.LinearPauliRotations instead.
For a register of state qubits |x> and a target qubit |0> this operator acts as:
|x>|0> –> |x>( cos(slope * x + offset)|0> + sin(slope * x + offset)|1> )
- Parameters
slope (float) – slope of the controlled rotation
offset (float) – offset of the controlled rotation
num_state_qubits (int) – number of qubits representing the state
basis (str) – type of Pauli rotation (‘X’, ‘Y’, ‘Z’)
i_state (Optional(Union(list, numpy.ndarray))) – indices of the state qubits (least significant to most significant)
i_target (Optional(int)) – index of target qubit
- Raises
ValueError – invalid input
Attributes
Returns the number of target qubits
Methods
LinearRotation.build
(qc, q[, q_ancillas, params])Adds corresponding sub-circuit to given circuit
LinearRotation.build_controlled
(qc, q, q_control)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.
LinearRotation.build_controlled_power
(qc, q, …)Adds controlled power of corresponding circuit.
LinearRotation.build_inverse
(qc, q[, q_ancillas])Adds inverse of corresponding sub-circuit to given circuit
LinearRotation.build_inverse_power
(qc, q, power)Adds inverse power of corresponding circuit.
LinearRotation.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