Skip to content

Instantly share code, notes, and snippets.

@NotAProton
Created November 30, 2024 00:24
Show Gist options
  • Save NotAProton/f3fc77ef2b2b17e375440a4e7337393b to your computer and use it in GitHub Desktop.
Save NotAProton/f3fc77ef2b2b17e375440a4e7337393b to your computer and use it in GitHub Desktop.

Quantum Computing Revision Sheet

image

Fundamental Notation and Concepts

Qubit Representation

  • A qubit can be represented in the Dirac (Bra-Ket) notation as a linear combination of basis states: $|\psi\rangle = \alpha|0\rangle + \beta|1\rangle$ Where $\alpha$ and $\beta$ are complex numbers satisfying $|\alpha|^2 + |\beta|^2 = 1$

Basis States

$$|0\rangle = \begin{bmatrix} 1 \\ 0 \end{bmatrix} |1\rangle = \begin{bmatrix} 0 \\ 1 \end{bmatrix}$$

Quantum Gates

Pauli Gates

X Gate (NOT Gate)

  • Matrix Representation:
$$X = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}$$
  • Key Properties:
    • $X|0\rangle = |1\rangle$
    • $X|1\rangle = |0\rangle$
    • Equivalent to classical NOT gate
    • Rotates the qubit state by $\pi$ radians around the X-axis

Z Gate

  • Matrix Representation:
$$Z = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}$$
  • Key Properties:
    • $Z|0\rangle = |0\rangle$
    • $Z|1\rangle = -|1\rangle$
    • Rotates the qubit state by $\pi$ radians around the Z-axis

Multi-Qubit Gates

CNOT (Controlled-NOT) Gate

  • Full Matrix Representation (4x4 Matrix for Two-Qubit System):
$$CNOT = \begin{bmatrix} 1 & 0 & 0 & 0 \\\ 0 & 1 & 0 & 0 \\\ 0 & 0 & 0 & 1 \\\ 0 & 0 & 1 & 0 \end{bmatrix}\$$$
  • Alternative Names:

    • Controlled-X Gate
    • Toffoli Gate (when generalized to multiple control qubits)
  • Truth Table:

    Control | Target | Result
    ----------------------------
      0     |   0    |   0
      0     |   1    |   1
      1     |   0    |   1
      1     |   1    |   0
    
  • Flips the target qubit only if the control qubit is in state $|1\rangle$

Hadamard Gate

Theoretical Foundation

The Hadamard gate is a fundamental quantum gate that creates superposition, transforming basis states into equal superpositions of $|0\rangle$ and $|1\rangle$.

Matrix Representation

$$H = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & 1 \\\ 1 & -1 \end{bmatrix}\$$$

Key Operations

  1. On Basis States:
    • $H|0\rangle = \frac{1}{\sqrt{2}}(|0\rangle + |1\rangle)$
    • $H|1\rangle = \frac{1}{\sqrt{2}}(|0\rangle - |1\rangle)$

Useful Properties

  • Creates equal probability of measuring $|0\rangle$ or $|1\rangle$
  • Reversible: $H \cdot H = I$ (Identity matrix)
  • Essential for quantum algorithms like quantum Fourier transform
  • Crucial in creating quantum superposition

Geometric Interpretation

  • Rotates the qubit state by $\pi$ radians around the X+Z axis of the Bloch sphere
  • Transforms pure basis states into equal superposition states

Practical Significance

  • Used in quantum circuit initialization
  • Critical for quantum algorithms like Deutsch-Jozsa and Grover's algorithm
  • Enables quantum parallelism by creating superposition states

Expanded Quantum Gate Insights

Superposition Creation

The Hadamard gate demonstrates the quantum mechanical principle of superposition:

  • Classical bits are either 0 or 1
  • Quantum bits can be in a probabilistic combination of $|0\rangle$ and $|1\rangle$
  • Measurement collapses the superposition to a definite state

Computational Implications

  • Allows quantum computers to explore multiple computational paths simultaneously
  • Enables quantum parallelism
  • Fundamental to quantum algorithmic speedup

Pro Tip: Think of the Hadamard gate as a quantum "coin flip" that puts a qubit into a perfectly balanced superposition state.

Practical Notes

  • Always apply the Hadamard gate carefully
  • Understand its effect on quantum state probabilities
  • Recognize its role in creating quantum computational advantage

Recommended Mental Exercise: Try to visualize how the Hadamard gate transforms $|0\rangle$ to an equal superposition. How does this differ from classical bit manipulation?

Bell States

Definition

Bell states are maximally entangled two-qubit states:

  1. $|\Phi^+\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |11\rangle)$
  2. $|\Phi^-\rangle = \frac{1}{\sqrt{2}}(|00\rangle - |11\rangle)$
  3. $|\Psi^+\rangle = \frac{1}{\sqrt{2}}(|01\rangle + |10\rangle)$
  4. $|\Psi^-\rangle = \frac{1}{\sqrt{2}}(|01\rangle - |10\rangle)$

Key Characteristics

  • Represent the four maximally entangled two-qubit states
  • Symmetric superpositions
  • Each state has equal probability of measuring $|0\rangle$ or $|1\rangle$

Useful Quantum Computing Relationships

Measurement Probabilities

  • For a qubit $|\psi\rangle = \alpha|0\rangle + \beta|1\rangle$:
    • Probability of measuring $|0\rangle$: $|\alpha|^2$
    • Probability of measuring $|1\rangle$: $|\beta|^2$

Gate Composition

  • Quantum gates are reversible
  • Most quantum gates are unitary matrices
  • Composition of quantum gates is done through matrix multiplication

Pro Tips for Quantum Computing

  • Always normalize your qubit states
  • Remember that quantum measurements collapse the quantum state
  • Understand the difference between quantum and classical bit manipulation

Note: This revision sheet provides a high-level overview. Always supplement with detailed textbook study and practical problem-solving.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment