Function applyFullQFT

Source
pub unsafe extern "C" fn applyFullQFT(qureg: Qureg)
Expand description

Applies the quantum Fourier transform (QFT) to the entirety of \p qureg. The effected unitary circuit (shown here for 4 qubits, bottom qubit is 0) resembles @htmlonly

@endhtmlonly though is performed more efficiently.
  • §If \p qureg is a state-vector, the output amplitudes are the discrete Fourier transform (DFT) of the input amplitudes, in the exact ordering. This is true even if \p qureg is unnormalised. \n Precisely, \f[ \text{QFT} , \left( \sum\limits_{x=0}^{2^N-1} \alpha_x |x\rangle \right)

    \frac{1}{\sqrt{2^N}} \sum\limits_{x=0}^{2^N-1} \left( \sum\limits_{y=0}^{2^N-1} e^{2 \pi , i , x , y / 2^N} ; \alpha_y \right) |x\rangle \f]

  • If \p qureg is a density matrix \f$\rho\f$, it will be changed under the unitary action of the QFT. This can be imagined as each mixed state-vector undergoing the DFT on its amplitudes. This is true even if \p qureg is unnormalised. \f[ \rho ; \rightarrow ; \text{QFT} ; \rho ; \text{QFT}^{\dagger} \f]

This function merges contiguous controlled-phase gates into single invocations of applyNamedPhaseFunc(), and hence is significantly faster than performing the QFT circuit directly.

Furthermore, in distributed mode, this function requires only \f$\log_2(\text{#nodes})\f$ rounds of pair-wise communication, and hence is exponentially faster than directly performing the DFT on the amplitudes of \p qureg.

@see

  • applyQFT() to apply the QFT to a sub-register of \p qureg.

@ingroup operator @param[in,out] qureg a state-vector or density matrix to modify @author Tyson Jones