Comparing Entangled States

Brian N. Siegelwax
4 min readJul 19, 2020

The SWAP Test is used to compare quantum states. It is constructed out of a Fredkin gate (controlled-SWAP) sandwiched between two Hadamard gates. The control qubit and Hadamard gates are placed on an ancilla qubit, and the SWAP gates are placed on the qubits that you want to compare. You measure only the ancilla qubit.

Two identical states measure 0 with a probability of 1, and two maximally-different states measure 0 with a probability of 50%. All other results either show how close the states are by having a probability of measuring 0 that is closer to 1, or how different they are by having a probability of measuring 0 that is closer to one-half.

Read more:

The SWAP Test can also be used to compare entangled states. For purposes of this article, I’m just using the most basic GHZ states. If you have read the supplementary articles listed above, you’ll see that the approach is remarkably similar. You simply make a few adjustments to handle the additional qubits.

This SWAP Test compares the two most basic GHZ states: 000 and 111. The Hadamard gates and measurement are still on the ancilla qubit, but now there are three Fredkin gates. If you…

--

--