qc-kmeans: A Quantum Compressive K-Means Algorithm for NISQ Devices

Pedro Chumpitaz-Flores, My Duong, Ying Mao, Kaixun HuaarXiv 2025 · DOI

Abstract

The qc-kmeans algorithm is a hybrid quantum-classical approach designed for k-means clustering on Noisy Intermediate-Scale Quantum (NISQ) hardware. By utilizing Random Fourier Features for data sketching and decomposing the optimization into independent subproblems solved via the Quantum Approximate Optimization Algorithm (QAOA) with an XY ring mixer, the method achieves constant qubit scaling relative to dataset size. This approach bypasses the need for QRAM and enables scalable clustering on modern quantum devices.

The Challenge of Quantum Clustering

Clustering is a fundamental task in unsupervised learning, yet scaling it to massive, high-dimensional datasets remains computationally demanding. While theoretical quantum algorithms like q-means offer potential speedups, they face two significant barriers for current NISQ devices:

  1. The Data Loading Bottleneck: Most quantum algorithms require Quantum RAM (QRAM) to load data efficiently, a technology not yet available.
  2. The Qubit Bottleneck: Standard formulations often require a number of qubits that scales with the number of clusters or data dimensionality, quickly exceeding the capacity of modern 20–100 qubit processors.

The qc-kmeans algorithm addresses these hurdles by providing a NISQ-oriented framework that uses shallow circuits, minimal qubits, and operates without QRAM.

The qc-kmeans Pipeline

The algorithm follows a three-stage hybrid pipeline to maintain efficiency and scalability.

The qc-kmeans pipeline overview, showing the preprocessing, candidate generation, and per-cluster discrete solve stages.
  1. Data Sketching (Classical): Instead of loading the entire dataset $N$ into quantum memory, the algorithm uses Random Fourier Features to compress the data into a fixed-size "sketch" ($z_X$). This sketch represents the statistical distribution of the data points.
  2. Per-Group QUBO Decomposition (Hybrid): To avoid the qubit bottleneck, the search for cluster centroids is discretized. The global optimization problem is decomposed into $k$ independent, smaller Quadratic Unconstrained Binary Optimization (QUBO) problems—one for each cluster.
  3. QAOA with XY Mixer (Quantum): Each small QUBO is solved using the Quantum Approximate Optimization Algorithm (QAOA). To ensure valid solutions, an XY ring mixer is employed to keep the quantum state within a "one-hot" subspace, meaning exactly one candidate is selected as a centroid per cluster.
  4. q-Lloyd Refinement: An iterative loop reassigns points and updates the sketch to refine centroids over multiple rounds, mirroring the classical Lloyd’s algorithm.

Technical Innovations

A key innovation is the peak-qubit bound. Due to the per-group decomposition, the number of qubits required ($q_{peak}$) depends only on the number of candidate centroids per cluster and the sketch size, making it independent of the total number of samples ($N$).

The QAOA circuit architecture utilizing an XY ring mixer to enforce one-hot constraints during the optimization process.

By using a depth of $p=1$ for QAOA and a controlled diagonal oracle for sketching, the circuits remain shallow enough for noisy hardware. While dropping inter-group couplings introduces a "relaxation gap," the authors demonstrate that this error is mathematically bounded and manageable in practice.

Experimental Performance

The algorithm was evaluated on six synthetic benchmarks (e.g., circles, moons, spiral) and nine real-world datasets from the UCI repository. Notably, it successfully processed the SPNET3D dataset containing over 434,000 samples in under 8 minutes of simulation.

Key results include:

  • Low Qubit Usage: Simulations consistently required $\le 9$ qubits, regardless of dataset complexity.
  • Competitive Accuracy: qc-kmeans achieved lower Sum-of-Squared Errors (SSE) and faster runtimes compared to quantum baselines like q-k-Means.
  • Noise Robustness: Tests against IBM’s FakeMelbourneV2 noise models showed minimal sensitivity, with SSE values remaining close to ideal simulations.

Conclusion and Future Outlook

While qc-kmeans makes quantum clustering practical today, it relies on classical preprocessing for sketching and candidate generation, which may limit pure quantum speedup. Future work will explore increasing QAOA depth for higher accuracy, implementing advanced error mitigation, and developing more robust initialization strategies to further enhance performance on physical quantum processors.

Summary updated

BibTeX
@misc{chumpitazflores2025qc,
  author = {Pedro Chumpitaz-Flores and My Duong and Ying Mao and Kaixun Hua},
  title = {{qc-kmeans: A Quantum Compressive K-Means Algorithm for NISQ Devices}},
  year = {2025},
  eprint = {2510.22540},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2510.22540},
}
Figure