Source-linked AI summary
Quantum classifier with tailored quantum kernel
Carsten Blank, Daniel K. Park, June-Koo Kevin Rhee, Francesco Petruccione
TL;DR
Quantum kernel classification needs a fidelity-based approach that works for arbitrary quantum states rather than only the real part of state overlap. The paper constructs a swap-test classifier with tunable fidelity powers and training-data weights, demonstrates qualitative agreement with theory in IBM-based experiments and realistic noise simulations, and connects the classifier to Helstrom-operator measurement.
Problem
Overlap-based quantum classifiers do not work for arbitrary quantum states because they use only the real part of state overlap, limiting full use of quantum feature maps.
Method
The paper uses a swap-test circuit to compute weighted power sums of quantum state fidelities, with product-state preparation enabled by quantum forking.
Results
Experimental results qualitatively agree with theory despite an amplitude reduction of about 0.65 and a phase shift of about 2° under realistic IBM-device conditions.
Takeaways & Limitations
The classifier supports quantum feature-map kernels and is equivalent to measuring a Helstrom operator, linking kernel-based classification with quantum state discrimination.
Takeaways & Limitations
The product-state quantum-forking approach increases the number of qubits linearly with data size and requires many mutually interacting qubits.
Abstract
from arXiv · showhide
Kernel methods have a wide spectrum of applications in machine learning. Recently, a link between quantum computing and kernel theory has been formally established, opening up opportunities for quantum techniques to enhance various existing machine learning methods. We present a distance-based quantum classifier whose kernel is based on the quantum state fidelity between training and test data. The quantum kernel can be tailored systematically with a quantum circuit to raise the kernel to an arbitrary power and to assign arbitrary weights to each training data. Given a specific input state, our protocol calculates the weighted power sum of fidelities of quantum data in quantum parallel via a swap-test circuit followed by two single-qubit measurements, requiring only a constant number of repetitions regardless of the number of data. We also show that our classifier is equivalent to measuring the expectation value of a Helstrom operator, from which the well-known optimal quantum state discrimination can be derived. We demonstrate the proof-of-principle via classical simulations with a realistic noise model and experiments using the IBM quantum computer.
INTRODUCTION
The paper addresses the limitation of overlap-based quantum classification for arbitrary quantum states by introducing a fidelity-based distance kernel. Its classifier supports systematically weighted and powered fidelity sums using quantum circuits.
- Overlap-based Hadamard classification uses only the real part of the transition amplitude, so it does not handle arbitrary quantum states.
- The proposed distance-based classifier instead uses quantum state fidelity as its kernel, enabling quantum feature maps to be used fully.
- A systematic circuit construction realizes arbitrary weighted power sums of training–test fidelities as the classification distance measure.
- The classifier uses a swap test and can raise fidelity to power n by using n copies of the training and test data.
- Quantum forking provides a product-state implementation with separate registers, avoiding reliance on a specific initial state at the cost of more qubits.
Classification without post-selection
The Hadamard classifier encodes weighted training data and a test state, interferes them with an ancilla-controlled circuit, and classifies from label-measurement statistics. An expectation-value formulation uses both ancilla branches and avoids post-selection.
- Training data, labels, and the test state are encoded in index, data, and label registers, with unit-length inputs and weights w_m.
- The classifier applies a Hadamard gate to an ancilla and uses two single-qubit measurements to obtain the classification outcome.
- Post-selecting either ancilla outcome produces a label-register state whose measurement probabilities determine the predicted label.
- Avoiding post-selection reduces the number of experiments by about a factor of two and removes the associated preprocessing requirement.
- The ancilla outcome a = 1 reverses the label preference, so the label with lower probability is assigned.
- An expectation value of a two-qubit observable on the ancilla and label qubits replaces post-selection, classifying 0 for a positive value and 1 for a negative value.
Quantum kernel based on state fidelity
The swap-test classifier uses quantum state fidelity as a distance measure, with a circuit that supports arbitrary fidelity powers and training-data weights. It classifies by measuring ancilla–label statistics, and experiments on a toy problem show mostly correct predictions.
- Quantum kernel based on state fidelity: The proposed classifier replaces overlap-based classification with a swap-test kernel based on quantum state fidelity.The kernel uses the nth power of fidelity between training and test states.
- Classifier protocol: The circuit encodes labeled training states and test states separately, applies a controlled swap, and measures a two-qubit observable on the ancilla and label qubits.The input state uses index, data, and label registers, while the ancilla controls the swap-test.
- Kernel design: Arbitrary fidelity powers are obtained by using n copies of the training and test data, while weighted sums assign probability amplitudes to training examples.The resulting expectation value is used to assign the test datum a label according to its weighted fidelity-based distance.
- Classifier protocol: Because fidelity is non-negative, the swap-test classifier has p0 ≥ 1/2, so the Hadamard classifier’s data pre-processing for post-selection is not strictly required.The post-selection probability is determined by the fidelity-based kernel rather than the real part of the state overlap.
- Asymptotic behavior: As the number of copies grows, the classifier increasingly assigns labels according to training data that approximately match the test datum exactly.The theoretical sharpening is illustrated for n = 1, 10, and 100 copies and approaches a Dirac δ in the infinite-copy limit.
Kernel construction from a product state
The classifier can prepare its required state from separately encoded product-state training and test data using quantum forking, without prior knowledge of either dataset. Its resource cost grows linearly with the number of training examples and logarithmically with feature dimension, although current hardware does not yet meet the stated requirements.
- State preparation: The product-state implementation does not require knowledge of the training or test data before preparation and can accept intrinsically quantum inputs.Classical data can instead be encoded on separate registers.
- State preparation: Quantum forking uses index-controlled swaps to entangle separate product-state registers so each index subspace encodes a different training dataset.The index register controls swaps of data and label registers before classification.
- Implementation: The circuit can be implemented with Toffoli, controlled-NOT, X, and Hadamard gates, with additional qubits for multi-qubit controlled operations.The stated gate-count analysis assumes Toffoli and controlled-NOT gates dominate cost.
- Resource scaling: The number of gates and qubits depends linearly on M and logarithmically on N, favoring problems with few training data and large feature spaces.For n = 1, examples include 79 qubits, 163 Toffoli gates, and 134 controlled-NOT gates for 16 training data with 8 features.
The connection to the Helstrom measurement
The swap-test classifier is equivalent to measuring an observable that can be written as a Helstrom operator for two label-conditioned density operators. This connects the classifier to optimal quantum state discrimination and permits the measurement without a priori knowledge of target states.
- Operator equivalence: The swap-test classifier’s fidelity-based kernel is equivalent to measuring the expectation value of an observable.The observable is evaluated on n copies of the test state.
- Helstrom formulation: The observable can be written as the Helstrom operator p0ρ0 − p1ρ1 for hypotheses represented by label-conditioned density operators with prior probabilities p0 and p1.The construction uses normalized weights within each label class and p0 + p1 = 1.
- Implication: Because quantum forking avoids knowing the training data during preparation, the corresponding Helstrom-operator measurement can also be performed without a priori information about the target states.This is the paper’s connection to optimal quantum state discrimination.
Experimental and Simulation Results
Experiments on IBM’s Q 5 Ourense processor and realistic noise-model simulations qualitatively agreed with theory despite observable noise effects. In the toy problem, the classifier predicted the correct class for about 97% of sampled inputs.
- Experiment: The IBM Q 5 Ourense demonstration used five superconducting qubits and 27 elementary gates, including 14 single-qubit and 13 controlled-NOT gates.The example used n = 1 and was selected to fit currently available noisy-intermediate-scale hardware.
- Theory comparison: Experimental results qualitatively agreed with theory, with amplitude reduced by about 0.65 and a phase shift of about 2°.Simulations using realistic depolarizing, thermal-relaxation, and measurement errors showed amplitude reduction of about 0.82 with negligible phase shift.
- Classification accuracy: About 97% of sampled toy-problem inputs received the correct class despite experimental imperfections.Additional IBM cloud-quantum-computer runs over several months also agreed qualitatively with theory and showed successful classification with high probabilities.
DISCUSSION
The paper presents a swap-test quantum classifier based on weighted powers of quantum-state fidelity and connects its classification measurement to Helstrom operators. It discusses feature-map applications, experimental implications, and limitations including qubit connectivity and noise-model incompleteness.
- Core contribution: The classifier constructs a kernelized binary classifier from a weighted power sum of quantum-state fidelities between training and test data.The data may be intrinsically quantum or classical information transformed into a quantum feature space.
- Core contribution: A two-qubit measurement scheme avoids the classical preprocessing required by the earlier method and may enable error mitigation under noise.The measurement evaluates a two-qubit observable without relying on quantum error-correcting codes.
- Limitations and extensions: Using separate registers through quantum forking removes specific state-preparation and prior-data requirements but increases qubit count linearly with dataset size.The approach also requires many interacting qubits, which may limit applicability.
- Applications: Quantum feature maps Φ: R^d → H can produce kernels K(x, x_m) = |⟨Φ(x)|Φ(x_m)⟩|^2n for the classifier.The authors frame this construction as relevant to quantum feature-map applications and future quantum machine-learning protocols.
- Connections and future work: The swap-test classifier is equivalent to measuring a Helstrom operator, motivating study of connections between kernel-based quantum learning and quantum state discrimination.The paper leaves open whether Helstrom measurement is optimal for classification problems.
METHODS
The methods implement the example swap-test classifier as a superconducting-qubit circuit and evaluate it with repeated measurements, device-calibrated noise simulation, and an IBM quantum processor. The circuit must be adapted to limited qubit coupling and native-gate constraints.
- Circuit implementation: The circuit parameter α prepares the index qubit for weights w1 and w2, while θ parameterizes the test datum.The experiment sweeps θ from 0 to 2π in increments of 0.1 and uses 8129 shots per value.
- Circuit implementation: Figure 6 shows the circuit implementing the swap-test classifier for the example dataset specified in Eq. (11).The figure provides the circuit-level realization of the example classification problem.
- Simulation and hardware constraints: Available superconducting devices have limited qubit coupling, so circuits must be rewritten for device constraints and decomposed into native gates.These challenges are described as manageable for circuits with small numbers of qubits and gates.
- Measurement: Measurements use the count combination ⟨σ(a)z⟩ = 1/8192(c00 − c01 − c10 + c11), where c_al counts outcomes with ancilla a and label l.This converts two-qubit measurement counts into the expectation value used for classification.
- Simulation and hardware constraints: Noise simulations use IBM calibration data including T1 and T2 times, qubit frequencies, gate errors, read-out errors, and gate times.The implementation uses Qiskit versions 0.7.0–0.10.0, while the basic model omits cross-talk, drift, and non-Markovian noise.
AUTHOR CONTRIBUTIONS STATEMENT
The authors report equal contributions from C.B. and D.K.P., while C.B. conducted the simulations and IBM Q experiments. The authors declare no competing interests.
- Contributions: C.B. and D.K.P. contributed equally and designed and analysed the model.C.B. also conducted the simulations and IBM Q experiments; all authors reviewed the analyses and contributed to writing.
- Competing interests: The authors declare no competing interests.
Supplementary Information: Quantum classifier with tailored quantum kernels
The supplementary material specifies the swap-test classifier’s measurement behavior, circuit construction, resource requirements, and noisy-simulation assumptions. It also contrasts fidelity-based classification with the Hadamard classifier’s overlap-based limitation.
- Reducing the number of experiments: The swap-test classifier uses two-qubit expectation-value measurements so all experiments contribute, avoiding post-selection and improving experiment usage for both classifiers.For standardized data, the expectation value is always positive, but the measurement still avoids discarding outcomes.
- Qubit and gate counts: The product-state implementation has explicit resource costs dominated by Toffoli and controlled-NOT gates, with additional ancillas for controlled operations.The gate decomposition uses controlled-NOT and Toffoli gates, and a Toffoli can be decomposed into six controlled-NOT gates.
- Classifier design: Quantum state fidelity replaces the real part of state overlap, allowing quantum feature maps with complex-valued similarities to influence classification.The example is designed to show that the Hadamard classifier treats the samples equally, whereas a similarity measure incorporating imaginary values can distinguish them.
- Noise model: The simulations use qiskit-aer’s basic device-noise model, but that model is a simplified approximation and omits non-Markovian noise.The model takes device calibration parameters, gate times, and temperature as inputs, while its applicability requires caution.
D. Experimental Results
The experimental section compares IBM-device measurements with simulations and theoretical curves for the swap-test classifier. Fits show attenuated amplitudes and discrepancies that the simplified noise model does not fully explain.
- Experimental setup: The experiments vary θ from 0 to 2π in increments of 0.1, sending 63 circuits to either the simulator or IBM device.A scheduler batches the circuits, and the study uses device calibration data for matching noise simulations.
- Quantitative comparison: The reference fit recovers the theoretical parameters a ≈ 9.99999993e−01, ϑ ≈−6.91619552e−09, and w2 ≈4.99999993e−01.These fitted values serve as the benchmark for comparing simulation and experiment.
- Quantitative comparison: Simulation fitting gives a ≈0.8213, ϑ ≈−9/104329π, and w2 ≈0.50232985, while experiment gives a ≈0.6515, ϑ ≈2/51π, and w2 ≈0.5414.Both are compared against the theoretical reference fit.
- Interpretation: Simulation and experimental results differ because the applied noise model does not fully describe the IBM experiment.The authors associate remaining effects with cross-talk, time-dependent and non-Markovian noise, and underestimated error rates.
- Cross-device experiments: Results are collected across several IBM backends and dates, with corresponding simulation and theoretical results plotted for comparison.The supplementary data repository includes experiments on ibmqx4, ibmq vigo, ibmqx2, and ibmq ourense.