Quantum Computer Simulation of GHZ Experiment

Initializing live version
Download to Desktop

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

An entangled state of three photons in a superposition, either with all horizontally polarized () or with all vertically polarized (), is known as a Greenberger–Horne–Zeilinger (GHZ) state [1, 2]. It is represented by the state vector . A measurement on any one of the photons, using a two-channel polarizer, would give 50% probability for either or . Measurements on the other two photons would then be found to show the same polarization. In the canonical GHZ experiment, measurements are performed on the three entangled photons using two-channel polarizers , and set to orientations different from the original and , which we denote by and . The polarizations are at angles of with respect to the original polarizations, such that . The polarizations are left and right circular polarizations, represented by . The polarization detectors are set in one of four possible combinations: , , or . We use binary notation, 0 and 1, to label the two possible polarizations for either the or orientation. For the , or configuration, we observe four equally probable results, which we designate 001, 010, 001 and 111. For , we again observe four equally probable results, but now 000, 011, 101 or 110. In all of these cases, any two detector readings, say those of and , unambiguously determine the reading of . For example, for configuration , if the first two detectors read 01 or 10, the third would then show 0.


In this Demonstration, a GHZ experiment is simulated using a three-qubit quantum computer [3]. The GHZ state is produced by a circuit using one Hadamard () and two CNOT gates. The polarization detectors are simulated by a combination of and gates. The output state, for example, , implies that the final bit measurements give the results 001, 010, 100 and 111 with equal probability. Also shown is an illustration of Mermin's Gedankenexperiment [4], which is a simplification of the actual GHZ experiment. The results shown are those corresponding to local realism, with the selected "presets," which can be compared with the quantum-mechanics results.

The results of all reproducible experiments agree with the predictions of quantum mechanics and are contrary to those of local realism, which would entail the existence of hidden variables. According to local realism, each photon would be presumed to carry an "instruction set" that determines, in advance, its polarization in any or measurement. The result that any two readings unambiguously determine the third itself negates the possibility of local realism, since the third photon cannot "communicate" with the other two once they leave the source. The failure of local realism is shown in the references, using more tediously detailed arguments. In contrast to Bell's inequalities, in which this conclusion is reached by statistical analysis of a multitude of experimental results, the GHZ experiment requires only a single run.


Contributed by: S. M. Blinder (December 2017)
Open content licensed under CC BY-NC-SA



The Hadamard gate (not to be confused with the horizontal polarization, also called ) acts on a qubit in one of the basis states to produce a linear combination of the two basis states. Specifically and . As a unitary operator, . The -phase shift gate is represented by .


[1] D. M. Greenberger, M. A. Horne, A. Shimony and A. Zeilinger, "Bell's Theorem without Inequalities," American Journal of Physics, 58(12), 1990 pp. 1131–1143. doi:10.1119/1.16243.

[2] J.-W. Pan, D. Bouwmeester, M. Daniell, H. Weinfurter and A. Zeilinger, "Experimental Test of Quantum Nonlocality in Three-Photon Greenberger–Horne–Zeilinger Entanglement," Nature, 403, 2000 pp. 515–519. doi:10.1038/35000514.

[3] G. Fano and S. M. Blinder, Twenty-First Century Quantum Mechanics: Hilbert Space to Quantum Computers, New York: Springer, 2017.

[4] N. D. Mermin, "Quantum Mysteries Revisited," American Journal of Physics, 58(8), 1990 pp. 731–734. doi:10.1119/1.16503.

Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.