Sunday, July 5, 2026

qunatum gate

Single Qubit Gates - Study Notes
Quantum Computing — Study Notes

Single Qubit Gates

Complete Reference Guide for Students

📄 Topic 3.1
⏱️ ~45 min read
📑 Table of Contents
1. What is a Qubit?
8. Quick Reference Table
2. What are Quantum Gates?
9. Bloch Sphere Visualization
3. Pauli-X Gate
10. Important Relationships
4. Pauli-Y Gate
11. Worked Example
5. Pauli-Z Gate
12. Key Takeaways
6. Hadamard Gate
13. Common Exam Questions
7. Phase Gates (S & T)
14. Rotation Gates (Rx, Ry, Rz)
01 What is a Qubit?

A qubit is the fundamental unit of quantum information. Unlike a classical bit (which is either 0 or 1), a qubit can exist in a superposition of both states simultaneously.

$$|\psi\rangle = \alpha|0\rangle + \beta|1\rangle$$

Where:

  • $\alpha, \beta \in \mathbb{C}$ are complex numbers called probability amplitudes
  • $|\alpha|^2 + |\beta|^2 = 1$ — the normalization condition (total probability = 1)
📐 Column Vector Representation
$$|0\rangle = \begin{pmatrix} 1 \\ 0 \end{pmatrix}, \qquad |1\rangle = \begin{pmatrix} 0 \\ 1 \end{pmatrix}$$

Any qubit state can be written as: $|\psi\rangle = \begin{pmatrix} \alpha \\ \beta \end{pmatrix}$

02 What are Quantum Gates?
Property Classical Gates Quantum Gates
Reversibility Reversible or Irreversible Always Reversible
Operates on Classical bits Qubits
Representation Truth tables Unitary Matrices
Determinism Can be non-deterministic Always deterministic
KEY PROPERTY — Unitarity
$$U^\dagger U = UU^\dagger = I$$

Where $U^\dagger$ is the conjugate transpose (adjoint) of $U$, and $I$ is the identity matrix.

🔄
Reversible
Every gate has inverse
📏
Norm-Preserving
Output always valid
🎯
Deterministic
Same input → same output
03 Pauli-X Gate NOT Gate Bit Flip

The Pauli-X gate is the quantum equivalent of the classical NOT gate. It flips the state of a qubit: $|0\rangle \leftrightarrow |1\rangle$.

$$X = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}$$
Action on |0⟩
$$X|0\rangle = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}\begin{pmatrix} 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 1 \end{pmatrix} = |1\rangle$$
Action on |1⟩
$$X|1\rangle = \begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}\begin{pmatrix} 0 \\ 1 \end{pmatrix} = \begin{pmatrix} 1 \\ 0 \end{pmatrix} = |0\rangle$$
💡 Bloch Sphere: X gate rotates the state by 180° around the X-axis.
Self-inverse: $X^2 = I$, so $X^{-1} = X$
04 Pauli-Y Gate Bit + Phase Flip

The Pauli-Y gate combines a bit flip with a phase flip, introducing imaginary numbers.

$$Y = \begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}$$
Action on |0⟩
$$Y|0\rangle = i|1\rangle$$
Action on |1⟩
$$Y|1\rangle = -i|0\rangle$$
🎯 Bloch Sphere: Rotates by 180° around the Y-axis. Self-inverse: $Y^{-1} = Y$
05 Pauli-Z Gate Phase Flip

The Pauli-Z gate leaves $|0\rangle$ unchanged but flips the phase of $|1\rangle$ by multiplying it by $-1$.

$$Z = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}$$
Action on |0⟩
$$Z|0\rangle = |0\rangle \quad \text{(unchanged)}$$
Action on |1⟩
$$Z|1\rangle = -|1\rangle \quad \text{(phase flipped)}$$
⚠️ Important: Z does NOT change measurement probabilities!
$|\alpha|^2$ and $|\beta|^2$ remain the same — only the relative phase changes.
06 Hadamard Gate Most Important Superposition

The Hadamard gate is the most commonly used gate in quantum computing. It creates an equal superposition of $|0\rangle$ and $|1\rangle$.

