RFrac operation

Warning

This documentation refers to the Classic QDK, which has been replaced by the Modern QDK.

Please see https://aka.ms/qdk.api for the API documentation for the Modern QDK.

Namespace: Microsoft.Quantum.Intrinsic

Package: Microsoft.Quantum.Type2.Core

Applies a rotation about the given Pauli axis by an angle specified as a dyadic fraction.

operation RFrac (pauli : Pauli, numerator : Int, power : Int, qubit : Qubit) : Unit is Adj + Ctl

Description

\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 @"microsoft.quantum.intrinsic.r".

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. This angle is expressed in radians.

power : Int

Power of two specifying the denominator of the angle by which the qubit is to be rotated. This angle is expressed in radians.

qubit : Qubit

Qubit to which the gate should be applied.

Output : Unit

Remarks

Equivalent to:

// PI() is a Q# function that returns an approximation of π.
R(pauli, -PI() * IntAsDouble(numerator) / IntAsDouble(2 ^ (power - 1)), qubit);