Skip to content
Tutorials Center
My learning

Topics

Lesson 15 of 39 ยท Entanglement

Entanglement Measures and GHZ States

Quantify entanglement with density matrices, partial trace, purity, the Schmidt decomposition and entanglement entropy, and compare GHZ and W states for three qubits using NumPy.

The previous lesson called Bell states "maximally entangled". How do we put numbers on entanglement? How do we handle systems with three or more qubits, where entanglement comes in different flavors? This lesson introduces density matrices, the partial trace, the Schmidt decomposition and entanglement entropy, and then compares the two classic three-qubit entangled states, GHZ and W.

Density matrices in one page

A state vector describes a pure state. When we ignore part of a system, or when we are unsure which state we have (classical uncertainty), we need the more general density matrix rho:

  • For a pure state, rho = |psi><psi| (an outer product).
  • For an ensemble that is |psi_k> with probability p_k, rho = sum of p_k |psi_k><psi_k|.
  • rho is Hermitian, has non-negative eigenvalues and trace 1.
  • The purity trace(rho^2) equals 1 for a pure state and is lower for a mixed state. For one qubit the lowest value is 1/2, the maximally mixed state I/2.

Expectation values and probabilities come out the same as before: P(outcome) = trace(projector * rho).

The partial trace

To describe qubit A of a two-qubit system alone, we trace out qubit B. For a state vector reshaped as a matrix M of shape (2, 2) (rows = A, columns = B), the reduced density matrix of A is rho_A = M Mโ€ , and for B it is rho_B = (Mโ€ M)^T. For larger systems you reshape to [2] * n, group the kept qubits into rows and the traced-out ones into columns, and do the same.

Python Reduced density matrix and purity

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

For the Bell pair, qubit 0 alone is I/2 with purity 1/2: completely random. For the product state, qubit 0 alone is the pure state |+><+|. A pure whole with a mixed part signals entanglement.

The Schmidt decomposition

Any pure state of two parts A and B can be written as

|psi> = sum over k of lambda_k |a_k> |b_k>

with non-negative numbers lambda_k (the Schmidt coefficients), orthonormal states |a_k> for A and |b_k> for B, and sum of lambda_k^2 = 1. The coefficients are the singular values of the amplitude matrix, so np.linalg.svd computes them directly.

  • One non-zero coefficient: a product state, no entanglement.
  • More than one: entangled. The number of non-zero values is the Schmidt rank.
  • Equal coefficients: maximal entanglement.

Entanglement entropy

The entanglement entropy turns the Schmidt coefficients into a single number. With p_k = lambda_k^2,

S = - sum of p_k log2(p_k)

It is 0 for a product state and log2(d) for a maximally entangled pair of d-level systems; for one qubit shared with another the maximum is 1 bit, reached by every Bell state.

Python Schmidt coefficients and entanglement entropy

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The partly entangled state has entropy about 0.469 bits: some entanglement, less than the Bell state's full 1 bit.

Three qubits: GHZ and W

With three or more qubits, entanglement has several inequivalent kinds. Two classic examples:

  • GHZ state: (|000> + |111>) / sqrt(2). All three qubits agree. It is "all or nothing": measuring any one qubit collapses the other two. Tracing out one qubit leaves them in a classical mix of |00> and |11>, completely unentangled. So GHZ entanglement is fragile: lose one qubit and the entanglement is gone.
  • W state: (|001> + |010> + |100>) / sqrt(3). Exactly one qubit is 1, in superposition over which. Losing one qubit leaves the other two still entangled. W entanglement is robust against loss.

Neither state can be turned into the other by local operations and classical communication, even with some probability of success: they belong to different entanglement classes.

Python GHZ versus W: what is left after losing a qubit?

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

GHZ gives negativity 0 for the remaining pair (no entanglement left), while W keeps a positive value (about 0.21 in this measure). One qubit of either state is entangled with the rest to a similar degree of entropy, yet the two kinds of entanglement behave very differently under loss.

The negativity (sum of the negative eigenvalues of the partially transposed density matrix) is only a witness, but for two qubits it is a complete test: it is zero exactly for states that can be written as mixtures of product states.

Why entropy matters beyond qubits

Entanglement entropy is also a central concept for estimating how hard it is to simulate a quantum system classically. States with small entanglement across every cut can be represented compactly (for example with matrix product states), so a circuit that creates little entanglement may be classically easy no matter how many qubits it uses. Highly entangled states are where quantum computers have room to outperform classical ones.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. What is the entanglement entropy of a product state?

    A product state has a single non-zero Schmidt coefficient (1), so S = 0.
  2. 2. What is the purity of qubit 0 of a Bell state?

    The reduced state is I/2, and trace((I/2)^2) = 1/2.
  3. 3. What happens to the entanglement of a GHZ state if one qubit is lost?

    Tracing out one qubit of GHZ leaves a classical mixture of |00> and |11>, with no entanglement.
  4. 4. Which tool in NumPy gives the Schmidt coefficients of a two-part pure state?

    The Schmidt coefficients are the singular values of the amplitude matrix reshaped across the cut.

Summary

  • Density matrices describe pure and mixed states; purity separates them.
  • Tracing out part of an entangled pure state leaves a mixed state.
  • Schmidt coefficients (singular values) quantify entanglement; entropy sums it up in one number.
  • GHZ entanglement is fragile; W entanglement survives the loss of a qubit.
  • Low entanglement often means a state is classically cheap to simulate.

Next: CHSH and Bell's Inequality