# SWAP Test for an Arbitrary Number of Quantum States

arXiv: https://arxiv.org/abs/2110.13261 · HTML: https://mlsanity.com/paper/2110.13261/

## Key facts

- Cited by 1 papers in the map (data through 14 Oct 2026).
- First posted on arXiv 25 Oct 2021.

## Built on by (most cited first, 1 of 1)

- [Accelerating the training of single-layer binary neural networks using the HHL quantum algorithm](https://mlsanity.com/paper/2210.12707/) (2022)

## Abstract (arXiv)

We develop a recursive algorithm to generalize the quantum SWAP test for an arbitrary number m of quantum states requiring O(m) controlled-swap (CSWAP) gates and O(log m) ancillary qubits. We construct a quantum circuit able to simultaneously measure overlaps of m arbitrary pure states. Our construction relies on a pairing unitary that generates a superposition state where every pair of input states is labelled by a basis state formed by the ancillaries.
