qat.lang.AQASM.qftarith.QFT
- qat.lang.AQASM.qftarith.QFT(reg_size: int)
Builds a circuit performing a full Quantum Fourier Transform on a given number of qbits.
Let us consider the input state
\[|\psi_{\mathrm{in}}\rangle=\sum_{k=0}^{2^{n}-1}a_{k}|k\rangle\]with \(|k\rangle=|b_{0}^{(k)},\dots b_{n-1}^{(k)}\rangle\), and the bit ordering defined by the expression \(k= \sum_{p=0}^{n-1}2^{n-1-p}b_{p}^{(k)}\) (most significant bit on the left). The QFT routine transforms this state to the state
\[|\psi_{\mathrm{out}}\rangle\equiv U_{\mathrm{QFT}}|\psi_{\mathrm{in}}\rangle =\sum_{x=0}^{2^{n}-1}\tilde{a}_{x}|x\rangle\]with the bit ordering defined in a reversed way, i.e \(x=\sum_{q=0}^{n-1}2^{q}b_{q}^{(x)}, |x\rangle= |b_{n-1}^{(x)},\dots,b_{0}^{(x)}\rangle\). The input and output amplitudes are related by the expression:
\[\tilde{a}_{x}=\frac{1}{\sqrt{2^{n}}}\sum_{k=0}^{2^{n}-1} \left(e^{\frac{2i\pi}{2^{n}}}\right)^{xk}a_{k}\]- Parameters
reg_size (int) – the number of qbits to apply the QFT on
- Returns