qit.examples.qft_circuit

qit.examples.qft_circuit(dim=(2, 3, 3, 2))

Quantum Fourier transform circuit demo.

Parameters

dim (Sequence[int]) – dimension vector of the subsystems

Simulate the quadratic quantum circuit for QFT.

NOTE: If dim is not palindromic the resulting circuit also reverses the order of the dimensions in the SWAP cascade.

\[U \ket{x_1, x_2, \ldots, x_n} = \frac{1}{\sqrt{d}} \sum_{k_i} \ket{k_n,\ldots, k_2, k_1} \exp\left(i 2 \pi \left(\sum_{r=1}^n k_r 0.x_r x_{r+1}\ldots x_n\right)\right) = \frac{1}{\sqrt{d}} \sum_{k_i} \ket{k_n,\ldots, k_2, k_1} \exp\left(i 2 \pi 0.x_1 x_2 \ldots x_n \left(\sum_{r=1}^n d_1 d_2 \cdots d_{r-1} k_r \right)\right).\]