<<

Examples of Quantum Circuit Diagrams

Michal Charemza April 2006

Below some examples of quantum circuit diagrams are given. They are A typset using a modified version of the LTEX package QCircuit. The source for the present document, the modified QCircuit package, and the project An Introduction to from which the diagrams are taken are available online at http://go.warwick.ac.uk/mtcharemza/pastprojects .

1 |0i H √2 (|0i + |1i) Figure 1: Example of Hadamard gate acting on one .

|0i  |1i Figure 2: Example of a not gate acting on one qubit.

|1i • |1i |0i  |1i Figure 3: Example of a controlled-not gate.

1 1 √2 (|0i + |1i) M"%#$ ? Figure 4: Example of a measurement. Note that for the input mixed state 1 √2 (|0i + |1i), it is unknown what the result of the measurement will be. All that is known is that the result has equal probability of being |0i or |1i.

|1i • |1i |0i  |1i Figure 5: Example of a controlled-not gate.

1 √2 (|0i + |1i) M"%#$ ? Figure 6: Example of a measurement. Note that for the input mixed state 1 √2 (|0i + |1i), it is unknown what the result of the measurement will be. All that is known is that the result has equal probability of being |0i or |1i.

2                F2   f(x) ∈ F2 x ∈ n  C  m                  F2 F2 Figure 7: Boolean circuit performing function f : n → m.

|xi • |xi

|yi • |yi

|zi  |x ⊕ (y ∧ zi) Figure 8: Toffoli gate.

|xi • • • |xi

|yi •  •  |yi

|zi H Fπ/2 F3π/2 Fπ/2 H |x ⊕ (y ∧ zi)

Figure 9: Decomposition of a Toffoli gate.

3 |xi • |xi |yi • |yi |0i  |x ∧ yi

Figure 10: Toffoli gate as an .

|xi  • |¬xi

|yi  • |¬yi

|0i   |x ∨ yi

Figure 11: A Toffoli gate as an or gate.

|xi • |xi |0i  • |1i

|0i  |xi

Figure 12: Toffoli gate as fanout.

4           |f(x)i       x   | i          R                garbage      |0i (ancilla )             Figure 13: Quantum circuit emulating boolean circuit that performs function F2 F2 f : n → m.

5 •  •     •     •   •     •    |xi • |xi  •         R 1   R−           

      0   0 | i | i                  |0i  |f(x)i               Figure 14: Quantum circuit emulating boolean circuit that performs function F2 F2 f : n → m. Note that this circuit preserves input and ancilla qubits.

Alice a • a b • b

AF 

Bob

• H M"%#$ a

B  M"%#$ b

Figure 15: .

6 Alice

|ψi • H M"%#$

A  M"%#$

Bob • •

B  F |ψi

Figure 16: .

          1 x y |xi  QF TFm  (−1) . |yi  2  √2m  Xm y F2  . .  ∈  . .          m Figure 17: Quantum Fourier transform in F2 .

H        H        1 x.y |xi   √2m (−1) |yi H Xm y F2   ∈  . .   . .       H    m Figure 18: Decomposition of QFT in F2 .

|ψi •  • |φi |φi  •  |ψi Figure 19: Swap of two qubits.

7 |xm 1i H φ φ φ |y0i −

|xm 2i • H φ φ |y1i −

|xm 3i • • H φ |y2i − ...... |x0i • • • H |ym 1i −

Figure 20: Decomposition of QFT in Z2m .

=<       |0i  H  |yi  m M  . .  . .   :;      Figure 21: Circuit that generates random numbers.

8