$$H = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}$$
H|0⟩ = |+⟩
$$H|0\rangle = \frac{|0\rangle + |1\rangle}{\sqrt{2}} = |+\rangle$$
Equal superposition (positive phase)
H|1⟩ = |−⟩
$$H|1\rangle = \frac{|0\rangle - |1\rangle}{\sqrt{2}} = |-\rangle$$
Equal superposition (negative phase)
Key Properties of H Gate:
Property Expression
Self-inverse$H = H^\dagger = H^{-1}$
Double application$H^2 = I$
Conjugation: X → Z$HXH = Z$
Conjugation: Z → X$HZH = X$
Basis switchConverts between Z-basis and X-basis
💡 Bloch Sphere: H rotates 180° around the axis halfway between X and Z (the X+Z diagonal axis).
07 Phase Gates (S & T)
S Gate π/2 Phase
$$S = \begin{pmatrix} 1 & 0 \\ 0 & i \end{pmatrix}$$
$S|0\rangle = |0\rangle$
$S|1\rangle = i|1\rangle$
Key: $S^2 = Z$, $S^\dagger = \begin{pmatrix} 1 & 0 \\ 0 & -i \end{pmatrix}$
T Gate π/4 Phase
$$T = \begin{pmatrix} 1 & 0 \\ 0 & e^{i\pi/4} \end{pmatrix}$$
$T|0\rangle = |0\rangle$
$T|1\rangle = e^{i\pi/4}|1\rangle$
Key: $T^2 = S$, $T^4 = Z$
🔗 Phase Gate Hierarchy:
$$T \xrightarrow{T^2} S \xrightarrow{S^2} Z$$
Applying T twice gives S. Applying S twice gives Z. Applying T four times gives Z.
14 Rotation Gates (Rx, Ry, Rz)

Rotation gates allow arbitrary-angle rotations around each axis of the Bloch sphere. They are the most general single-qubit gates.

Rx(θ)
Around X-axis
$$\begin{pmatrix} \cos\frac{\theta}{2} & -i\sin\frac{\theta}{2} \\ -i\sin\frac{\theta}{2} & \cos\frac{\theta}{2} \end{pmatrix}$$
Ry(θ)
Around Y-axis
$$\begin{pmatrix} \cos\frac{\theta}{2} & -\sin\frac{\theta}{2} \\ \sin\frac{\theta}{2} & \cos\frac{\theta}{2} \end{pmatrix}$$
Rz(θ)
Around Z-axis
$$\begin{pmatrix} e^{-i\theta/2} & 0 \\ 0 & e^{i\theta/2} \end{pmatrix}$$
Special Cases:
Rotation Equivalent To Note
$R_x(\pi)$$X$ (with global phase)180° around X
$R_y(\pi)$$Y$ (with global phase)180° around Y
$R_z(\pi)$$Z$ (with global phase)180° around Z
$R_z(\pi/2)$$S$ (with global phase)90° around Z
$R_z(\pi/4)$$T$ (with global phase)45° around Z
08 Quick Reference Table
Gate Matrix Key Action Self-Inverse?
I $\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}$ Identity (nothing) ✅ Yes
X $\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix}$ Bit flip (NOT) ✅ Yes
Y $\begin{pmatrix} 0 & -i \\ i & 0 \end{pmatrix}$ Bit + Phase flip ✅ Yes
Z $\begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}$ Phase flip ✅ Yes
H $\frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}$ Superposition ✅ Yes
S $\begin{pmatrix} 1 & 0 \\ 0 & i \end{pmatrix}$ π/2 phase shift ❌ No ($S^\dagger$)
T $\begin{pmatrix} 1 & 0 \\ 0 & e^{i\pi/4} \end{pmatrix}$ π/4 phase shift ❌ No ($T^\dagger$)
09 Bloch Sphere Visualization

Every single-qubit state (up to a global phase) can be represented as a point on the Bloch Sphere:

