![]() |
The Quantum Exact Simulation Toolkit v4.3.0
|
Functions for applying the Quantum Fourier Transform. More...
Functions | |
| void | applyFullQuantumFourierTransform (Qureg qureg, bool inverse) |
| void | applyQuantumFourierTransform (Qureg qureg, int *targets, int numTargets, bool inverse) |
Functions for applying the Quantum Fourier Transform.
| void applyFullQuantumFourierTransform | ( | Qureg | qureg, |
| bool | inverse ) |
Applies the Quantum Fourier Transform upon all qubits in qureg. Alternatively, applies the Inverse Quantum Fourier Transform according to inverse.
The Quantum Fourier Transform maps each computational basis state \( \ket{j} \) in an \( N \) qubit qureg according to
\[ \ket{j} \rightarrow \frac{1}{\sqrt{2^N}} \sum_{k=0}^{2^N-1} e^{2 \pi i j k / 2^N} \ket{k}. \]
Similarly the Inverse Quantum Fourier Transform maps each basis state like
\[ \ket{j} \rightarrow \frac{1}{\sqrt{2^N}} \sum_{k=0}^{2^N-1} e^{-2 \pi i j k / 2^N} \ket{k}. \]
qureg as targets.| [in,out] | qureg | the state to modify. |
| [in] | inverse | whether to apply the inverse QFT or forward QFT |
| error |
|
Definition at line 1793 of file operations.cpp.
| void applyQuantumFourierTransform | ( | Qureg | qureg, |
| int * | targets, | ||
| int | numTargets, | ||
| bool | inverse ) |
Applies the Quantum Fourier Transform upon the specified targets of qureg. Alternatively, applies the Inverse Quantum Fourier Transform according to inverse.
Letting \( N \) = numTargets, the \( N \) qubit Quantum Fourier Transform maps each computational basis state of the targeted qubits, \( \ket{j} \), according to
\[ \ket{j} \rightarrow \frac{1}{\sqrt{2^N}} \sum_{k=0}^{2^N-1} e^{2 \pi i j k / 2^N} \ket{k}. \]
Similarly the Inverse Quantum Fourier Transform maps each basis state like
\[ \ket{j} \rightarrow \frac{1}{\sqrt{2^N}} \sum_{k=0}^{2^N-1} e^{-2 \pi i j k / 2^N} \ket{k}. \]
| [in,out] | qureg | the state to modify. |
| [in] | targets | the indices of the target qubits. |
| [in] | numTargets | the length of list targets |
| [in] | inverse | whether to apply the inverse QFT or forward QFT |
| error |
|
Definition at line 1755 of file operations.cpp.
Referenced by applyFullQuantumFourierTransform(), and applyQuantumFourierTransform().