WOLFRAM|DEMONSTRATIONS PROJECT

Quantum Fourier Transform Circuit

​
number of qubits
n
1
2
3
vectors
input
output
1
2
2
1
1
1
1
1
1
1
1
1
πi
4
e
πi
2
e
3πi
4
e
πi
e
5πi
4
e
3πi
2
e
7πi
4
e
1
πi
2
e
πi
e
3πi
2
e
2πi
e
5πi
2
e
3πi
e
7πi
2
e
1
3πi
4
e
3πi
2
e
9πi
4
e
3πi
e
15πi
4
e
9πi
2
e
21πi
4
e
1
πi
e
2πi
e
3πi
e
4πi
e
5πi
e
6πi
e
7πi
e
1
5πi
4
e
5πi
2
e
15πi
4
e
5πi
e
25πi
4
e
15πi
2
e
35πi
4
e
1
3πi
2
e
3πi
e
9πi
2
e
6πi
e
15πi
2
e
9πi
e
21πi
2
e
1
7πi
4
e
7πi
2
e
21πi
4
e
7πi
e
35πi
4
e
21πi
2
e
49πi
4
e
A quantum circuit (sometimes called a quantum network or a quantum gate array) consists of wires and logic gates. It can be represented by a
n
2
×
n
2
unitary matrix, where
n
is the number of qubits. We want to factor this matrix, representing it as scalar and tensor (Kronecker) products of simpler one-qubit and two-qubit matrices.
The input register of the quantum Fourier transform (QFT) circuit contains
n
-qubit basis states that can be written as the Kronecker product of the binary states
|
x
1
>⊗|
x
2
>⋯⊗|
x
n
>
. The Hadamard gate
H=
1
2

1
1
1
-1

operates on the single qubit. The controlled
R
k
gate is represented by the unitary matrix
1
0
0
0
0
1
0
0
0
0
1
0
0
0
0
2πi
k
2
e
. The output qubits are expressed in the general form
0>+
2πib
e
1>
, where
b
is a binary fraction. The final result of QFT is obtained after swapping the output qubits (not shown here) and taking the Kronecker product. For the three-qubit case the final answer is
1
2
(0>+
iπ
x
1
e
1>)⊗
1
2
0>+
2iπ
x
1
2
+
x
2
4
e
1>⊗
1
2
0>+
2iπ
x
1
2
+
x
2
4
+
x
3
8
e
1>=
1
2
2
1
2iπ
x
1
2
+
x
2
4
+
x
3
8
e
2iπ
x
2
2
+
x
3
4
e
2iπ
x
1
2
+
x
2
4
+
x
3
8
+2iπ
x
2
2
+
x
3
4
e
iπ
x
3
e
2
2
2iπ
x
1
2
+
x
2
4
+
x
3
8
+iπ
x
3
e
2iπ
x
2
2
+
x
3
4
+iπ
x
3
e
iπ
x
1
2
+
x
2
4
+
x
3
8
+2iπ
x
2
2
+
x
3
4
+iπ
x
3
e
.