![]() |
The Quantum Exact Simulation Toolkit v4.0.0
|
Functions for applying one-qubit rotations around Pauli and arbitrary axis. More...
Functions | |
void | applyControlledRotateAroundAxis (Qureg qureg, int ctrl, int targ, qreal angle, qreal axisX, qreal axisY, qreal axisZ) |
void | applyControlledRotateX (Qureg qureg, int control, int target, qreal angle) |
void | applyControlledRotateY (Qureg qureg, int control, int target, qreal angle) |
void | applyControlledRotateZ (Qureg qureg, int control, int target, qreal angle) |
void | applyMultiControlledRotateAroundAxis (Qureg qureg, int *ctrls, int numCtrls, int targ, qreal angle, qreal axisX, qreal axisY, qreal axisZ) |
void | applyMultiControlledRotateX (Qureg qureg, int *controls, int numControls, int target, qreal angle) |
void | applyMultiControlledRotateY (Qureg qureg, int *controls, int numControls, int target, qreal angle) |
void | applyMultiControlledRotateZ (Qureg qureg, int *controls, int numControls, int target, qreal angle) |
void | applyMultiStateControlledRotateAroundAxis (Qureg qureg, int *ctrls, int *states, int numCtrls, int targ, qreal angle, qreal axisX, qreal axisY, qreal axisZ) |
void | applyMultiStateControlledRotateX (Qureg qureg, int *controls, int *states, int numControls, int target, qreal angle) |
void | applyMultiStateControlledRotateY (Qureg qureg, int *controls, int *states, int numControls, int target, qreal angle) |
void | applyMultiStateControlledRotateZ (Qureg qureg, int *controls, int *states, int numControls, int target, qreal angle) |
void | applyRotateAroundAxis (Qureg qureg, int target, qreal angle, qreal axisX, qreal axisY, qreal axisZ) |
void | applyRotateX (Qureg qureg, int target, qreal angle) |
void | applyRotateY (Qureg qureg, int target, qreal angle) |
void | applyRotateZ (Qureg qureg, int target, qreal angle) |
Functions for applying one-qubit rotations around Pauli and arbitrary axis.
void applyControlledRotateAroundAxis | ( | Qureg | qureg, |
int | ctrl, | ||
int | targ, | ||
qreal | angle, | ||
qreal | axisX, | ||
qreal | axisY, | ||
qreal | axisZ ) |
Definition at line 1349 of file operations.cpp.
void applyControlledRotateX | ( | Qureg | qureg, |
int | control, | ||
int | target, | ||
qreal | angle ) |
Definition at line 1223 of file operations.cpp.
void applyControlledRotateY | ( | Qureg | qureg, |
int | control, | ||
int | target, | ||
qreal | angle ) |
Definition at line 1231 of file operations.cpp.
void applyControlledRotateZ | ( | Qureg | qureg, |
int | control, | ||
int | target, | ||
qreal | angle ) |
Definition at line 1239 of file operations.cpp.
void applyMultiControlledRotateAroundAxis | ( | Qureg | qureg, |
int * | ctrls, | ||
int | numCtrls, | ||
int | targ, | ||
qreal | angle, | ||
qreal | axisX, | ||
qreal | axisY, | ||
qreal | axisZ ) |
Definition at line 1357 of file operations.cpp.
Referenced by applyMultiControlledRotateAroundAxis().
void applyMultiControlledRotateX | ( | Qureg | qureg, |
int * | controls, | ||
int | numControls, | ||
int | target, | ||
qreal | angle ) |
Definition at line 1247 of file operations.cpp.
Referenced by applyMultiControlledRotateX().
void applyMultiControlledRotateY | ( | Qureg | qureg, |
int * | controls, | ||
int | numControls, | ||
int | target, | ||
qreal | angle ) |
Definition at line 1255 of file operations.cpp.
Referenced by applyMultiControlledRotateY().
void applyMultiControlledRotateZ | ( | Qureg | qureg, |
int * | controls, | ||
int | numControls, | ||
int | target, | ||
qreal | angle ) |
Definition at line 1263 of file operations.cpp.
Referenced by applyMultiControlledRotateZ().
void applyMultiStateControlledRotateAroundAxis | ( | Qureg | qureg, |
int * | ctrls, | ||
int * | states, | ||
int | numCtrls, | ||
int | targ, | ||
qreal | angle, | ||
qreal | axisX, | ||
qreal | axisY, | ||
qreal | axisZ ) |
Definition at line 1365 of file operations.cpp.
Referenced by applyControlledRotateAroundAxis(), applyMultiControlledRotateAroundAxis(), applyMultiStateControlledRotateAroundAxis(), and applyRotateAroundAxis().
void applyMultiStateControlledRotateX | ( | Qureg | qureg, |
int * | controls, | ||
int * | states, | ||
int | numControls, | ||
int | target, | ||
qreal | angle ) |
Definition at line 1271 of file operations.cpp.
Referenced by applyControlledRotateX(), applyMultiControlledRotateX(), applyMultiStateControlledRotateX(), and applyRotateX().
void applyMultiStateControlledRotateY | ( | Qureg | qureg, |
int * | controls, | ||
int * | states, | ||
int | numControls, | ||
int | target, | ||
qreal | angle ) |
Definition at line 1280 of file operations.cpp.
Referenced by applyControlledRotateY(), applyMultiControlledRotateY(), applyMultiStateControlledRotateY(), and applyRotateY().
void applyMultiStateControlledRotateZ | ( | Qureg | qureg, |
int * | controls, | ||
int * | states, | ||
int | numControls, | ||
int | target, | ||
qreal | angle ) |
Definition at line 1289 of file operations.cpp.
Referenced by applyControlledRotateZ(), applyMultiControlledRotateZ(), applyMultiStateControlledRotateZ(), and applyRotateZ().
void applyRotateAroundAxis | ( | Qureg | qureg, |
int | target, | ||
qreal | angle, | ||
qreal | axisX, | ||
qreal | axisY, | ||
qreal | axisZ ) |
Let \( \theta = \) angle
and \( \vec{n} = ( \) axisX
, axisY
, axisZ
\( ) \), with corresponding unit vector \( \bar{n} \). Further, let \( \vec{\sigma} = (\hat{\sigma}_x, \hat{\sigma}_y, \hat{\sigma}_z) \) denote a vector of the Pauli matrices.
This function effects unitary
\[ \hat{R}_{\bar{n}}(\theta) = \exp \left( - \iu \frac{\theta}{2} \bar{n} \cdot \vec{\sigma} \right) \]
upon the target qubit. Explicitly,
\[ \hat{R}_{\bar{n}}(\theta) \equiv \begin{pmatrix} \cos\left( \frac{\theta}{2} \right) - \iu \, \bar{n}_z \sin\left( \frac{\theta}{2} \right) & - \, (\bar{n}_y + \bar{n}_x \, \iu ) \sin\left( \frac{\theta}{2} \right) \\ (\bar{n}_y - \bar{n}_x \, \iu ) \sin\left( \frac{\theta}{2} \right) & \cos\left( \frac{\theta}{2} \right) + \iu \, \bar{n}_z \sin\left( \frac{\theta}{2} \right) \end{pmatrix} \]
where
\[ \bar{n}_i = \frac{\vec{n}_i}{\| \vec{n} \|_2} = \frac{\vec{n}_i}{ \sqrt{ {\vec{n}_x}^2 + {\vec{n}_y}^2 + {\vec{n}_z}^2 } }. \]
angle=0
is equivalent to effecting the identity, leaving the state unchanged. Definition at line 1341 of file operations.cpp.
void applyRotateX | ( | Qureg | qureg, |
int | target, | ||
qreal | angle ) |
Let \( \theta = \) angle
. This function effects unitary
\[ \hat{R}_{x}(\theta) = \exp \left( - \iu \frac{\theta}{2} \hat{\sigma}_x \right) \]
upon the target
qubit, where \( \hat{\sigma}_x \) is the Pauli X matrix.
angle=0
is equivalent to effecting the identity, leaving the state unchanged. Definition at line 1199 of file operations.cpp.
void applyRotateY | ( | Qureg | qureg, |
int | target, | ||
qreal | angle ) |
Let \( \theta = \) angle
. This function effects unitary
\[ \hat{R}_{y}(\theta) = \exp \left( - \iu \frac{\theta}{2} \hat{\sigma}_y \right) \]
upon the target
qubit, where \( \hat{\sigma}_y \) is the Pauli Y matrix.
angle=0
is equivalent to effecting the identity, leaving the state unchanged. Definition at line 1207 of file operations.cpp.
void applyRotateZ | ( | Qureg | qureg, |
int | target, | ||
qreal | angle ) |
Let \( \theta = \) angle
. This function effects unitary
\[ \hat{R}_{z}(\theta) = \exp \left( - \iu \frac{\theta}{2} \hat{\sigma}_z \right) \]
upon the target
qubit, where \( \hat{\sigma}_z \) is the Pauli Z matrix.
angle=0
is equivalent to effecting the identity, leaving the state unchanged. Definition at line 1215 of file operations.cpp.