• 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 nn qubits have 2n2^n-dimensional state spaces, and why entanglement cannot be described by looking at subsystems individually.

Tensor product of vectors

For qubits a,bC2|a\rangle, |b\rangle \in \mathbb{C}^2, their tensor product ab|a\rangle \otimes |b\rangle is a vector in C4\mathbb{C}^4 formed by multiplying every component of a|a\rangle by the entire vector b|b\rangle:

ab=(a0a1)(b0b1)=(a0b0a0b1a1b0a1b1)|a\rangle \otimes |b\rangle = \begin{pmatrix} a_0 \\ a_1 \end{pmatrix} \otimes \begin{pmatrix} b_0 \\ b_1 \end{pmatrix} = \begin{pmatrix} a_0 b_0 \\ a_0 b_1 \\ a_1 b_0 \\ a_1 b_1 \end{pmatrix}

The two-qubit computational basis is {00,01,10,11}\{|00\rangle, |01\rangle, |10\rangle, |11\rangle\}, the four standard basis vectors of C4\mathbb{C}^4.

Tensor product of matrices (Kronecker product)

For matrices ACm×mA \in \mathbb{C}^{m\times m} and BCn×nB \in \mathbb{C}^{n\times n}, the Kronecker product ABA \otimes B is an mn×mnmn \times mn matrix where each entry aija_{ij} of AA is replaced by the block aijBa_{ij} B:

AB=(a00Ba01Ba10Ba11B)A \otimes B = \begin{pmatrix} a_{00}B & a_{01}B \\ a_{10}B & a_{11}B \end{pmatrix}

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:

HI=12(1010010110100101)H \otimes I = \frac{1}{\sqrt{2}}\begin{pmatrix} 1 & 0 & 1 & 0 \\ 0 & 1 & 0 & 1 \\ 1 & 0 & -1 & 0 \\ 0 & 1 & 0 & -1 \end{pmatrix}

Separable vs entangled states

A state is separable if ψ=αβ|\psi\rangle = |\alpha\rangle \otimes |\beta\rangle; measuring qubit 1 gives no information about qubit 2. The Bell state Φ+=12(00+11)|\Phi^+\rangle = \frac{1}{\sqrt{2}}(|00\rangle + |11\rangle) is entangled: attempting a0b0=12a_0 b_0 = \frac{1}{\sqrt{2}}, a0b1=0a_0 b_1 = 0, a1b0=0a_1 b_0 = 0, a1b1=12a_1 b_1 = \frac{1}{\sqrt{2}} yields inconsistent equations; no factored form exists.

Exponential growth of Hilbert space

With nn qubits the Hilbert space has dimension 2n2^n:

QubitsDimensionClassical memory (64-bit)
101,0248 KB
30~1 billion~8 GB
50~101510^{15}~8 petabytes

Classical simulation of a general nn-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)

See also