Quantum k-Means Clustering Using Hadamard-Test-Based Similarity Estimation
Abstract
1. Introduction
- Quantum Addition-Based Method: This approach simulates the classical subroutine in the quantum setting using quantum addition. Specifically, we employ a version of quantum Fourier transform (QFT)-based addition [12] to compute elements of the Euclidean distance.
- Rotational-Difference Similarity Method Using the Hadamard Test: This method leverages the Hadamard test [13] to compute a rotation-parameter difference between encoded data points using parameterized rotation gates. The resulting quantity serves as a similarity score, which is then transformed into a heuristic dissimilarity measure. We also introduce a tailored subroutine for the Hadamard test adapted to this setting. In this approach, record and centroid information are encoded into qubit rotations, allowing the circuit output to capture their relative relationship through rotation-based transformations and quantum state overlap.
- We propose a hybrid quantum–classical clustering algorithm inspired by k-means, where the assignment step is guided by a rotational-difference similarity estimated via the Hadamard test. This similarity measure is heuristic in nature, depends on the difference between encoded rotation parameters, and provides an alternative to conventional distance computations.
- We consider a QFT-based method of computing Euclidean distances in a hybrid quantum k-means scheme, along with its empirical and structural assessment, demonstrating its weaknesses in terms of clustering with the fixed-point representation and NISQ settings.
- We demonstrate through empirical evaluation that the proposed Hadamard-test-based method achieves performance comparable to classical approaches, while offering a framework that can be implemented on near-term quantum devices.
2. Related Work
2.1. K-Means Algorithm
| Algorithm 1 Classical k-means algorithm [11] |
|
2.2. Related Quantum Clustering Algorithms
- Constant-Depth Quantum Interference Circuit: This method uses quantum interference to compute the angles between a data point and cluster centers, grouping the samples based on the interference patterns obtained. Using amplitude encoding, the process gets an exponential speed-up, but can only be applied to datasets where angles matter.
- Negative Rotations Method: The method provides a mapping that correlates the cosine similarity of the vectors and the probability of getting the state using the negative rotation gates. This way, one can build very shallow quantum circuits. However, scalability becomes problematic since many qubits are needed.
- Destructive Interference Probabilities: In this case, the algorithm uses destructive interference for measuring the Euclidean distance between the vectors.
3. Our Implementation of Quantum k-Means
- Initialize qubits in .
- Apply the unitary , where consists of:
- to set amplitudes and ,
- to apply the phase to .
3.1. Quantum Addition
| Algorithm 2 Quantum Addition using QFT |
|
- Encoding: We encode into a quantum register using basis encoding, where represents the binary form of an integer. Since is typically a real-valued number, it is first converted to a fixed-point integer via scaling: To support negative values, is represented using n-bit two’s complement encoding, such that . The resulting bitstring is then basis-encoded by applying X gates to qubits corresponding to bits with value 1.The parameter f determines the precision with which floating-point values are represented as fixed-point integers. Increasing f allows a more accurate representation of real numbers by reducing discretization error. Specifically, the smallest representable increment becomes . For example, when , values are represented in steps of , whereas for , the resolution improves to . This increased precision leads to more accurate distance estimates. However, as f is increased, the scale integer value increases in size. Therefore, more bits are required to represent each value, which equates to the use of more qubits in the quantum register. As the complexity of QFT-based arithmetic circuits depends on the size of the register, as f increases, the circuit depth increases. Deep circuits are susceptible to noise and gate errors.The numerical value of f is specified later in the Section 4.3. After converting floating-point inputs to fixed-point integers using this scaling, the required integer bit width n is determined based on the maximum magnitude of the scaled dataset to avoid overflow.
- Subtraction: Using a QFT-based approach (Algorithm 2 as proposed in [18]), we subtract from . First, is transformed into the Fourier domain via QFT [30]. Then, phase rotations are applied with angles , where is the j-th bit of (classical). These negative phases, unlike the positive used for addition, decrease the phase, yielding . An returns . The subtraction is performed using QFT-based arithmetic, which operates inherently over modular arithmetic in . As a consequence, subtraction naturally produces results modulo . When , the subtraction results inwhich corresponds to the standard two’s complement representation of negative numbers under modular arithmetic. Therefore, under the two’s complement representation, signed values are correctly produced via modular wraparound. The most significant bit is interpreted as a sign bit under the assumption that intermediate results satisfyso that no modular overflow occurs and two’s complement interpretation remains valid. In practice, n is selected based on the maximum possible scaled value of the dataset to ensure that subtraction results remain within the valid signed range.
- Squaring and Summation: Since the multiplication module operates on unsigned values, the result of the subtraction must be converted to its absolute value before squaring. We achieve this by using the most significant bit as a sign qubit.In case of a negative result, the magnitude register is conditionally inverted using CX gates. In particular, CX gates are performed starting from the sign qubit and directed toward each qubit from the magnitude register, so that the entire register flips whenever the sign qubit takes on the value 1; if not, nothing changes. Then, a controlled increment is applied to complete the two’s-complement transformation. This is implemented by using a controlled version of our QFT-based adder, where multi-controlled phase (MCP) gates replace standard controlled phase (CP) gates, and the sign qubit is used as an additional control. For each dimension, we compute using a QFT-based method. We use the register produced in the last step. We then copy this value to another register to preserve it and compute the square by performing QFT-based multiplication of the register with its copy. A known risk in QFT arithmetic is catastrophic wraparound. In order to prevent any corruption of the distance calculation, the square differences must be kept in an extended accumulation register of size e. For correctness, the accumulation register size must fulfill:This condition ensures that the global accumulation register never exceeds its representable range, thereby preventing modular overflow from resetting large distances to small values.In practice, the register width is selected dynamically based on the maximum possible squared difference implied by the dataset. Finally, this squared result is added to a global accumulation register using QFT-based addition. This process is repeated for each input dimension, iteratively building the total sum . Steps of multiplication are shown in Algorithm 3.
- Measurement: Measurement of the register representing the conclusion sum is performed on the computational basis. Further, the classical output string thus obtained is rescaled by performing division with respect to (where f is the number of fraction bits used in the fixed point encoding) to calculate the squared Euclidean distance. Finally, the Euclidean distance is computed using .
| Algorithm 3 QFT-based Multiplication via Shift-Add Method |
|
| Algorithm 4 Quantum k-Means Clustering using QFT-based Distance Estimation |
| Require: Dataset , number of clusters k, precision parameter f Ensure: Cluster assignments C, final centroids
|
3.2. Rotational-Difference Dissimilarity Based on the Hadamard Test
- Procedure for Real Part:
- Start with a two-register state: .
- Apply Q to the second register conditioned on the first qubit being , resulting in the state .
- Apply a Hadamard gate to the first qubit, yielding a superposition that, upon measurement, produces outcomes .
- Measure the first qubit: output 1 if the result is , and if the result is . The expectation of this random variable is .
| Algorithm 5 Rotational-Difference Quantum Heuristic Dissimilarity Measure |
| Require: Classical vectors , Number of shots S Ensure: Estimated quantum dissimilarity score D between and
|
4. Results
4.1. Dataset Description:
- Blobs: Synthetic data set with isotropic Gaussian blobs, which is used for evaluating clustering algorithms.
- Moons: Synthetic data set containing two interleaved half-circles, often used to test nonlinear classifiers or clustering techniques.
- Iris: A real-world dataset of flower measurements from three iris species, commonly used for classification tasks.
- Wine: A dataset with chemical analysis of wines from three cultivars, used for classification and feature selection.
- Breast Cancer Wisconsin: A medical imaging–based dataset containing numerical features extracted from breast tissue biopsies. It is used for binary classification to distinguish malignant tumours from benign ones.
4.2. Evaluation Metrics
- Folkes and Mallows Coefficient (FMI): Measures similarity between clusters and ground truth by computing the geometric mean of precision and recall for pairs [36].
- Sum of Squared Errors (SSE): Quantifies cohesion as the sum of squared distances from each point to its cluster centroid, also known as SSW [36].
- Silhouette Coefficient (Sil): Combines cohesion and separation by measuring how similar an object is to its cluster compared to other clusters [36].
- Rand Index (RI): Measures the similarity between two partitions by computing the proportion of point pairs that are either clustered together or separately in both partitions [33].
- Adjusted Rand Index (ARI): Quantifies the similarity between two clusterings by correcting the Rand Index for chance agreement, resulting in a score that ranges from (complete disagreement) to 1 (perfect agreement) [32].
- Normalized Mutual Information (NMI): Measures the statistical dependency between cluster assignments, normalized to account for differences in entropy, with values ranging from 0 (no mutual information) to 1 (perfect match) [34].
- Davies–Bouldin Index (DBI): Evaluates clustering quality based on intra-cluster compactness and inter-cluster separation; lower values indicate better-defined clusters [35].
- Homogeneity: A clustering satisfies homogeneity if all clusters contain only data points from a single class [31].
- Completeness: A clustering satisfies completeness if all the data points of a given class are assigned to the same cluster [31].
- Accuracy: Accuracy measures the overall proportion of correctly classified instances [37]:
- Precision: Precision evaluates the correctness of positive predictions [37]:
- Recall (Sensitivity): Recall measures the ability of the model to identify all relevant instances of a class [37]:
- F1-Score The F1-score is the harmonic mean of precision and recall [37]:
- True Positive (TP): The number of instances correctly assigned to a given class.
- False Positive (FP): The number of instances incorrectly assigned to a given class.
- False Negative (FN): The number of instances of a given class that are incorrectly assigned to other classes.
- True Negative (TN): The number of instances that do not belong to a given class and are also not assigned to that class.
- N-ITE: The actual number of iterations k-means performs to converge.
4.3. Implementation Details
- thresh: The stopping condition of the algorithm. Defined as the maximum difference between cluster centres in two consecutive iterations, measured by the Frobenius norm, at which the algorithm is considered to have converged.
- maxite: The maximum number of iterations the algorithm can perform.
- shots: The number of times the quantum circuit is executed.
- optimization-level: The level at which the simulator optimizes the quantum circuit.
- Standardization: Adjusts each feature so that it has a mean of zero and a standard deviation of one.
- Normalization: Rescales values either into a fixed range or such that each vector has a unit length. Of all the normalization techniques to be used, the and norms are evaluated. In this case, the -norm technique is chosen, where the data is scaled according to the maximum absolute values in each observation. This is performed because normalization works effectively within the framework of this particular encoding mechanism, as it ensures that all values are within a specified range suitable for rotation-based encoding.
4.4. Evaluation
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Abbreviations
| -means | Quantum k-means |
| Quantum clustering | |
| K | Classical k-means clustering |
| K-N | Classical k-means with proposed dissimilarity |
| -H | Quantum k-means using Hadamard test |
| -H-32 | QK-H with 32 shots |
| -QFT | Quantum k-means using QFT-based distance |
| QML | Quantum machine learning |
| QFT | Quantum Fourier transform |
| QRAM | Quantum random access memory |
| FF-QRAM | Flip-flop quantum random access memory |
| QAOA | Quantum approximate optimization algorithm |
| QIGA | Quantum-inspired genetic algorithm |
| NISQ | Noisy intermediate-scale quantum |
| SSE (SSW) | Sum of squared errors |
| FMI | Fowlkes–Mallows index |
| SIL | Silhouette coefficient |
| RI | Rand index |
| ARI | Adjusted Rand index |
| NMI | Normalized mutual information |
| DBI | Davies–Bouldin index |
| TP | True positive |
| TN | True negative |
| FP | False positive |
| FN | False negative |
| N-ITE | Number of iterations to convergence |
| PCA | Principal component analysis |
| QUBO | Quadratic unconstrained binary optimization |
| IRIS | Iris dataset |
| WINE | Wine dataset |
| BCW | Breast Cancer Wisconsin |
| BLOBS | BLOBS dataset |
| MOONS | Two-moons dataset |
| NOISY IRIS | Iris dataset with noise |
References
- Markov, I.L. Limits on Fundamental Limits to Computation. Nature 2014, 512, 147–154. [Google Scholar] [CrossRef]
- Biamonte, J.; Wittek, P.; Pancotti, N.; Rebentrost, P.; Wiebe, N.; Lloyd, S. Quantum machine learning. Nature 2017, 549, 195–202. [Google Scholar] [CrossRef]
- Lloyd, S.; Mohseni, M.; Rebentrost, P. Quantum principal component analysis. Nat. Phys. 2014, 10, 631–633. [Google Scholar] [CrossRef]
- Wang, G. Quantum algorithm for linear regression. Phys. Rev. A 2017, 96, 012335. [Google Scholar] [CrossRef]
- Abbas, A.; Sutter, D.; Zoufal, C.; Lucchi, A.; Figalli, A.; Woerner, S. The power of quantum neural networks. Nat. Comput. Sci. 2021, 1, 403–409. [Google Scholar] [CrossRef] [PubMed]
- Kopczyk, D. Quantum machine learning for data scientists. arXiv 2018, arXiv:1804.10068. [Google Scholar] [CrossRef]
- Kerenidis, I.; Landman, J.; Luongo, A.; Prakash, A. q-means: A quantum algorithm for unsupervised machine learning. In Proceedings of the 2019 Advances in Neural Information Processing Systems, Vancouver, BC, Canada, 8–14 December 2019. [Google Scholar]
- Poggiali, A.; Berti, A.; Bernasconi, A.; Del Corso, G.M.; Guidotti, R. Clustering Classical Data with Quantum k-Means. In Proceedings of the ICTCS, Rome, Italy, 7–9 September 2022; pp. 188–200. [Google Scholar]
- Preskill, J. Quantum Computing in the NISQ era and beyond. Quantum 2018, 2, 79. [Google Scholar] [CrossRef]
- Dasgupta, S. The Hardness of k-Means Clustering; Technical Report CS2007-0890; University of California: San Diego, CA, USA, 2008. [Google Scholar]
- Lloyd, S. Least squares quantization in PCM. IEEE Trans. Inf. Theory 1982, 28, 129–137. [Google Scholar] [CrossRef]
- Draper, T.G. Addition on a Quantum Computer. arXiv 2000, arXiv:quant-ph/0008033. [Google Scholar] [CrossRef]
- Aharonov, D.; Jones, V.; Landau, Z. A polynomial quantum algorithm for approximating the Jones polynomial. In Proceedings of the Thirty-Eighth Annual ACM Symposium on Theory of Computing, Seattle, WA, USA, 21–23 May 2006; pp. 427–436. [Google Scholar]
- Horn, D.; Gottlieb, A. Algorithm for data clustering in pattern recognition problems based on quantum mechanics. Phys. Rev. Lett. 2001, 88, 018702. [Google Scholar] [CrossRef]
- Wittek, P. Quantum Machine Learning: What Quantum Computing Means to Data Mining; Academic Press: Cambridge, MA, USA, 2014. [Google Scholar]
- Arthur, D.; Vassilvitskii, S. k-means++: The Advantages of Careful Seeding; Technical Report; Stanford University: Standford, CA, USA, 2006. [Google Scholar]
- Otterbach, J.S.; Manenti, R.; Alidoust, N.; Bestwick, A.; Block, M.; Bloom, B.; Caldwell, S.; Didier, N.; Fried, E.S.; Hong, S.; et al. Unsupervised machine learning on a hybrid quantum computer. arXiv 2017, arXiv:1712.05771. [Google Scholar] [CrossRef]
- Farhi, E.; Goldstone, J.; Gutmann, S. A quantum approximate optimization algorithm. arXiv 2014, arXiv:1411.4028. [Google Scholar] [CrossRef]
- Khan, S.U.; Awan, A.J.; Vall-Llosera, G. K-means clustering on noisy intermediate scale quantum computers. arXiv 2019, arXiv:1909.12183. [Google Scholar] [CrossRef]
- Bui, D.; Halunen, K. Nisq quantum algorithm for k-means clustering. In Proceedings of the 40th ACM/SIGAPP Symposium on Applied Computing, Sicily, Italy, 31 March–4 April 2025; pp. 1449–1456. [Google Scholar]
- Xiao, J.; Yan, Y.; Zhang, J.; Tang, Y. A quantum-inspired genetic algorithm for k-means clustering. Expert Syst. Appl. 2010, 37, 4966–4973. [Google Scholar] [CrossRef]
- Arthur, D.; Date, P. Balanced k-means clustering on an adiabatic quantum computer. Quant. Inf. Process. 2021, 20, 294. [Google Scholar] [CrossRef]
- Aggoune, R.; Deleplanque, S. A Quantum Annealing Solution to the Job Shop Scheduling Problem. In Proceedings of the International Conference on Computational Science and Its Applications; Springer: Berlin/Heidelberg, Germany, 2023; pp. 421–428. [Google Scholar]
- Lloyd, S.; Mohseni, M.; Rebentrost, P. Quantum algorithms for supervised and unsupervised machine learning. arXiv 2013, arXiv:1307.0411. [Google Scholar] [CrossRef]
- Durr, C.; Hoyer, P. A quantum algorithm for finding the minimum. arXiv 1996, arXiv:quant-ph/9607014. [Google Scholar]
- Ohno, H. A quantum algorithm of K-means toward practical use. Quant. Inf. Process. 2022, 21, 146. [Google Scholar] [CrossRef]
- Viladomat Jasso, A.; Modi, A.; Ferrara, R.; Deppe, C.; Nötzel, J.; Fung, F.; Schädler, M. Quantum and quantum-inspired stereographic k nearest-neighbour clustering. Entropy 2023, 25, 1361. [Google Scholar] [CrossRef]
- LaRose, R.; Coyle, B. Robust data encodings for quantum classifiers. Phys. Rev. A 2020, 102, 032420. [Google Scholar] [CrossRef]
- Cuccaro, S.A.; Draper, T.G.; Kutin, S.A.; Moulton, D.P. A new quantum ripple-carry addition circuit. arXiv 2004, arXiv:quantph/0410184. [Google Scholar] [CrossRef]
- Shor, P.W. Algorithms for quantum computation: Discrete logarithms and factoring. In Proceedings of the 35th Annual Symposium on Foundations of Computer Science, Santa Fe, NM, USA, 20–22 November 1994; IEEE: New York, NY, USA, 1994; pp. 124–134. [Google Scholar] [CrossRef]
- Rosenberg, A.; Hirschberg, J. V-measure: A conditional entropy-based external cluster evaluation measure. In Proceedings of the 2007 Joint Conference on Empirical Methods in Natural Language Processing and Computational Natural Language Learning (EMNLP-CoNLL), Prague, Czech Republic, 28–30 June 2007; pp. 410–420. [Google Scholar]
- Hubert, L.; Arabie, P. Comparing partitions. J. Classif. 1985, 2, 193–218. [Google Scholar] [CrossRef]
- Rand, W.M. Objective criteria for the evaluation of clustering methods. J. Am. Stat. Assoc. 1971, 66, 846–850. [Google Scholar] [CrossRef]
- Vinh, N.X.; Epps, J.; Bailey, J. Empirical comparison of clustering algorithms. In Proceedings of the 26th Annual International Conference on Machine Learning (ICML), Montreal, QC, Canada, 14–18 June 2009; pp. 1073–1080. [Google Scholar]
- Davies, D.L.; Bouldin, D.W. A cluster separation measure. IEEE Trans. Pattern Anal. Mach. Intell. 1979, 2, 224–227. [Google Scholar] [CrossRef]
- Palacio-Niño, J.O.; Berzal, F. Evaluation metrics for unsupervised learning algorithms. arXiv 2019, arXiv:1905.05667. [Google Scholar] [CrossRef]
- Vujović, Ž. Classification model evaluation metrics. Int. J. Adv. Comput. Sci. Appl. 2021, 12, 599–606. [Google Scholar] [CrossRef]
- Aleksandrowicz, G.; Alexander, T.; Barkoutsos, P.; Bello, L.; Ben-Haim, Y.; Bucher, D.; Cabrera-Hernández, F.; Carballo-Franquis, J.; Chen, A.; Chen, C.; et al. Qiskit: An Open-source Quantum Computing Framework for Leveraging Today’s Quantum Processors in Research, Education, and Business. Available online: https://zenodo.org/record/2562111#.YlYzptNByUl (accessed on 16 March 2019).
- Deshmukh, S.; Behera, B.K.; Mulay, P.; Ahmed, E.A.; Al-Kuwari, S.; Tiwari, P.; Farouk, A. Explainable quantum clustering method to model medical data. Knowl. Based Syst. 2023, 267, 110413. [Google Scholar] [CrossRef]








