1.16 - The Swap Test Quantum Circuit

The lecture slides are available here Download here.


The swap test circuit is introduced as a solution to the problem of determining the equality of two-qubit registers without disclosing their actual states. This circuit does not reveal the states but instead allows us to check for equality. Examples are used to illustrate its operation with both identical and different input states.

The result of the swap test is explained, where identical input states produce a ∣1⟩ outcome in the output register, while the probability of obtaining this outcome decreases as the input states become more dissimilar.

Lastly, the concept of fidelity is introduced, with the probability of a ∣1⟩ outcome serving as a measure of how similar the two input states are when the swap test is repeated multiple times.