![]() |
The Quantum Exact Simulation Toolkit v4.1.0
|
Functions for applying many-qubit rotations around Pauli Z axis, and phase flips and shifts. More...
Functions | |
void | applyControlledPhaseGadget (Qureg qureg, int control, int *targets, int numTargets, qreal angle) |
void | applyMultiControlledPhaseGadget (Qureg qureg, int *controls, int numControls, int *targets, int numTargets, qreal angle) |
void | applyMultiQubitPhaseFlip (Qureg qureg, int *targets, int numTargets) |
void | applyMultiQubitPhaseShift (Qureg qureg, int *targets, int numTargets, qreal angle) |
void | applyMultiStateControlledPhaseGadget (Qureg qureg, int *controls, int *states, int numControls, int *targets, int numTargets, qreal angle) |
void | applyPhaseFlip (Qureg qureg, int target) |
void | applyPhaseGadget (Qureg qureg, int *targets, int numTargets, qreal angle) |
void | applyPhaseShift (Qureg qureg, int target, qreal angle) |
void | applyTwoQubitPhaseFlip (Qureg qureg, int target1, int target2) |
void | applyTwoQubitPhaseShift (Qureg qureg, int target1, int target2, qreal angle) |
void | multiplyPhaseGadget (Qureg qureg, int *targets, int numTargets, qreal angle) |
Functions for applying many-qubit rotations around Pauli Z axis, and phase flips and shifts.
void applyControlledPhaseGadget | ( | Qureg | qureg, |
int | control, | ||
int * | targets, | ||
int | numTargets, | ||
qreal | angle ) |
Definition at line 1516 of file operations.cpp.
Referenced by applyControlledPhaseGadget().
void applyMultiControlledPhaseGadget | ( | Qureg | qureg, |
int * | controls, | ||
int | numControls, | ||
int * | targets, | ||
int | numTargets, | ||
qreal | angle ) |
Definition at line 1524 of file operations.cpp.
Referenced by applyMultiControlledPhaseGadget().
void applyMultiQubitPhaseFlip | ( | Qureg | qureg, |
int * | targets, | ||
int | numTargets ) |
This function flips the sign of all computational basis states for which the targeted qubits are all in state \( \ket{1} \). This is equivalent to the diagonal unitary
\[ \hat{U}(\theta) = \begin{pmatrix} 1 \\ & \ddots \\ & & 1 \\ & & & -1 \end{pmatrix}, \]
effected upon the target qubits.
targets
has no affect on the effected operation.Definition at line 1648 of file operations.cpp.
Referenced by applyMultiQubitPhaseFlip(), applyPhaseFlip(), and applyTwoQubitPhaseFlip().
void applyMultiQubitPhaseShift | ( | Qureg | qureg, |
int * | targets, | ||
int | numTargets, | ||
qreal | angle ) |
Let \( \theta = \) angle
. This function multiplies factor \( e^{\iu \theta} \) upon all computational basis states for which all targeted qubits are in state \( \ket{1} \). This is equivalent to the diagonal unitary
\[ \hat{U}(\theta) = \begin{pmatrix} 1 \\ & \ddots \\ & & 1 \\ & & & e^{\iu \theta} \end{pmatrix}, \]
effected upon the target qubits.
targets
has no affect on the effected operation.angle=0
is equivalent to effecting the identity, leaving the state unchanged. Definition at line 1605 of file operations.cpp.
Referenced by applyMultiQubitPhaseShift(), applyPhaseShift(), and applyTwoQubitPhaseShift().
void applyMultiStateControlledPhaseGadget | ( | Qureg | qureg, |
int * | controls, | ||
int * | states, | ||
int | numControls, | ||
int * | targets, | ||
int | numTargets, | ||
qreal | angle ) |
Definition at line 1532 of file operations.cpp.
Referenced by applyControlledPhaseGadget(), applyMultiControlledPhaseGadget(), applyMultiStateControlledPhaseGadget(), and applyPhaseGadget().
void applyPhaseFlip | ( | Qureg | qureg, |
int | target ) |
This function is a mere alias of applyPauliZ(), meaningfully differing only for many targets.
Definition at line 1631 of file operations.cpp.
void applyPhaseGadget | ( | Qureg | qureg, |
int * | targets, | ||
int | numTargets, | ||
qreal | angle ) |
Let \( \vec{t} = \) targets
and \( \theta = \) angle
.
This function effects diagonal unitary
\[ R_{\hat{Z}}(\theta) = \exp \left( - \iu \, \frac{\theta}{2} \, \bigotimes_{t \,\in\, \vec{t}} \hat{Z}_t \right). \]
angle=0
is equivalent to effecting the identity, leaving the state unchanged. Definition at line 1508 of file operations.cpp.
Referenced by applyPhaseGadget().
void applyPhaseShift | ( | Qureg | qureg, |
int | target, | ||
qreal | angle ) |
Let \( \theta = \) angle
. This function effects diagonal unitary
\[ \hat{U}(\theta) = \begin{pmatrix} 1 & 0 \\ 0 & e^{\iu \theta} \end{pmatrix} \]
upon the target
qubit.
\[ \hat{U}(\theta) \equiv \hat{R}_z(\theta) \cdot e^{\iu \frac{\theta}{2}} \hat{\id} \]
angle=0
is equivalent to effecting the identity, leaving the state unchanged. Definition at line 1588 of file operations.cpp.
void applyTwoQubitPhaseFlip | ( | Qureg | qureg, |
int | target1, | ||
int | target2 ) |
Applies a two-qubit phase flip upon qubits target1
and target2
of qureg
.
This function flips the sign of all computational basis states for which the targeted qubits are in state \( \ket{1}\ket{1} \). This is equivalent to the diagonal unitary
\[ \hat{U}(\theta) = \begin{pmatrix} 1 \\ & 1 \\ & & 1 \\ & & & -1 \end{pmatrix}, \]
effected upon the target qubits.
Definition at line 1639 of file operations.cpp.
void applyTwoQubitPhaseShift | ( | Qureg | qureg, |
int | target1, | ||
int | target2, | ||
qreal | angle ) |
Applies a two-qubit phase shift upon qubits target1
and target2
of qureg
.
Let \( \theta = \) angle
. This function multiplies factor \( e^{\iu \theta} \) upon all computational basis states for which the targeted qubits are in state \( \ket{1}\ket{1} \). This is equivalent to the diagonal unitary
\[ \hat{U}(\theta) = \begin{pmatrix} 1 \\ & 1 \\ & & 1 \\ & & & e^{\iu \theta} \end{pmatrix}, \]
effected upon the target qubits.
angle=0
is equivalent to effecting the identity, leaving the state unchanged. Definition at line 1596 of file operations.cpp.
Referenced by applyQuantumFourierTransform().
void multiplyPhaseGadget | ( | Qureg | qureg, |
int * | targets, | ||
int | numTargets, | ||
qreal | angle ) |
Definition at line 1500 of file operations.cpp.
Referenced by multiplyPhaseGadget().