Lesson 03 Hadamard gate and Phase gates


Lesson 03.1: Hadamard gate
The Hadamard gate has the property that it maps X → Z, and Z → X. This gate is required to make superpositions.

matrix form: Hadamard gate
| 1/√2  1/√2 |
| 1/√2 -1/√2 |

quantum assembly language (QASM): gate h a { u2(0,pi) a; }
h q[0];
h q[1];


Lesson 03.2: Phase shift gate
$$這是一系列操作單一量子位元的閘,它保留基本狀態 | 0 ⟩, 並且將 | 1 ⟩ 換成e^{i\theta} | 1 ⟩$$
matrix form:
$$| 1 \quad \quad 0 |$$ $$| 0 \quad e^{i\theta} |$$


Lesson 03.2.1: pi/2 Phase shift gate
The Phase gate that is √Z and has the property that it maps X → Y and Z → Z. This gate extends H to make complex superpositions.


$$\pi/2 \quad gate$$ matrix form:
| 1 0 |
| 0 i |

quantum assembly language (QASM): gate s a {u1(pi/2) a;}
s q[0];
s q[1];


Lesson 03.3: transposed conjugate of pi/2 Phase shift gate
X → − Y, and Z → Z.
matrix form:
| 1  0 |
| 0 -i |

quantum assembly language (QASM): gate sdg a {u1(-pi/2) a;}
sdg q[0];
sdg q[1];


Lesson 03.4: Phase gate T
The Phase gate that is √S, which is a π/4 rotation around the Z axis. This gate is required for universal control.
matrix form:
| 1        0 |
| 0 (1+i)/√2 |

quantum assembly language (QASM): gate t a { u1(pi/4) a;}
t q[0];
t q[1];


Lesson 03.5: transposed conjugate of Phase gate T
matrix form:
| 1        0 |
| 0 (1-i)/√2 |

quantum assembly language (QASM): gate sdg a {u1(-pi/4) a;}
tdg q[0];
tdg q[1];