Saved in:
Bibliographic Details
Main Author: Ohno, Hiroshi
Format: Preprint
Published: 2026
Subjects:
Online Access:https://arxiv.org/abs/2604.15867
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866914482768314368
author Ohno, Hiroshi
author_facet Ohno, Hiroshi
contents 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 show that, in the tested setting, the estimation error decreases as the vector dimension increases. We further illustrate a possible application to cosine-attention-based Transformer models. These results suggest that the angle-encoding Hadamard test may provide a useful design point for near-term similarity estimation when shallow circuit depth is preferred over compact qubit usage.
format Preprint
id arxiv_https___arxiv_org_abs_2604_15867
institution arXiv
publishDate 2026
record_format arxiv
spellingShingle Approximate Cosine Similarity Estimation via an Angle-Encoding Hadamard Test
Ohno, Hiroshi
Quantum Physics
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 show that, in the tested setting, the estimation error decreases as the vector dimension increases. We further illustrate a possible application to cosine-attention-based Transformer models. These results suggest that the angle-encoding Hadamard test may provide a useful design point for near-term similarity estimation when shallow circuit depth is preferred over compact qubit usage.
title Approximate Cosine Similarity Estimation via an Angle-Encoding Hadamard Test
topic Quantum Physics
url https://arxiv.org/abs/2604.15867