Missing something?

Intro to Quantum Computing Cheatsheet

A comprehensive cheat sheet covering key concepts in quantum computing, including entanglement, quantum gates, algorithms, and the Bloch sphere.

Entanglement and Global Phase

Quantum Entanglement Basics

Definition: Entanglement is a quantum mechanical phenomenon in which the quantum states of two or more objects are linked together, even when the objects are separated by a large distance.

Key Properties:

  • Correlation: Measuring the state of one particle instantaneously influences the state of the other(s).
  • Non-Locality: This correlation occurs regardless of the distance separating the particles.

Mathematical Representation: A typical entangled state (Bell state) is represented as:
|\Phi^+\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |11\rangle)

Global Phase: A global phase is a complex number e^{i\theta} that multiplies an entire quantum state. It does not affect measurement probabilities, hence is physically irrelevant.

Example:
|\psi\rangle and e^{i\theta}|\psi\rangle represent the same physical state.

Importance: While global phase doesn’t affect single qubit measurements, relative phases between terms in a superposition are crucial for quantum interference and computation.

Pure vs. Mixed States

Pure State:

A qubit state that can be represented by a single point on the Bloch sphere.

Mixed State:

A statistical ensemble of pure states, represented by a density matrix. Lies inside the Bloch sphere.

Quantum Gates and Circuits

Single-Qubit Gates

Pauli Gates:

  • X (Bit-Flip): X = \begin{bmatrix} 0 & 1 \\ 1 & 0 \end{bmatrix}
  • Y: Y = \begin{bmatrix} 0 & -i \\ i & 0 \end{bmatrix}
  • Z (Phase-Flip): Z = \begin{bmatrix} 1 & 0 \\ 0 & -1 \end{bmatrix}

Hadamard Gate (H): Creates superposition.
H = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & 1 \\ 1 & -1 \end{bmatrix}

Phase Gate (S): Applies a phase of i to the |1\rangle state.
S = \begin{bmatrix} 1 & 0 \\ 0 & i \end{bmatrix}

T Gate: Applies a phase of e^{i\pi/4} to the |1\rangle state.
T = \begin{bmatrix} 1 & 0 \\ 0 & e^{i\pi/4} \end{bmatrix}

Two-Qubit Gates

CNOT (Controlled-NOT): Flips the target qubit if the control qubit is |1\rangle.
CNOT = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & 0 & 1 & 0 \end{bmatrix}

SWAP Gate: Swaps the states of two qubits.
SWAP = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 \end{bmatrix}

Quantum Entangling Circuits

Creating a Bell State:
Apply a Hadamard gate to the first qubit and then a CNOT gate with the first qubit as control and the second as target:

  1. Start with |00\rangle
  2. Apply H to the first qubit: \frac{1}{\sqrt{2}}(|00\rangle + |10\rangle)
  3. Apply CNOT: \frac{1}{\sqrt{2}}(|00\rangle + |11\rangle) = |\Phi^+\rangle

No-Cloning, Teleportation, Swapping

No-Cloning Theorem

Statement: It is impossible to create an identical copy of an arbitrary unknown quantum state.

Implication: Prevents perfect copying of quantum information, which is crucial for quantum cryptography.

Quantum Teleportation

Process: Transferring a quantum state from one location to another using entanglement and classical communication.

Steps:

  1. Alice and Bob share an entangled pair.
  2. Alice performs a Bell measurement on her qubit and the qubit to be teleported.
  3. Alice sends the classical measurement results to Bob.
  4. Bob applies appropriate quantum gates based on Alice’s message to reconstruct the original qubit.

Key Points:

  • The original qubit’s state is destroyed at Alice’s location.
  • No information is transferred faster than light (classical communication is required).
  • Requires pre-shared entanglement.

Entanglement Swapping

Definition: A process by which two qubits that do not initially share entanglement can become entangled.

Process:

  1. Alice and Bob each share an entangled pair with a third party (e.g., Charlie and David, respectively).
  2. Charlie and David perform a Bell measurement on their qubits.
  3. Alice and Bob’s qubits become entangled as a result of this measurement.

Use-case: Can extend quantum communication distances by creating entanglement between distant qubits.

Quantum Algorithms

Deutsch Algorithm

Purpose: Determines whether a function f(x) is constant or balanced.

Algorithm:

  1. Prepare the state \frac{1}{2}(|0\rangle - |1\rangle)|0\rangle.
  2. Apply the quantum oracle U_f.
  3. Apply a Hadamard gate to the first qubit.
  4. Measure the first qubit. If the result is |0\rangle, the function is constant; if |1\rangle, it’s balanced.

Quantum Oracle: A black box that implements the function f(x).
U_f|x\rangle|y\rangle = |x\rangle|y \oplus f(x)\rangle

Advantage: Solves the problem with one query to the function, while a classical algorithm requires two.

Grover's Algorithm

Purpose: Searches an unsorted database of N items in O(\sqrt{N}) time.

Algorithm:

  1. Prepare an equal superposition of all states: |s\rangle = \frac{1}{\sqrt{N}} \sum_{x=0}^{N-1} |x\rangle.
  2. Apply the Grover iteration R approximately \sqrt{N} times.
  3. Measure the state to obtain the solution with high probability.

Grover Iteration: R = -H U_0 H U_f, where:

  • H is the Hadamard gate.
  • U_0 is the inversion about the mean.
  • U_f is the oracle that marks the solution.

Advantage: Provides a quadratic speedup over classical search algorithms.

Quantum Fourier Transform (QFT)

Definition: A quantum version of the Discrete Fourier Transform (DFT).

N-th Root of Unity: \omega_N = e^{2\pi i / N}

QFT Transformation:
|x\rangle \rightarrow \frac{1}{\sqrt{N}} \sum_{k=0}^{N-1} e^{2\pi i x k / N} |k\rangle

Applications: Used in Shor’s algorithm for factoring and in quantum phase estimation.

Bloch Sphere

Bloch Sphere Representation

Definition: A geometrical representation of a qubit’s state as a point on the surface of a unit sphere.

General Qubit State:
|\psi\rangle = \cos(\frac{\theta}{2})|0\rangle + e^{i\phi} \sin(\frac{\theta}{2})|1\rangle

Coordinates:

  • \theta: Angle from the north pole (\left|0\right\rangle state).
  • \phi: Angle in the xy-plane.

Mapping to Sphere:
The qubit state maps to a point on the sphere with coordinates (\sin\theta \cos\phi, \sin\theta \sin\phi, \cos\theta).

Visualizing Gates on the Bloch Sphere

X Gate: Rotation by \pi around the x-axis.

Y Gate: Rotation by \pi around the y-axis.

Z Gate: Rotation by \pi around the z-axis.

Hadamard Gate: Rotation that maps |0\rangle to \frac{|0\rangle + |1\rangle}{\sqrt{2}} and |1\rangle to \frac{|0\rangle - |1\rangle}{\sqrt{2}}.