Qrack  7.0
General classical-emulating-quantum development framework
Functions
Rotational gates

NOTE: Dyadic operation angle sign is reversed from radian rotation operators and lacks a division by a factor of two. More...

Functions

virtual void Qrack::QInterface::UniformlyControlledRY (const bitLenInt *controls, bitLenInt controlLen, bitLenInt qubitIndex, const real1 *angles)
 Apply a "uniformly controlled" rotation of a bit around the Pauli Y axis. More...
 
virtual void Qrack::QInterface::UniformlyControlledRZ (const bitLenInt *controls, bitLenInt controlLen, bitLenInt qubitIndex, const real1 *angles)
 Apply a "uniformly controlled" rotation of a bit around the Pauli Z axis. More...
 
virtual void Qrack::QInterface::RT (real1_f radians, bitLenInt qubitIndex)
 Phase shift gate. More...
 
virtual void Qrack::QInterface::RX (real1_f radians, bitLenInt qubitIndex)
 X axis rotation gate. More...
 
virtual void Qrack::QInterface::RY (real1_f radians, bitLenInt qubitIndex)
 Y axis rotation gate. More...
 
virtual void Qrack::QInterface::RZ (real1_f radians, bitLenInt qubitIndex)
 Z axis rotation gate. More...
 
virtual void Qrack::QInterface::CRZ (real1_f radians, bitLenInt control, bitLenInt target)
 Controlled Z axis rotation gate. More...
 
virtual void Qrack::QInterface::RTDyad (int numerator, int denomPower, bitLenInt qubitIndex)
 Dyadic fraction phase shift gate. More...
 
virtual void Qrack::QInterface::RXDyad (int numerator, int denomPower, bitLenInt qubitIndex)
 Dyadic fraction X axis rotation gate. More...
 
virtual void Qrack::QInterface::Exp (real1_f radians, bitLenInt qubitIndex)
 (Identity) Exponentiation gate More...
 
virtual void Qrack::QInterface::Exp (const bitLenInt *controls, bitLenInt controlLen, bitLenInt qubit, const complex *matrix2x2, bool antiCtrled=false)
 Imaginary exponentiation of arbitrary 2x2 gate. More...
 
virtual void Qrack::QInterface::ExpDyad (int numerator, int denomPower, bitLenInt qubitIndex)
 Dyadic fraction (identity) exponentiation gate. More...
 
virtual void Qrack::QInterface::ExpX (real1_f radians, bitLenInt qubitIndex)
 Pauli X exponentiation gate. More...
 
virtual void Qrack::QInterface::ExpXDyad (int numerator, int denomPower, bitLenInt qubitIndex)
 Dyadic fraction Pauli X exponentiation gate. More...
 
virtual void Qrack::QInterface::ExpY (real1_f radians, bitLenInt qubitIndex)
 Pauli Y exponentiation gate. More...
 
virtual void Qrack::QInterface::ExpYDyad (int numerator, int denomPower, bitLenInt qubitIndex)
 Dyadic fraction Pauli Y exponentiation gate. More...
 
virtual void Qrack::QInterface::ExpZ (real1_f radians, bitLenInt qubitIndex)
 Pauli Z exponentiation gate. More...
 
virtual void Qrack::QInterface::ExpZDyad (int numerator, int denomPower, bitLenInt qubitIndex)
 Dyadic fraction Pauli Z exponentiation gate. More...
 
virtual void Qrack::QInterface::CRX (real1_f radians, bitLenInt control, bitLenInt target)
 Controlled X axis rotation gate. More...
 
virtual void Qrack::QInterface::CRXDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target)
 Controlled dyadic fraction X axis rotation gate. More...
 
virtual void Qrack::QInterface::RYDyad (int numerator, int denomPower, bitLenInt qubitIndex)
 Dyadic fraction Y axis rotation gate. More...
 
virtual void Qrack::QInterface::CRY (real1_f radians, bitLenInt control, bitLenInt target)
 Controlled Y axis rotation gate. More...
 
virtual void Qrack::QInterface::CRYDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target)
 Controlled dyadic fraction y axis rotation gate. More...
 