| Article | Clustering Quality | Clustering Accuracy | Circuit Depth | Noise Robustness |
|---|---|---|---|---|
| Balanced k-means [22] | Good | Moderate | Medium–High | Low |
| Quantum k-means [8] | Good | Moderate | Low–Medium | Medium |
| NISQ k-means [19] | Good | Good | Low–High | Med–High |
| Parallel Distance [20] | Good | Good | Low | High |
| Genetic k-means [21] | Good | Good | Low–Medium | Good |
| q-means algorithm [7] | Good | Good | High | Low |
| QML for Scientists [6] | Moderate | Moderate | Low | Acceptable |
| Hybrid Quantum [17] | Good | Good | Medium | Good |
| Symbol | Description |
|---|---|
| k | Number of clusters |
| Data point (record) | |
| Centroid of cluster | |
| Distance function (e.g., Euclidean or fidelity-based) | |
| f | Precision parameter (fractional bits for fixed-point encoding) |
| Rotation angle used in CRY and RY gates | |
| Angle-encoded vectors for record and centroid | |
| Quantum state of classical vector x | |
| Rotation-Y gate with angle | |
| Rotation-Z gate with angle | |
| Controlled-RY gate | |
| Quantum states of record and centroid | |
| D | Distance computed via the Hadamard test |
| Quantum registers encoding integers a and b | |
| S | Number of shots |
| A | Accumulated sum of squared differences (in QFT method) |
| H | Hadamard gate |
| Q | Quantum gate (general) |
| p | Probability |
| I | Identity gate |
| e | accumulator register size |
| D | dissimilarity value |
| norm (sum of absolute values) | |
| norm (maximum absolute value) | |
| CP | Controlled Phase gate |
| CCP/MCP | Multi-controlled phase gate with two controls |
| CX | Controlled-NOT |
| Data points | |
| Data labels | |
| N | Number of qubits or data points (context-dependent) |
| Rotation gate around the Z-axis | |
| Quantum state a in Fourier basis |
| Dataset | N-ITE | SSE | SIL | DBI | ARI | NMI |
|---|---|---|---|---|---|---|
| IRIS | ||||||
| IRIS-K | 5.0 ± 0.0000 | 61.6802 ± 0.0000 | 0.5312 ± 0.0000 | 0.7619 ± 0.0000 | 0.6038 ± 0.0000 | 0.6552 ± 0.0000 |
| IRIS-K-N | 6.8 ± 2.7856 | 326.4160 ± 265.5407 | 0.4566 ± 0.2102 | 1.0354 ± 0.4786 | 0.4807 ± 0.3326 | 0.4962 ± 0.3318 |
| IRIS-QK-H | 4.7 ± 1.4178 | 63.226 ± 0.0000 | 0.527 ± 0.0000 | 0.743 ± 0.0000 | 0.609 ± 0.0000 | 0.650 ± 0.0000 |
| IRIS-QK-H-32 | 5.2 ± 1.4697 | 63.6309 ± 0.8542 | 0.5244 ± 0.0092 | 0.7526 ± 0.0381 | 0.5959 ± 0.0227 | 0.6413 ± 0.0238 |
| IRIS-QK-QFT | 10 | 307.2400 | 0.041 | 19.0300 | 0.0070 | 0.0070 |
| IRIS-QK-R [8] | 7 | 616.830 | 0.4800 | – | – | – |
| WINE | ||||||
| WINE-K | 5.0 ± 0.0000 | 206.8692 ± 0.0000 | 0.2039 ± 0.0000 | 1.5049 ± 0.0000 | 0.3093 ± 0.0000 | 0.3199 ± 0.0000 |
| WINE-K-N | 7.0 ± 3.0822 | 392.2134 ± 257.8630 | 0.4390 ± 0.2316 | 1.1085 ± 0.5094 | 0.4487 ± 0.3649 | 0.4577 ± 0.3608 |
| WINE-QK-H | 6.6 ± 2.5377 | 184.6930 ± 5.9280 | 0.2830 ± 0.0210 | 1.399 ± 0.0820 | 0.6090 ± 0.1200 | 0.5760 ± 0.0940 |
| WINE-QK-H-32 | 8.8 ± 1.9890 | 189.6016 ± 10.6955 | 0.2670 ± 0.0352 | 1.4251 ± 0.1264 | 0.5534 ± 0.1600 | 0.5422 ± 0.1430 |
| WINE-QK-QFT | 10 | 310.370 | 0.0200 | 16.4000 | 0.0060 | 0.0050 |
| BLOBS | ||||||
| BLOBS-K | 2.0 ± 0.0000 | 75.5599 ± 0.0000 | 0.8277 ± 0.0000 | 0.2515 ± 0.0000 | 1.0000 ± 0.0000 | 1.0000 ± 0.0000 |
| BLOBS-K-N | 5.5 ± 3.5000 | 365.0366 ± 289.4766 | 0.5705 ± 0.2572 | 0.8140 ± 0.5625 | 0.7504 ± 0.2496 | 0.7491 ± 0.2509 |
| BLOBS-QK-H | 1.1 ± 0.3000 | 75.560 ± 0.0000 | 0.828 ± 0.0000 | 0.252 ± 0.0000 | 1.000 ± 0.0000 | 1.000 ± 0.0000 |
| BLOBS-QK-H-32 | 1.1 ± 0.3000 | 75.5599 ± 0 | 0.8277 ± 0 | 0.2515 ± 0 | 1.0000 ± 0 | 1.0000 ± 0 |
| BLOBS-QK-QFT | 10 | 1546.4400 | 0.0030 | 20.4900 | 0.0670 | 0.0580 |
| BLOBS-QK-R [8] | 7 | 422.2300 | 0.8600 | – | – | – |
| MOON | ||||||
| MOON-K | 7.0 ± 0.0000 | 581.3156 ± 0.0000 | 0.4288 ± 0.0000 | 1.0842 ± 0.0000 | 0.1267 ± 0.0000 | 0.0943 ± 0.0000 |
| MOON-K-N | 7.0 ± 3.5590 | 455.9653 ± 269.0735 | 0.5097 ± 0.2269 | 0.9535 ± 0.4998 | 0.4999 ± 0.4087 | 0.4994 ± 0.4082 |
| MOON-QK-H | 5.3 ± 2.4515 | 590.9730 ± 20.3440 | 0.4210 ± 0.0160 | 1.1100 ± 0.0520 | 0.1010 ± 0.0480 | 0.0750 ± 0.0350 |
| MOON-QK-H-32 | 5.6 ± 2.6533 | 592.4755 ± 22.7411 | 0.4205 ± 0.0171 | 1.1122 ± 0.0560 | 0.0989 ± 0.0486 | 0.0737 ± 0.0358 |
| MOON-QK-QFT | 10 | 987.2000 | 0.0030 | 20.1600 | 0.0010 | 0.0010 |
| MOON-QK-R [8] | 5 | 7185.8000 | 0.5500 | – | – | – |
| NOISY IRIS | ||||||
| NOISY-IRIS-K | 8.0 ± 0.0000 | 108.0471 ± 0.0000 | 0.3864 ± 0.0000 | 1.0494 ± 0.0000 | 0.5294 ± 0.0000 | 0.5505 ± 0.0000 |
| NOISY-IRIS-K-N | 6.84 ± 2.5440 | 291.4000 ± 254.7363 | 0.4401 ± 0.1954 | 1.0352 ± 0.4369 | 0.4796 ± 0.3036 | 0.4959 ± 0.3029 |
| NOISY-IRIS-QK-H | 6.9 ± 2.6627 | 114.2470 ± 1.5310 | 0.3440 ± 0.0090 | 1.1010 ± 0.0300 | 0.4540 ± 0.0460 | 0.5230 ± 0.0380 |
| NOISY-IRIS-QK-H-32 | 7.7 ± 2.4515 | 122.3730 ± 9.6597 | 0.3144 ± 0.0330 | 1.1983 ± 0.1568 | 0.3728 ± 0.0961 | 0.4269 ± 0.1044 |
| NOISY-IRIS-QK-QFT | 10 | 280.2360 | 0.0230 | 0.0100 | 0.0120 | 0.0100 |
| BCW | ||||||
| BCW-K | 10.0 ± 0.0000 | 649.5961 ± 0.0000 | 0.3191 ± 0.0000 | 1.3455 ± 0.0000 | 0.4521 ± 0.0000 | 0.4667 ± 0.0000 |
| BCW-K-N | 9.0 ± 0.0000 | 654.5132 ± 0.0000 | 0.3133 ± 0.0000 | 1.3765 ± 0.0000 | 0.5008 ± 0.0000 | 0.4981 ± 0.0000 |
| BCW-QK-H | 8.6 ± 1.6852 | 662.9880 ± 20.5510 | 0.3060 ± 0.0180 | 1.4110 ± 0.0850 | 0.4470 ± 0.1380 | 0.4390 ± 0.1400 |
| BCW-QK-H-32 | 9.3000 ± 1.4177 | 674.4183 ± 33.7576 | 0.2961 ± 0.0308 | 1.4572 ± 0.1558 | 0.4245 ± 0.1706 | 0.4044 ± 0.1732 |
| BCW-QK-QFT | 10 | 961.9470 | 0.0000001 | 24.2740 | 0.0001 | 0.0000002 |
| Dataset | HOM | FMI | COMP | Precision | Accuracy | Recall | F1-Score |
|---|---|---|---|---|---|---|---|
| IRIS | |||||||
| IRIS-K | 0.6503 ± 0.0000 | 0.7363 ± 0.0000 | 0.6601 ± 0.0000 | 0.8278 ± 0.0000 | 0.8200 ± 0.0000 | 0.8200 ± 0.0000 | 0.8178 ± 0.0000 |
| IRIS-K-N | 0.4968 ± 0.3312 | 0.7066 ± 0.1804 | 0.4957 ± 0.3326 | 0.7745 ± 0.1799 | 0.7571 ± 0.1799 | 0.7571 ± 0.1799 | 0.7572 ± 0.1797 |
| IRIS-QK-H | 0.6420 ± 0.0000 | 0.7410 ± 0.0000 | 0.6590 ± 0.0000 | 0.8420 ± 0.0000 | 0.8270 ± 0.0000 | 0.8270 ± 0.0000 | 0.8230 ± 0.0000 |
| IRIS-QK-H-32 | 0.6334 ± 0.0191 | 0.7324 ± 0.0174 | 0.6494 ± 0.0287 | 0.8327 ± 0.0211 | 0.8180 ± 0.0133 | 0.8180 ± 0.0133 | 0.8150 ± 0.0111 |
| IRIS-QK-QFT | 0.0770 | 0.3500 | 0.0080 | 0.3790 | 0.3730 | 0.3730 | 0.3590 |
| IRIS-QK-R [8] | – | – | – | – | – | – | – |
| WINE | |||||||
| WINE-K | 0.3152 ± 0.0000 | 0.5503 ± 0.0000 | 0.3247 ± 0.0000 | 0.5659 ± 0.0000 | 0.5787 ± 0.0000 | 0.5787 ± 0.0000 | 0.5603 ± 0.0000 |
| WINE-K-N | 0.4606 ± 0.3613 | 0.6979 ± 0.2007 | 0.4549 ± 0.3605 | 0.7577 ± 0.1976 | 0.7398 ± 0.1973 | 0.7398 ± 0.1973 | 0.7407 ± 0.1974 |
| WINE-QK-H | 0.5760 ± 0.0940 | 0.7410 ± 0.0790 | 0.5760 ± 0.0950 | 0.8520 ± 0.0760 | 0.8390 ± 0.0840 | 0.8390 ± 0.0840 | 0.8410 ± 0.0840 |
| WINE-QK-H-32 | 0.5405 ± 0.1441 | 0.7064 ± 0.1031 | 0.5440 ± 0.1418 | 0.8325 ± 0.0859 | 0.8140 ± 0.0953 | 0.8140 ± 0.0953 | 0.8149 ± 0.0957 |
| WINE-QK-QFT | 0.0050 | 0.3330 | 0.0050 | 0.3780 | 0.3640 | 0.3640 | 0.3650 |
| BLOBS | |||||||
| BLOBS-K | 1.0000 ± 0.0000 | 1.0000 ± 0.0000 | 1.0000 ± 0.0000 | 1.0000 ± 0.0000 | 1.0000 ± 0.0000 | 1.0000 ± 0.0000 | 1.0000 ± 0.0000 |
| BLOBS-K-N | 0.7552 ± 0.2448 | 0.8791 ± 0.1209 | 0.7432 ± 0.2568 | 0.9459 ± 0.0541 | 0.9271 ± 0.0729 | 0.9271 ± 0.0729 | 0.9283 ± 0.0717 |
| BLOBS-QK-H | 1.0000 ± 0.0000 | 1.0000 ± 0.0000 | 1.0000 ± 0.0000 | 1.0000 ± 0.0000 | 1.0000 ± 0.0000 | 1.0000 ± 0.0000 | 1.0000 ± 0.0000 |
| BLOBS-QK-H-32 | 1.0000 ± 0.0000 | 1.0000 ± 0.0000 | 1.0000 ± 0.0000 | 1.0000 ± 0.0000 | 1.0000 ± 0.0000 | 1.0000 ± 0.0000 | 1.0000 ± 0.0000 |
| BLOBS-QK-QFT | 0.0570 | 0.3870 | 0.0590 | 0.4650 | 0.4530 | 0.4650 | 0.4550 |
| BLOBS-QK-R [8] | – | – | – | 0.9980 | 0.9980 | 0.9980 | 0.9980 |
| MOON | |||||||
| MOON-K | 0.0943 ± 0.0000 | 0.5628 ± 0.0000 | 0.0943 ± 0.0000 | 0.6788 ± 0.0000 | 0.6788 ± 0.0000 | 0.6788 ± 0.0000 | 0.6787 ± 0.0000 |
| MOON-K-N | 0.5035 ± 0.4083 | 0.7524 ± 0.2047 | 0.4955 ± 0.4083 | 0.7985 ± 0.2131 | 0.7860 ± 0.2082 | 0.7860 ± 0.2082 | 0.7868 ± 0.2085 |
| MOON-QK-H | 0.0750 ± 0.0350 | 0.5500 ± 0.0240 | 0.0750 ± 0.0350 | 0.6500 ± 0.0550 | 0.6500 ± 0.0550 | 0.6500 ± 0.0550 | 0.6500 ± 0.0550 |
| MOON-QK-H-32 | 0.0737 ± 0.0358 | 0.5491 ± 0.0239 | 0.0737 ± 0.0358 | 0.6465 ± 0.0595 | 0.6465 ± 0.0595 | 0.6465 ± 0.0595 | 0.6464 ± 0.0597 |
| MOON-QK-QFT | 0.0010 | 0.5000 | 0.0010 | 0.5130 | 0.5130 | 0.5130 | 0.5120 |
| MOON-QK-R [8] | – | – | – | 0.9800 | 0.9800 | 0.9800 | 0.9800 |
| NOISY IRIS | |||||||
| NOISY-IRIS-K | 0.5455 ± 0.0000 | 0.6873 ± 0.0000 | 0.5557 ± 0.0000 | 0.7814 ± 0.0000 | 0.7800 ± 0.0000 | 0.7800 ± 0.0000 | 0.7734 ± 0.0000 |
| NOISY-IRIS-K-N | 0.4951 ± 0.3023 | 0.6976 ± 0.1659 | 0.4968 ± 0.3036 | 0.7684 ± 0.1648 | 0.7543 ± 0.1643 | 0.7543 ± 0.1643 | 0.7522 ± 0.1644 |
| NOISY-IRIS-QK-H | 0.5200 ± 0.0390 | 0.6350 ± 0.0300 | 0.5250 ± 0.0360 | 0.7020 ± 0.0470 | 0.6930 ± 0.0520 | 0.6930 ± 0.0520 | 0.6950 ± 0.0510 |
| NOISY-IRIS-QK-H-32 | 0.4140 ± 0.1778 | 0.7225 ± 0.0808 | 0.3951 ± 0.1689 | 0.8446 ± 0.0936 | 0.8146 ± 0.0864 | 0.8146 ± 0.0864 | 0.8172 ± 0.0856 |
| NOISY-IRIS-QK-QFT | 0.0120 | 0.0120 | 0.0120 | 0.3340 | 0.3790 | 0.3790 | 0.3790 |
| BCW | |||||||
| BCW-K | 0.4777 ± 0.0000 | 0.7350 ± 0.0000 | 0.4562 ± 0.0000 | 0.8827 ± 0.0000 | 0.8366 ± 0.0000 | 0.8366 ± 0.0000 | 0.8391± 0.0000 |
| BCW-K-N | 0.5104 ± 0.0000 | 0.7583 ± 0.0000 | 0.4864 ± 0.0000 | 0.8918 ± 0.0000 | 0.8541 ± 0.0000 | 0.8541 ± 0.0000 | 0.8565 ± 0.0000 |
| BCW-QK-H | 0.4500 ± 0.1430 | 0.7320 ± 0.0670 | 0.4290 ± 0.1370 | 0.8620 ± 0.0800 | 0.8260 ± 0.0770 | 0.8260 ± 0.0770 | 0.8290 ± 0.0760 |
| BCW-QK-H-32 | 0.3520 ± 0.1700 | 0.8100 ± 0.1000 | 0.3400 ± 0.1600 | 0.8140 ± 0.1100 | 0.8080 ± 0.1000 | 0.8080 ± 0.1000 | 0.8110 ± 0.1000 |
| BCW-QK-QFT | 0.0000003 | 0.3330 | 0.000001 | 0.5330 | 0.5040 | 0.5040 | 0.5130 |
| Circuit | IRIS (K = 2) | Depth |
|---|---|---|
| Basic Implementation [19] | 42.0 | 37 |
| Optimized Interference [19] | 62.0 | 25 |
| Negative Rotations [19] | 80.0 | 2 |
| Distance Calc. (Destructive Interference) [19] | 83.4 | 14 |
| The Hadamard Test | 75.7.0 | 10 |
| (Points, Clusters) | ARI (Quantum Balanced k-Means) [22] | ARI (Quantum k-Means Using the Hadamard Test) |
|---|---|---|
| (8, 2) | 0.76 | 1.0 |
| (16, 2) | 0.88 | 1.0 |
| (24, 2) | 0.91 | 1.0 |
| (32, 2) | 0.91 | 1.0 |
| (9, 3) | 0.72 | 0.31 |
| (12, 3) | 0.76 | 0.36 |
| (15, 3) | 0.77 | 0.64 |
| (18, 3) | 0.79 | 0.66 |
| (21, 3) | 0.71 | 0.6 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Alaeiyan, M.; Torabi, S.; Alaeiyan, M. Quantum k-Means Clustering Using Hadamard-Test-Based Similarity Estimation. Computers 2026, 15, 355. https://doi.org/10.3390/computers15060355
Alaeiyan M, Torabi S, Alaeiyan M. Quantum k-Means Clustering Using Hadamard-Test-Based Similarity Estimation. Computers. 2026; 15(6):355. https://doi.org/10.3390/computers15060355
Chicago/Turabian StyleAlaeiyan, Mohammadhadi, Shahin Torabi, and Mehdi Alaeiyan. 2026. "Quantum k-Means Clustering Using Hadamard-Test-Based Similarity Estimation" Computers 15, no. 6: 355. https://doi.org/10.3390/computers15060355
APA StyleAlaeiyan, M., Torabi, S., & Alaeiyan, M. (2026). Quantum k-Means Clustering Using Hadamard-Test-Based Similarity Estimation. Computers, 15(6), 355. https://doi.org/10.3390/computers15060355
