Compact quantum kernel-based binary classifier

Carsten Blank, Adenilton J. da Silva, Lucas P. de Albuquerque, Francesco Petruccione, Daniel K. ParkQuantum 2022 · DOI

Abstract

Quantum computing opens exciting opportunities for kernel-based machine learning methods, which have broad applications in data analysis. Recent works show that quantum computers can efficiently construct a model of a classifier by engineering the quantum interference effect to carry out the kernel evaluation in parallel. For practical applications of these quantum machine learning methods, an important issue is to minimize the size of quantum circuits. We present the simplest quantum circuit for constructing a kernel-based binary classifier. This is achieved by generalizing the interference circuit to encode data labels in the relative phases of the quantum state and by introducing compact amplitude encoding, which encodes two training data vectors into one quantum register. When compared to the simplest known quantum binary classifier, the number of qubits is reduced by two and the number of steps is reduced linearly with respect to the number of training data. The two-qubit measurement with post-selection required in the previous method is simplified to single-qubit measurement. Furthermore, the final quantum state has a smaller amount of entanglement than that of the previous method, which advocates the cost-effectiveness of our method. Our design also provides a straightforward way to handle an imbalanced data set, which is often encountered in many machine learning problems.

Introduction

Kernel-based classification, such as Support Vector Machines (SVM), relies on calculating similarities between data points in high-dimensional spaces. Quantum computers are naturally suited for these tasks because the inner product of quantum states—a fundamental operation—serves as a built-in kernel. However, in the Noisy Intermediate-Scale Quantum (NISQ) era, the complexity of quantum circuits directly impacts their reliability. Existing methods like the Hadamard Test Classifier (HTC) require auxiliary qubits for interference, dedicated label registers, and complex multi-qubit measurements. This research introduces the Compact Hadamard Classifier (CHC), a streamlined alternative that significantly reduces resource requirements while maintaining high performance.

Circuit Design: The Compact Hadamard Classifier

The primary innovation of the CHC lies in its resource efficiency. By leveraging the complex nature of quantum amplitudes, the researchers developed Compact Amplitude Encoding (CAE). Instead of using a separate register to store class labels (+1 or -1), the CHC encodes training data from different classes into the real and imaginary parts of the same quantum register.

Comparison of the standard Hadamard-Test Classifier and the proposed Compact Hadamard Classifier circuits.

As shown in the circuit comparison, the CHC eliminates the need for a dedicated label register and simplifies the final stage. By applying a single-qubit rotation gate ($R_z$) to the ancilla qubit, the relative phase between test and training data is controlled, allowing the classification result to be extracted via a simple single-qubit measurement ($\sigma_z$ expectation value). This design reduces the qubit count by two and the gate count by a factor of four compared to the HTC.

Performance and Entanglement Analysis

The CHC was validated using the Iris and Wine datasets, both in numerical simulations and on IBM's 5-qubit superconducting processor, ibmq_manila. The classifier achieved near-perfect accuracy (~99%) on the Iris dataset in simulation and maintained high fidelity (~95-96%) on real hardware.

Beyond accuracy, the researchers analyzed the entanglement generated during the process using the Meyer-Wallach measure. A key finding was that the CHC consistently produces states with lower entanglement than the HTC.

Entanglement difference and distribution for Iris (a) and Wine (b) datasets across varying training sample sizes.

As illustrated in the data, the "entanglement difference" ($\Delta$) between the HTC and the CHC is positive across all tested sample sizes. In the context of NISQ devices, lower entanglement is a significant advantage, as it typically correlates with reduced noise sensitivity and easier state preparation. Furthermore, the CHC's design allows for natural handling of imbalanced datasets by simply adjusting the $R_z$ gate angle, avoiding the need for artificial data padding.

Conclusion

The Compact Hadamard Classifier represents a significant step toward practical quantum machine learning. By reducing qubit and gate overhead and simplifying measurement protocols, it makes kernel-based classification more accessible for current quantum hardware. While challenges remain—specifically regarding the efficiency of initial state preparation and scaling to non-linear kernels—the CHC provides a robust and efficient framework for binary classification in the NISQ era.

Summary updated

BibTeX
@inproceedings{blank2022compact,
  author = {Carsten Blank and Adenilton J. da Silva and Lucas P. de Albuquerque and Francesco Petruccione and Daniel K. Park},
  title = {{Compact quantum kernel-based binary classifier}},
  booktitle = {Quantum},
  year = {2022},
  doi = {10.1088/2058-9565/ac7ba3},
}
Figure