- Mathematics
- Also: Kronecker product
- Also: direct product
Tensor Product
The mathematical operation that combines two quantum systems into a joint system, mapping an m-dimensional and n-dimensional Hilbert space into an mn-dimensional composite space, used to describe multi-qubit states and compound quantum systems.
When two quantum systems are brought together, their joint state lives in a larger Hilbert space built by the tensor product. It explains why quantum computers with qubits have -dimensional state spaces, and why entanglement cannot be described by looking at subsystems individually.
Tensor product of vectors
For qubits , their tensor product is a vector in formed by multiplying every component of by the entire vector :
The two-qubit computational basis is , the four standard basis vectors of .
Tensor product of matrices (Kronecker product)
For matrices and , the Kronecker product is an matrix where each entry of is replaced by the block :
This is how gates on multi-qubit systems are constructed. The Hadamard gate acting only on qubit 1 of a two-qubit system, leaving qubit 2 alone, is:
Separable vs entangled states
A state is separable if ; measuring qubit 1 gives no information about qubit 2. The Bell state is entangled: attempting , , , yields inconsistent equations; no factored form exists.
Exponential growth of Hilbert space
With qubits the Hilbert space has dimension :
| Qubits | Dimension | Classical memory (64-bit) |
|---|---|---|
| 10 | 1,024 | 8 KB |
| 30 | ~1 billion | ~8 GB |
| 50 | ~ | ~8 petabytes |
Classical simulation of a general -qubit state requires exponential memory, the root of quantum computational advantage.
Code example
import numpy as np
# Single-qubit basis states
ket0 = np.array([1, 0])
ket1 = np.array([0, 1])
# Two-qubit state |01> = |0> tensor |1>
ket01 = np.kron(ket0, ket1)
print("|01> =", ket01) # [0, 1, 0, 0]
# Bell state |Phi+> = (|00> + |11>) / sqrt(2)
bell = (np.kron(ket0, ket0) + np.kron(ket1, ket1)) / np.sqrt(2)
print("|Phi+> =", bell)
# Gate on first qubit only: H tensor I
H = np.array([[1, 1], [1, -1]]) / np.sqrt(2)
I = np.eye(2)
H_on_first = np.kron(H, I)
print("\nH tensor I:\n", H_on_first)
# Apply to |00>: result is |+>|0> = [1,0,1,0]/sqrt(2)
ket00 = np.kron(ket0, ket0)
print("\n(H tensor I)|00> =", H_on_first @ ket00)