virtual void Qrack::QInterface::RZDyad (int numerator, int denomPower, bitLenInt qubitIndex)
 Dyadic fraction Z axis rotation gate. More...
 
virtual void Qrack::QInterface::CRZDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target)
 Controlled dyadic fraction Z axis rotation gate. More...
 
virtual void Qrack::QInterface::CRT (real1_f radians, bitLenInt control, bitLenInt target)
 Controlled "phase shift gate". More...
 
virtual void Qrack::QInterface::CRTDyad (int numerator, int denomPower, bitLenInt control, bitLenInt target)
 Controlled dyadic fraction "phase shift gate". More...
 

Detailed Description

NOTE: Dyadic operation angle sign is reversed from radian rotation operators and lacks a division by a factor of two.

Function Documentation

◆ CRT()

void Qrack::QInterface::CRT ( real1_f  radians,
bitLenInt  control,
bitLenInt  target 
)
virtual

Controlled "phase shift gate".

Controlled "phase shift gate" - if control bit is true, rotates target bit as e^(-i*/2) around |1> state.

If control bit is set to 1, rotates target bit as \( e^{-i \theta/2} \) around |1> state.

◆ CRTDyad()

void Qrack::QInterface::CRTDyad ( int  numerator,
int  denomPower,
bitLenInt  control,
bitLenInt  target 
)
virtual

Controlled dyadic fraction "phase shift gate".

Controlled dyadic "phase shift gate" - if control bit is true, rotates target bit as e^(i*(M_PI * numerator) / 2^denomPower) around |1> state.

If control bit is set to 1, rotates target bit as \( \exp\left(i*{\pi * numerator} / 2^{denomPower}\right) \) around |1> state.

◆ CRX()

void Qrack::QInterface::CRX ( real1_f  radians,
bitLenInt  control,
bitLenInt  target 
)
virtual

Controlled X axis rotation gate.

Controlled x axis rotation - if control bit is true, rotates as e^(-i*/2) around Pauli x axis.

If "control" is 1, rotates as \( e^{-i \theta/2} \) on Pauli x axis.

◆ CRXDyad()

void Qrack::QInterface::CRXDyad ( int  numerator,
int  denomPower,
bitLenInt  control,
bitLenInt  target 
)
virtual

Controlled dyadic fraction X axis rotation gate.

Controlled dyadic fraction x axis rotation gate - Rotates around Pauli x axis.

If "control" is 1, rotates as \( \exp\left(i*{\pi * numerator} / 2^{denomPower}\right) \) around Pauli x axis.

◆ CRY()

void Qrack::QInterface::CRY ( real1_f  radians,
bitLenInt  control,
bitLenInt  target 
)
virtual

Controlled Y axis rotation gate.

Controlled y axis rotation - if control bit is true, rotates as e^(-i*) around Pauli y axis.

If "control" is set to 1, rotates as \( e^{-i \theta/2} \) around Pauli Y axis.

◆ CRYDyad()

void Qrack::QInterface::CRYDyad ( int  numerator,
int  denomPower,
bitLenInt  control,
bitLenInt  target 
)
virtual

Controlled dyadic fraction y axis rotation gate.

Controlled dyadic fraction y axis rotation gate - Rotates around Pauli y axis.

If "control" is set to 1, rotates as \( \exp\left(i*{\pi * numerator} / 2^{denomPower}\right) \) around Pauli Y axis.

◆ CRZ()

void Qrack::QInterface::CRZ ( real1_f  radians,
bitLenInt  control,
bitLenInt  target 
)
virtual

Controlled Z axis rotation gate.

Controlled z axis rotation - if control bit is true, rotates as e^(-i*) around Pauli z axis.

If "control" is set to 1, rotates as \( e^{-i \theta/2} \) around Pauli Zaxis.

◆ CRZDyad()

void Qrack::QInterface::CRZDyad ( int  numerator,
int  denomPower,
bitLenInt  control,
bitLenInt  target 
)
virtual

Controlled dyadic fraction Z axis rotation gate.

Controlled dyadic fraction z axis rotation gate - Rotates around Pauli z axis.

If "control" is set to 1, rotates as \( \exp\left(i \pi numerator / 2^{denomPower}\right) \) around Pauli Z axis.

◆ Exp() [1/2]

void Qrack::QInterface::Exp ( real1_f  radians,
bitLenInt  qubitIndex 
)
virtual

(Identity) Exponentiation gate

Exponentiate identity operator.

Applies \( e^{-i \theta*I} \), exponentiation of the identity operator

◆ Exp() [2/2]

void Qrack::QInterface::Exp ( const bitLenInt controls,
bitLenInt  controlLen,
bitLenInt  qubit,
const complex matrix2x2,
bool  antiCtrled = false 
)
virtual

Imaginary exponentiation of arbitrary 2x2 gate.

Imaginary exponentiate of arbitrary single bit gate.

Applies \( e^{-i*Op} \), where "Op" is a 2x2 matrix, (with controls on the application of the gate).

◆ ExpDyad()

void Qrack::QInterface::ExpDyad ( int  numerator,
int  denomPower,
bitLenInt  qubitIndex 
)
virtual

Dyadic fraction (identity) exponentiation gate.

Dyadic fraction (identity) exponentiation gate - Applies exponentiation of the identity operator.

Applies \( \exp\left(-i \pi numerator I / 2^{denomPower}\right) \), exponentiation of the identity operator

◆ ExpX()

void Qrack::QInterface::ExpX ( real1_f  radians,
bitLenInt  qubitIndex 
)
virtual

Pauli X exponentiation gate.

Exponentiate Pauli X operator.

Applies \( e^{-i \theta \sigma_x} \), exponentiation of the Pauli X operator

◆ ExpXDyad()

void Qrack::QInterface::ExpXDyad ( int  numerator,
int  denomPower,
bitLenInt  qubitIndex 
)
virtual

Dyadic fraction Pauli X exponentiation gate.

Dyadic fraction Pauli X exponentiation gate - Applies exponentiation of the Pauli X operator.

Applies \( \exp\left(-i \pi numerator \sigma_x / 2^{denomPower}\right) \), exponentiation of the Pauli X operator

◆ ExpY()

void Qrack::QInterface::ExpY ( real1_f  radians,
bitLenInt  qubitIndex 
)
virtual

Pauli Y exponentiation gate.

Exponentiate Pauli Y operator.

Applies \( e^{-i \theta \sigma_y} \), exponentiation of the Pauli Y operator

◆ ExpYDyad()

void Qrack::QInterface::ExpYDyad ( int  numerator,
int  denomPower,
bitLenInt  qubitIndex 
)
virtual

Dyadic fraction Pauli Y exponentiation gate.

Dyadic fraction Pauli Y exponentiation gate - Applies exponentiation of the Pauli Y operator.

Applies \( \exp\left(-i \pi numerator \sigma_y / 2^{denomPower}\right) \), exponentiation of the Pauli Y operator

◆ ExpZ()

void Qrack::QInterface::ExpZ ( real1_f  radians,
bitLenInt  qubitIndex 
)
virtual

Pauli Z exponentiation gate.

Exponentiate Pauli Z operator.

Applies \( e^{-i \theta \sigma_z} \), exponentiation of the Pauli Z operator

◆ ExpZDyad()

void Qrack::QInterface::ExpZDyad ( int  numerator,
int  denomPower,
bitLenInt  qubitIndex 
)
virtual

Dyadic fraction Pauli Z exponentiation gate.

Dyadic fraction Pauli Z exponentiation gate - Applies exponentiation of the Pauli Z operator.

Applies \( \exp\left(-i \pi numerator \sigma_z / 2^{denomPower}\right) \), exponentiation of the Pauli Z operator

◆ RT()

void Qrack::QInterface::RT ( real1_f  radians,
bitLenInt  qubitIndex 
)
virtual

Phase shift gate.

"Phase shift gate" - Rotates as e^(-i*/2) around |1> state

Rotates as \( e^{-i \theta/2} \) around |1> state

◆ RTDyad()

void Qrack::QInterface::RTDyad ( int  numerator,
int  denomPower,
bitLenInt  qubitIndex 
)
virtual

Dyadic fraction phase shift gate.

