RFrac operation

Applies a rotation about the given Pauli axis by an angle specified as a dyadic fraction, \begin{align} R_{\mu}(n, k) \mathrel{:=} e^{i \pi n \sigma_{\mu} / 2^k}, \end{align} where $\mu \in {I, X, Y, Z}$.

Warning

This operation uses the opposite sign convention from R.

operation RFrac (pauli : Pauli, numerator : Int, power : Int, qubit : Qubit) : ()
Functors
Adjoint Controlled

Input

pauli
Pauli

Pauli operator to be exponentiated to form the rotation.

numerator
Int

Numerator in the dyadic fraction representation of the angle by which the qubit is to be rotated.

power
Int

Power of two specifying the denominator of the angle by which the qubit is to be rotated.

qubit
Qubit

Qubit to which the gate should be applied.

Output

()

Remarks

Equivalent to:

// Suppose Pi() is a function that returns an approximation of π.
R(pauli, -Pi() * Float(numerator) / Float(2 ^ (power - 1)), qubit);