![]() |
The Quantum Exact Simulation Toolkit v4.3.0
|
Functions for applying many-qubit rotations around the 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) |
Functions for applying many-qubit rotations around the Pauli Z axis, and phase flips and shifts.
| void applyControlledPhaseGadget | ( | Qureg | qureg, |
| int | control, | ||
| int * | targets, | ||
| int | numTargets, | ||
| qreal | angle ) |
Applies a singly-controlled many-qubit Z rotation upon qureg, generated by a tensor product of Pauli Z operators upon targets.
- See applyPhaseGadget() for information about the base operation,
angle, andtargets.
- See applyControlledCompMatr1() for information about
control.
Definition at line 1338 of file operations.cpp.
Referenced by applyControlledPhaseGadget().
| void applyMultiControlledPhaseGadget | ( | Qureg | qureg, |
| int * | controls, | ||
| int | numControls, | ||
| int * | targets, | ||
| int | numTargets, | ||
| qreal | angle ) |
Applies a multiply-controlled many-qubit Z rotation upon qureg, generated by a tensor product of Pauli Z operators upon targets.
- See applyPhaseGadget() for information about the base operation,
angle, andtargets.
- See applyMultiControlledCompMatr1() for information about
controls.
Definition at line 1346 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 are specified in increasing order, though the effect of this function is incidentally unaffected by the ordering of targets.targets has no affect on the effected operation.Definition at line 1466 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 are specified in increasing order, though the effect of this function is incidentally unaffected by the ordering of targets.targets has no affect on the effected operation.angle=0 is equivalent to effecting the identity, leaving the state unchanged. Definition at line 1422 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 ) |
Applies an arbitrarily-controlled many-qubit Z rotation upon qureg, generated by a tensor product of Pauli Z operators upon targets, and conditioned upon controls being in the corresponding states.
- See applyPhaseGadget() for information about the base operation,
angle, andtargets.
- See applyMultiStateControlledCompMatr1() for information about
controlsandstates.
Definition at line 1354 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 1449 of file operations.cpp.
| void applyPhaseGadget | ( | Qureg | qureg, |
| int * | targets, | ||
| int | numTargets, | ||
| qreal | angle ) |
Applies a many-qubit Z rotation upon qureg, generated by a tensor product of Pauli Z operators upon targets.
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). \]
targets are specified in increasing order, though the effect of this function is incidentally unaffected by the ordering of targets.angle=0 is equivalent to effecting the identity, leaving the state unchanged. Definition at line 1330 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 1405 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 1457 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 1413 of file operations.cpp.
Referenced by applyQuantumFourierTransform().