Dyadic fraction "phase shift gate" - Rotates as e^(i*(M_PI * numerator) / 2^denomPower) around |1> state.

Rotates as \( \exp\left(i*{\pi * numerator} / 2^{denomPower}\right) \) around |1> state.

◆ RX()

void Qrack::QInterface::RX ( real1_f  radians,
bitLenInt  qubitIndex 
)
virtual

X axis rotation gate.

x axis rotation gate - Rotates as e^(-i*/2) around Pauli x axis

Rotates as \( e^{-i \theta/2} \) around Pauli X axis

◆ RXDyad()

void Qrack::QInterface::RXDyad ( int  numerator,
int  denomPower,
bitLenInt  qubitIndex 
)
virtual

Dyadic fraction X axis rotation gate.

Dyadic fraction x axis rotation gate - Rotates around Pauli x axis.

Rotates \( \exp\left(i*{\pi * numerator} / 2^{denomPower}\right) \) on Pauli x axis.

◆ RY()

void Qrack::QInterface::RY ( real1_f  radians,
bitLenInt  qubitIndex 
)
virtual

Y axis rotation gate.

y axis rotation gate - Rotates as e^(-i*/2) around Pauli y axis

Rotates as \( e^{-i \theta/2} \) around Pauli y axis.

◆ RYDyad()

void Qrack::QInterface::RYDyad ( int  numerator,
int  denomPower,
bitLenInt  qubitIndex 
)
virtual

Dyadic fraction Y axis rotation gate.

Dyadic fraction y axis rotation gate - Rotates around Pauli y axis.

Rotates as \( \exp\left(i*{\pi * numerator} / 2^{denomPower}\right) \) around Pauli Y axis.

◆ RZ()

void Qrack::QInterface::RZ ( real1_f  radians,
bitLenInt  qubitIndex 
)
virtual

Z axis rotation gate.

z axis rotation gate - Rotates as e^(-i*/2) around Pauli z axis

Rotates as \( e^{-i*\theta/2} \) around Pauli Z axis.

◆ RZDyad()

void Qrack::QInterface::RZDyad ( int  numerator,
int  denomPower,
bitLenInt  qubitIndex 
)
virtual

Dyadic fraction Z axis rotation gate.

Dyadic fraction y axis rotation gate - Rotates around Pauli y axis.

Rotates as \( \exp\left(i \pi numerator / 2^{denomPower}\right) \) around Pauli Z axis.

◆ UniformlyControlledRY()

void Qrack::QInterface::UniformlyControlledRY ( const bitLenInt controls,
bitLenInt  controlLen,
bitLenInt  qubitIndex,
const real1 angles 
)
virtual

Apply a "uniformly controlled" rotation of a bit around the Pauli Y axis.

Uniformly controlled y axis rotation gate - Rotates as e^(-i*/2) around Pauli y axis for each permutation "k" of the control bits.

(See https://arxiv.org/abs/quant-ph/0312218)

A different rotation angle is associated with each permutation of the control bits. The first control bit index in the "controls" array is the least significant bit of the permutation, proceeding to the most significant bit. "angles" is an array where each subsequent component is rotation angle associated with the next permutation of the control bits, starting from 0. All combinations of control bits apply one of rotation angles. For k control bits, there are therefore 2^k real components in "angles."

◆ UniformlyControlledRZ()

void Qrack::QInterface::UniformlyControlledRZ ( const bitLenInt controls,
bitLenInt  controlLen,
bitLenInt  qubitIndex,
const real1 angles 
)
virtual

Apply a "uniformly controlled" rotation of a bit around the Pauli Z axis.

Uniformly controlled z axis rotation gate - Rotates as e^(-i*/2) around Pauli z axis for each permutation "k" of the control bits.

(See https://arxiv.org/abs/quant-ph/0312218)

A different rotation angle is associated with each permutation of the control bits. The first control bit index in the "controls" array is the least significant bit of the permutation, proceeding to the most significant bit. "angles" is an array where each subsequent component is rotation angle associated with the next permutation of the control bits, starting from 0. All combinations of control bits apply one of rotation angles. For k control bits, there are therefore 2^k real components in "angles."