Member-only story
The Simplest Way to Compare Single-Qubit Quantum States
“Learning the quantum algorithm for state overlap” by Lukasz Cincio, Yiğit Subaşı, Andrew T. Sornborger, and Patrick J. Coles proposes a simplified circuit for comparing single-qubit quantum states as compared to the canonical SWAP Test. Whereas the SWAP Test requires two Hadamard gates, one Fredkin gate, and one measurement, this paper proposes using only one CNOT gate, one Hadamard gate, and two measurements. That’s a circuit depth of 14 (IBM Q Experience) versus a circuit depth of only 2.
However, in comparing the SWAP Test to this proposed alternative, I discovered that the proposed second measurement is unnecessary. By using only one CNOT gate, one Hadamard gate, and one measurement, the results can be interpreted just like the SWAP Test. For single-qubit comparisons, this eliminates the need for the complex classical post-processing that the authors suggest is necessary.
I borrowed some ideas from one of my previous articles, “Basis-Specific SWAP Test (Comparing Quantum States),” and ran some side-by-side comparisons.
Test 1
With the canonical SWAP Test, the ancilla qubit measures |0> with a probability of 1 when the states are identical and |0> with a probability of 0.5 when the states are maximally different.