The Swap Test is a quantum computing technique used primarily to determine if two quantum states are the same or different. It's a non-destructive method that provides a way to quantify the similarity between two quantum states without collapsing them into classical bits. ### How It Works 1.
Articles by others on the same topic
The swap test estimates the overlap of two pure states without requiring their classical descriptions. Prepare an auxiliary qubit in , apply a Hadamard gate, a Fredkin gate controlled by that auxiliary qubit, and another Hadamard gate. Then measure the auxiliary qubit in the computational basis.
For target states , the auxiliary-zero branch has unnormalized target vector . Its squared norm is thereforeIdentical pure states give , while pure states with zero inner product give . A single zero outcome does not certify equality; repeated trials estimate the probability. The calculation is a direct projection onto the symmetric target subspace using the SWAP gate.