|q⟩ Bad Qubits

intermediate · Physics · Hilbert Spaces & Dirac Formalism

Tensor-Product Spaces

A single qubit lives in C2\mathbb{C}^2. But quantum computing and most of physics involve many subsystems at once. The tensor product is the rule that combines the Hilbert spaces of individual parts into the Hilbert space of the whole — and it is where entanglement first appears.

Combining two systems

If system AA has Hilbert space HA\mathcal{H}_A and system BB has HB\mathcal{H}_B, the composite system ABAB has the tensor-product space

HAB=HAHB.\mathcal{H}_{AB} = \mathcal{H}_A \otimes \mathcal{H}_B.

Dimensions multiply: dim(HAHB)=dimHAdimHB\dim(\mathcal{H}_A \otimes \mathcal{H}_B) = \dim\mathcal{H}_A \cdot \dim\mathcal{H}_B. Two qubits therefore live in C2C2=C4\mathbb{C}^2 \otimes \mathbb{C}^2 = \mathbb{C}^4, and nn qubits in C2n\mathbb{C}^{2^n}. This exponential growth in dimension is the resource quantum computers exploit.

The product basis

If {iA}\{|i\rangle_A\} is a basis for HA\mathcal{H}_A and {jB}\{|j\rangle_B\} for HB\mathcal{H}_B, then the set of products {iAjB}\{|i\rangle_A \otimes |j\rangle_B\} is a basis for the composite space. For two qubits the four basis states are

00,    01,    10,    11,|0\rangle\otimes|0\rangle,\;\; |0\rangle\otimes|1\rangle,\;\; |1\rangle\otimes|0\rangle,\;\; |1\rangle\otimes|1\rangle,

written compactly as 00,01,10,11|00\rangle, |01\rangle, |10\rangle, |11\rangle. The leftmost label is qubit 0.

Tensor product of vectors (the Kronecker product)

On column vectors the tensor product is the Kronecker product: each entry of the first vector scales the entire second vector. For two qubits,

(a0a1)(b0b1)=(a0b0a0b1a1b0a1b1).\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 four entries are the amplitudes of 00,01,10,11|00\rangle, |01\rangle, |10\rangle, |11\rangle in that order.

Inner products factorize

The inner product on the composite space respects the factor structure:

(ab)(cd)=acbd.\big(\langle a|\otimes\langle b|\big)\big(|c\rangle\otimes|d\rangle\big) = \langle a|c\rangle\,\langle b|d\rangle.

So orthonormality of the factor bases gives orthonormality of the product basis, and norms multiply for product states.

Product states versus entangled states

A composite state is a product state if it factorizes as ψAϕB|\psi\rangle_A \otimes |\phi\rangle_B. Not every state does. The general two-qubit state

Ψ=c0000+c0101+c1010+c1111|\Psi\rangle = c_{00}|00\rangle + c_{01}|01\rangle + c_{10}|10\rangle + c_{11}|11\rangle

factorizes if and only if c00c11=c01c10c_{00}c_{11} = c_{01}c_{10}. When this condition fails, the state is entangled — it cannot be described as "qubit AA is in some state and qubit BB is in some state." The Bell state 12(00+11)\tfrac{1}{\sqrt{2}}(|00\rangle + |11\rangle) has c00c11=1/20=c01c10c_{00}c_{11} = 1/2 \ne 0 = c_{01}c_{10}, so it is entangled. Entanglement is impossible without the tensor-product structure.

Worked example

The state 0+|0\rangle \otimes |+\rangle leaves qubit 0 in 0|0\rangle and puts qubit 1 in +=12(0+1)|+\rangle = \tfrac{1}{\sqrt2}(|0\rangle + |1\rangle). Taking the Kronecker product,

(10)12(11)=12(1100)=12(00+01).\begin{pmatrix} 1 \\ 0 \end{pmatrix} \otimes \frac{1}{\sqrt2}\begin{pmatrix} 1 \\ 1 \end{pmatrix} = \frac{1}{\sqrt2}\begin{pmatrix} 1 \\ 1 \\ 0 \\ 0 \end{pmatrix} = \frac{1}{\sqrt2}\big(|00\rangle + |01\rangle\big).

This is a product state, prepared by applying HH to qubit 1 alone.

Try it

Prepare the product state 0+=12(00+01)|0\rangle \otimes |+\rangle = \tfrac{1}{\sqrt2}(|00\rangle + |01\rangle) on two qubits and return the circuit. The grader checks the full statevector.

Run your code to see the quantum state.

Sign in on the full site to ask questions and join the discussion.