In 1999, Dik Bouwmeester, Jian-Wei Pan, Matthew Daniell, Harald Weinfurter and Anton Zeilinger reported the experimental observation of three-photon Greenberger-Horne-Zeilinger (GHZ) entanglement.
In this post, we use Python and QuTiP to build a simplified model of that experiment. The aim is not to create optimized simulation code, but to make the optical experiment tangible: create two entangled photon pairs, propagate them through the optical system, select the events in which all four detectors fire, and inspect the correlations between the remaining three photons.
The complete executable notebook is available on GitHub.
The Experiment
The optical setup follows the experiment reported by Bouwmeester et al. in Physical Review Letters 82, 1345 (1999).

Figure 1 — Optical setup used to create and detect three-photon GHZ entanglement. Image adapted in the original notebook from Bouwmeester et al.
The simulation represents eight optical channels. Rather than describing each photon as a qubit from the outset, we use Fock states: each channel can contain zero, one, or more photons. This is useful because beamsplitters and post-selection naturally act on photon-number states.
For eight channels, the combined state is a tensor product of the individual channel states. In the notebook each channel is allowed to contain up to four photons, giving a state space of 5⁸ = 390,625 components. That is larger than strictly necessary, but it makes the bookkeeping explicit.
Building The Optical System
The model implements the components of the experiment one by one:
- ordinary beamsplitters;
- polarizing beamsplitters;
- polarizers;
- half-wave plates;
- photon-number measurements in the eight output channels.
A 50:50 beamsplitter mixes two optical modes. In the notebook this transformation is constructed directly in the Fock basis and then embedded in the full eight-channel Hilbert space.

Figure 2 — The beamsplitter transformation used in the model. Image from the original notebook.
Before running the GHZ experiment, the notebook sends individual photons through the model and checks that they arrive at the expected detectors. These tests are useful because an error in channel ordering or polarization convention can otherwise remain hidden inside a large tensor-product calculation.
Creating Two Entangled Photon Pairs
The experiment starts with two entangled photon pairs. In the simulation we create the corresponding superposition in the eight-mode Fock basis and send it through the complete optical transformation.
The important step is post-selection. We retain only events in which four photons are detected by the four relevant detectors. One of those detections acts as a trigger; conditioned on that event, the other three photons can be left in a GHZ-type entangled state.
This is the key idea behind the experiment: the optical network does not simply manufacture a three-photon state deterministically. The detection pattern tells us when the desired state has been created.
Looking For GHZ Correlations
The notebook then reproduces the three measurement situations used to reveal the correlations. The polarizer in front of detector D1 is set to three different orientations:
- 0°: no correlation between D1 and D2 is expected;
- +45°: a strong correlation is expected;
- −45°: a strong anti-correlation is expected.
The simulation repeatedly measures the state and counts the corresponding detector combinations. Because these are quantum measurements, individual runs are random. The structure only becomes visible in the correlations accumulated over many runs.

Figure 3 — Correlations used to identify the three-photon GHZ state. Image from the original notebook.
That is also what makes the GHZ experiment interesting conceptually. Looking at one detector in isolation does not reveal the entanglement. The information is in the joint statistics of spatially separated measurements.
Why GHZ Entanglement Is Special
Bell experiments with two entangled particles reveal correlations that cannot be reproduced by a local hidden-variable theory. GHZ states take this one step further. With three entangled particles, quantum mechanics can be confronted with local-realistic predictions without relying only on a statistical Bell inequality.
The state is global: it cannot be decomposed into three independent photon states. Yet each local measurement still produces an apparently random result. Only when the results are compared does the underlying structure appear.
This makes the GHZ experiment a particularly clean illustration of what entanglement means. Quantum mechanics does not merely correlate three pre-existing local properties. It describes the three photons as one joint quantum state.
From Notebook To Experiment
The purpose of this model is not numerical efficiency. It is to expose the machinery behind the experiment. By explicitly constructing photon-number states, optical transformations, measurements and post-selection, we can follow how two entangled pairs are converted into the correlations associated with a three-photon GHZ state.
The full notebook contains the implementation, intermediate checks and measurement output. If you want to inspect or run the simulation yourself, it is available here:
View the complete GHZ notebook on GitHub
Reference
D. Bouwmeester, J.-W. Pan, M. Daniell, H. Weinfurter, and A. Zeilinger, “Observation of Three-Photon Greenberger-Horne-Zeilinger Entanglement,” Physical Review Letters 82, 1345 (1999).
Leave a Reply