Approximate Cosine Similarity Estimation via an Angle-Encoding Hadamard Test
Hiroshi Ohno

TL;DR
This paper introduces an angle-encoding variant of the Hadamard test for estimating cosine similarity between vectors, emphasizing shallow circuit depth and analyzing its bias and accuracy.
Contribution
It proposes a parallelizable, shallow-depth quantum method for cosine similarity estimation using angle encoding, with bias analysis and practical insights.
Findings
Estimation error decreases with increasing vector dimension.
The bias of the estimator is non-negative under the approximation.
Potential application to cosine-attention in Transformer models.
Abstract
The Hadamard test is a standard quantum primitive for estimating inner products and expectation values, but in data-processing settings its practical utility is often limited by the cost of preparing amplitude-encoded quantum states. In this study, we investigate an angle-encoding variant of the Hadamard test for estimating cosine similarity between normalized real-valued vectors. The proposed method decomposes the similarity computation into elementwise two-qubit Hadamard-test circuits that can, in principle, be executed in parallel, resulting in constant circuit depth with respect to the vector dimension at the expense of a larger qubit footprint and classical post-processing. Because the resulting estimator is approximate, we analyze the induced bias and show that it is non-negative under the approximation used in our derivation. Numerical experiments on random normalized vectors…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
