Use this file to discover all available pages before exploring further.
View on GitHub
Open this notebook in GitHub to run it yourself
This function performs a rotation on a series of m target qubits,
where the rotation angle is a linear function of an n-qubit
control register, as follows:∣x⟩n∣q⟩m→∣x⟩nk=1∏m(cos(2akx+2bk)−isin(2akx+2bk)Pk)∣qk⟩where ∣x⟩ is the control register,
∣q⟩ is the target register, each Pk is one of
the three Pauli matrices X, Y, or Z, and ak, bk are
the user given slopes and offsets, respectively.For example, the operation of a linear Y rotation on a zero-input
qubit is∣x⟩n∣0⟩→∣x⟩n(cos(2ax+2b)∣0⟩+sin(2ax+2b)∣1⟩)Such a rotation can be realized as a series of controlled rotations
as follows:[Ry(2n−1a)]xn−1⋯[Ry(21a)]x1[Ry(20a)]x0Ry(b)Function: linear_pauli_rotationsArguments:
bases: CArray[int]
List of Pauli Enums.
slopes: CArray[float]
Rotation slopes for each of the given Pauli bases.
offsets: CArray[float]
Rotation offsets for each of the given Pauli bases.
x: QArray[QBit]
Quantum state to apply the rotation based on its value.
q: QArray[QBit]
List of indicator qubits for each of the given Pauli bases.
Notice that bases, slopes, offset and q should be of the same size.
Example: Three Y Rotations Controlled by a 6-qubit State
This example generates a quantum program with a 6-qubit control
state and 3 target qubits, acted upon by Y rotations with different slopes and offsets.