The SWAP test #
The SWAP test estimates the overlap |<psi|phi>|^2 of two n-qubit states:
run the Hadamard test with the unitary that swaps the two registers
[BCWdW01, main.tex:291]. Measuring the control yields outcome 1 with
probability (1 - |<psi|phi>|^2)/2 [BCWdW01, main.tex:328].
The permutation of joint basis labels that exchanges two n-qubit registers.
Equations
- QuantumAlg.swapRegistersPerm n = (QuantumAlg.prodEquiv.symm.trans (Equiv.prodComm (Fin (2 ^ n)) (Fin (2 ^ n)))).trans QuantumAlg.prodEquiv
Instances For
The register-swap gate SWAP : Gate (n + n).
Instances For
The register swap exchanges tensor factors.
The SWAP test circuit: the Hadamard test of the register swap.