Quantum computing is grounded in quantum mechanics, with mathematical foundations in Hilbert spaces, linear algebra, and unitary transformations. Below is a step-by-step mathematical explanation, including a proof of quantum advantage using the Deutsch-Jozsa algorithm.
1. Qubits and Quantum States
A classical bit is in state (0) or (1). A qubit (quantum bit) exists in a superposition of states, represented as a vector in a 2-dimensional complex Hilbert space (\mathbb{C}^2).
Mathematical Representation:
- Basis states: (|0\rangle = \begin{bmatrix} 1 \ 0 \end{bmatrix}), (|1\rangle = \begin{bmatrix} 0 \ 1 \end{bmatrix}).
- A qubit state is a linear combination:
[
|\psi\rangle = \alpha|0\rangle + \beta|1\rangle, \quad \alpha, \beta \in \mathbb{C}, \quad |\alpha|^2 + |\beta|^2 = 1.
]
((|\alpha|^2) and (|\beta|^2) are probabilities of measuring (|0\rangle) or (|1\rangle).)
2. Quantum Gates as Unitary Operators
Quantum operations are represented by unitary matrices (preserving the norm, hence reversibility). Key single-qubit gates:
Pauli-X Gate (analogous to classical NOT):
[
X = \begin{bmatrix} 0 & 1 \ 1 & 0 \end{bmatrix}, \quad X|0\rangle = |1\rangle, \quad X|1\rangle = |0\rangle.
]
Hadamard Gate (H) (creates superposition):
[
H = \frac{1}{\sqrt{2}} \begin{bmatrix} 1 & 1 \ 1 & -1 \end{bmatrix}, \quad H|0\rangle = \frac{|0\rangle + |1\rangle}{\sqrt{2}}, \quad H|1\rangle = \frac{|0\rangle - |1\rangle}{\sqrt{2}}.
]
CNOT Gate (entangles two qubits):
For a 2-qubit system, the CNOT gate flips the target qubit if the control qubit is (|1\rangle):
[
\text{CNOT} = \begin{bmatrix} 1 & 0 & 0 & 0 \ 0 & 1 & 0 & 0 \ 0 & 0 & 0 & 1 \ 0 & 0 & 1 & 0 \end{bmatrix}, \quad \text{CNOT}|x\rangle|y\rangle = |x\rangle|y \oplus x\rangle \quad (x, y \in {0,1}).
]
3. Entanglement: A Key Quantum Resource
A state is entangled if it cannot be written as a tensor product of individual qubit states. The Bell state (a maximally entangled state) is:
[
|\Phi^+\rangle = \frac{|00\rangle + |11\rangle}{\sqrt{2}}.
]
Proof of Entanglement:
Assume (|\Phi^+\rangle = (a|0\rangle + b|1\rangle) \otimes (c|0\rangle + d|1\rangle)). Expanding:
[
|\Phi^+\rangle = ac|00\rangle + ad|01\rangle + bc|10\rangle + bd|11\rangle.
]
Comparing with (|\Phi^+\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |11\rangle)), we get:
[
ac = \frac{1}{\sqrt{2}}, \quad ad = 0, \quad bc = 0, \quad bd = \frac{1}{\sqrt{2}}.
]
If (ad = 0), then (a=0) or (d=0). If (a=0), (ac=0 \neq \frac{1}{\sqrt{2}}). If (d=0), (bd=0 \neq \frac{1}{\sqrt{2}}). Contradiction. Hence, (|\Phi^+\rangle) is entangled.
4. Quantum Circuits and Measurement
A quantum circuit is a sequence of gates applied to qubits. Measurement collapses the state to a basis vector with probability (|\alpha|^2) or (|\beta|^2).
5. Proof of Quantum Advantage: Deutsch-Jozsa Algorithm
The Deutsch-Jozsa problem demonstrates quantum speedup:
- Input: A function (f: {0,1}^n \to {0,1}).
- Promise: (f) is either constant (all inputs map to the same value) or balanced (exactly half of inputs map to 0, half to 1).
- Task: Determine if (f) is constant or balanced.
Classical Complexity:
Classically, (2^{n-1} + 1) queries are needed to guarantee a correct answer (for (n)-bit inputs).
Quantum Complexity:
The Deutsch-Jozsa algorithm solves it with 1 query using quantum superposition and interference.
Step-by-Step Proof (for (n=1), the "Deutsch problem"):
Let (f: {0,1} \to {0,1}). We construct a quantum circuit to determine if (f) is constant or balanced.
Step 1: Initialize Qubits
Use 2 qubits:
- Input qubit (|x\rangle) (initialized to (|0\rangle)).
- Ancilla qubit (|y\rangle) (initialized to (|1\rangle)).
Initial state: (|0\rangle|1\rangle).
Step 2: Apply Hadamard Gates
Apply (H) to both qubits to create superposition:
[
H|0\rangle = \frac{|0\rangle + |1\rangle}{\sqrt{2}}, \quad H|1\rangle = \frac{|0\rangle - |1\rangle}{\sqrt{2}}.
]
State after (H):
[
|\psi_1\rangle = \frac{|0\rangle + |1\rangle}{\sqrt{2}} \otimes \frac{|0\rangle - |1\rangle}{\sqrt{2}} = \frac{|00\rangle - |01\rangle + |10\rangle - |11\rangle}{2}.
]
Step 3: Apply the Oracle (U_f)
The oracle (U_f) is a unitary gate that computes (f(x)):
[
U_f|x\rangle|y\rangle = |x\rangle|y \oplus f(x)\rangle \quad (\oplus = \text{XOR}).
]
Expand (|\psi_1\rangle) and apply (U_f):
[
|\psi_1\rangle = \frac{1}{2}\left(|00\rangle - |01\rangle + |10\rangle - |11\rangle\right).
]
Apply (U_f) to each term:
[
\begin{aligned}
U_f|00\rangle &= |0\rangle|0 \oplus f(0)\rangle = |0\rangle|f(0)\rangle, \
U_f|01\rangle &= |0\rangle|1 \oplus f(0)\rangle = |0\rangle|1 - f(0)\rangle, \
U_f|10\rangle &= |1\rangle|0 \oplus f(1)\rangle = |1\rangle|f(1)\rangle, \
U_f|11\rangle &= |1\rangle|1 \oplus f(1)\rangle = |1\rangle|1 - f(1)\rangle.
\end{aligned}
]
Substitute into (|\psi_1\rangle):
[
|\psi_2\rangle = \frac{1}{2}\left(|0\rangle|f(0)\rangle - |0\rangle|1 - f(0)\rangle + |1\rangle|f(1)\rangle - |1\rangle|1 - f(1)\rangle\right).
]
Step 4: Simplify for Constant vs. Balanced (f)
-
Case 1: (f) is constant (e.g., (f(0) = f(1) = c \in {0,1})):
[
|\psi_2\rangle = \frac{1}{2}\left(|0\rangle|c\rangle - |0\rangle|1 - c\rangle + |1\rangle|c\rangle - |1\rangle|1 - c\rangle\right).
]
Factor out (|0\rangle + |1\rangle):
[
|\psi_2\rangle = \frac{|0\rangle + |1\rangle}{\sqrt{2}} \otimes \frac{|c\rangle - |1 - c\rangle}{\sqrt{2}}.
]
-
Case 2: (f) is balanced (e.g., (f(0) = 0, f(1) = 1)):
[
|\psi_2\rangle = \frac{1}{2}\left(|0\rangle|0\rangle - |0\rangle|1\rangle + |1\rangle|1\rangle - |1\rangle|0\rangle\right) = \frac{|00\rangle - |01\rangle + |11\rangle - |10\rangle}{2}.
]
Factor:
[
|\psi_2\rangle = \frac{(|0\rangle - |1\rangle)}{\sqrt{2}} \otimes \frac{(|0\rangle - |1\rangle)}{\sqrt{2}}.
]
Step 5: Apply Hadamard to Input Qubit
Apply (H) to the input qubit (|x\rangle) (leaving the ancilla unmeasured):
-
Case 1 (Constant (f)):
The input qubit state is (\frac{|0\rangle + |1\rangle}{\sqrt{2}}). Applying (H):
[
H\left(\frac{|0\rangle + |1\rangle}{\sqrt{2}}\right) = |0\rangle.
]
Final state: (|0\rangle \otimes \frac{|c\rangle - |1 - c\rangle}{\sqrt{2}}). Measure (|x\rangle): Result is (0) with certainty.
-
Case 2 (Balanced (f)):
The input qubit state is (\frac{|0\rangle - |1\rangle}{\sqrt{2}}). Applying (H):
[
H\left(\frac{|0\rangle - |1\rangle}{\sqrt{2}}\right) = |1\rangle.
]
Final state: (|1\rangle \otimes \frac{|0\rangle - |1\rangle}{\sqrt{2}}). Measure (|x\rangle): Result is (1) with certainty.
Conclusion
By measuring the input qubit after the circuit, we determine (f)’s nature:
- If the result is (0), (f) is constant.
- If the result is (1), (f) is balanced.
This requires 1 quantum query vs. 2 classical queries (for (n=1)), proving quantum advantage. For (n)-bit inputs, the quantum algorithm uses (1) query vs. (2^{n-1} + 1) classical queries, demonstrating exponential speedup.
Summary: Quantum computing leverages superposition and entanglement to perform computations with mathematical representations in Hilbert spaces, unitary operators, and state vectors. The Deutsch-Jozsa algorithm provides a concrete proof of quantum advantage.