$$|\psi\rangle = \cos\frac{\theta}{2}|0\rangle + e^{i\phi}\sin\frac{\theta}{2}|1\rangle$$
|0⟩ |1⟩ X Y |+⟩ |−⟩ |ψ⟩ θ
Parameter Range Description
θ $[0, \pi]$ Polar angle from Z-axis (|0⟩)
φ $[0, 2\pi)$ Azimuthal angle from X-axis in XY-plane
Key States on Bloch Sphere:
North Pole: $|0\rangle$ — θ=0
South Pole: $|1\rangle$ — θ=π
+X axis: $|+\rangle$ — θ=π/2, φ=0
−X axis: $|-\rangle$ — θ=π/2, φ=π
+Y axis: $|{+i}\rangle$ — θ=π/2, φ=π/2
−Y axis: $|{-i}\rangle$ — θ=π/2, φ=3π/2
Gate Rotation Axis Angle
XX-axis180° (π)
YY-axis180° (π)
ZZ-axis180° (π)
HX+Z diagonal axis180° (π)
SZ-axis90° (π/2)
TZ-axis45° (π/4)
10 Important Relationships to Remember
🔄 Inverse Gates
$X^{-1} = X$
$Y^{-1} = Y$
$Z^{-1} = Z$
$H^{-1} = H$
$S^{-1} = S^\dagger = \begin{pmatrix} 1 & 0 \\ 0 & -i \end{pmatrix}$
$T^{-1} = T^\dagger = \begin{pmatrix} 1 & 0 \\ 0 & e^{-i\pi/4} \end{pmatrix}$
🔗 Useful Identities
$HXH = Z$
$HZH = X$
$S^2 = Z$
$T^2 = S$
$T^4 = Z$
$H^2 = I$
✖️ Pauli Multiplication Rules
$$XY = iZ$$
$$YZ = iX$$
$$ZX = iY$$
⚠️ Note: $XY \neq YX$ — Pauli matrices do not commute! (anti-commutation: $\{X,Y\} = 0$)
11 Worked Example
❓ Problem: Apply H gate followed by Z gate to |0⟩
Step 1: Apply H to |0⟩
$$H|0\rangle = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix}\begin{pmatrix} 1 \\ 0 \end{pmatrix} = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 \\ 1 \end{pmatrix} = \frac{|0\rangle + |1\rangle}{\sqrt{2}} = |+\rangle$$
Step 2: Apply Z to the result
$$Z \cdot H|0\rangle = Z\left(\frac{|0\rangle + |1\rangle}{\sqrt{2}}\right) = \frac{Z|0\rangle + Z|1\rangle}{\sqrt{2}} = \frac{|0\rangle - |1\rangle}{\sqrt{2}} = |-\rangle$$
✅ Final Answer:
$$ZH|0\rangle = |-\rangle = \frac{|0\rangle - |1\rangle}{\sqrt{2}}$$
💡 Alternative: Using Matrix Multiplication
Combine into single matrix: $ZH = \begin{pmatrix} 1 & 0 \\ 0 & -1 \end{pmatrix}\frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ 1 & -1 \end{pmatrix} = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 1 \\ -1 & 1 \end{pmatrix}$
12 Key Takeaways
Single qubit gates = 2×2 unitary matrices. Every gate must satisfy $U^\dagger U = I$.
Pauli gates (X, Y, Z) are the fundamental building blocks — they rotate by 180° around their respective axes.
Hadamard (H) creates equal superposition — the most frequently used gate in quantum algorithms.
Phase gates (S, T) add relative phases between |0⟩ and |1⟩ without changing measurement probabilities.
Rotation gates (Rx, Ry, Rz) allow arbitrary-angle rotations — any single-qubit operation can be decomposed into these.
All quantum gates are reversible — this is a key difference from classical computing (e.g., NAND gate is not reversible).
Bloch sphere is the geometric tool to visualize single-qubit states and understand gate actions as rotations.
Global phases are physically irrelevant — only relative phases between |0⟩ and |1⟩ matter.
13 Common Exam Question Types
1 Matrix Multiplication

"Apply gate G to state |ψ⟩" → Write state as column vector, multiply by gate matrix.

💡 Tip: Always write the gate matrix on the LEFT, state vector on the RIGHT: G|ψ⟩
2 Sequential Gate Application

"What state results from applying H then X then Z to |0⟩?" → Multiply matrices right to left.

⚠️ Common mistake: For $G_3 G_2 G_1 |\psi\rangle$, multiply $G_3 \times G_2 \times G_1$ (right to left), NOT left to right!
3 Prove Unitarity

"Show that the Hadamard gate is unitary" → Compute $H^\dagger H$ and show it equals $I$.

💡 Tip: For real matrices, $U^\dagger = U^T$ (just transpose). For complex matrices, also conjugate each entry.
4 Gate Decomposition

"Express the S gate in terms of Z and T" → Use identities like $T^2 = S$ or $S^2 = Z$.

5 Bloch Sphere Analysis

"What rotation does the H gate perform?" → Identify the axis and angle of rotation on the Bloch sphere.

6 Measurement Probabilities

"What are the measurement probabilities after applying H to |0⟩?" → Square the absolute values of amplitudes.

💡 Example: $H|0\rangle = \frac{1}{\sqrt{2}}|0\rangle + \frac{1}{\sqrt{2}}|1\rangle$ → P(0) = $|\frac{1}{\sqrt{2}}|^2$ = 0.5, P(1) = $|\frac{1}{\sqrt{2}}|^2$ = 0.5
🌟 PRO TIP — Order of Matrix Multiplication

For a circuit: |0⟩ —[G₁]—[G₂]—[G₃]— |ψ⟩

The mathematical expression is: $|\psi\rangle = G_3 \cdot G_2 \cdot G_1 \cdot |0\rangle$

Think of it as: the rightmost gate acts first on the state, just like function composition: $f(g(h(x)))$ means h acts first.

No comments:

Post a Comment