Metric Learning with Quantum Feature Spaces

arXiv:2312.01655 · quant-ph, cs.AI · Submitted 2023-12-04 · Read on arXiv

Listen

Radio episode about this paper

Transcript

Introduction to the show: ident: Quantum Radio. Generated commentary on the latest quantum physics and condensed matter papers.

Kai: We're looking at the paper: "Metric Learning with Quantum Feature Spaces".

Mira: Here's the gist of the paper. The gist The proposed Quantum Projective Metric Learning (QPMeL) framework is a quantum-aware, classically-trained method to learn dense and high-quality quantum encodings by mapping classical data to the surface of independent unit spheres in R 3, which naturally aligns with the state of multiple unentangled qubits.

Mira: The core idea of QPMeL is to define a unified feature space composed of the surfaces of independent unit spheres in R 3, which are mapped from classical data points by a learnable encoder to produce polar and azimuthal angles (θ, γ) that naturally align with the state space of multiple unentangled qubits <ref:2312.01655#pg5>.

Kai: These coordinates are then directly translated into quantum states using only RY and RZ gates <ref:2312.01655#pg5>.

Title and authors: Kai: So we’re looking at this paper called Metric Learning with Quantum Feature Spaces. It sounds a bit technical, but basically, it’s about a new way to teach a computer how to represent data for quantum computers.

Mira: That’s right. The idea here is that instead of trying to train the quantum circuits directly on the complex quantum states—which we know causes these kinds of optimization problems called barren plateaus—they propose training something classical first, and then using that classical training to create really good representations for the quantum part.

Lev: So, what I see is they’re mapping our classical data points into a specific geometric shape in three dimensional space, the surface of independent unit spheres. That sounds like a way to simplify the problem before we even touch quantum states.

Kai: Exactly. The core idea is that these spheres naturally align with how multiple unentangled qubits behave, which means the encoding we learn classically already has some structure that's compatible with what those qubits represent.

Mira: And then they build this Projective Metric Function, or PMeF, which uses just those three coordinates in R three to measure similarity in the quantum state space without having to deal with all the messy complex numbers directly <ref:2312.01655#pg1>.

Lev: From an engineering side, that sounds promising because if we can calculate similarity using only real-valued coordinates from a classical process, it should be much more stable to run on actual hardware.

The paper's summary: Kai: So, the paper says the main idea of Quantum Projective Metric Learning is defining this unified feature space made of those independent unit spheres in R three and then using a learnable encoder to produce polar and azimuthal angles, theta and gamma <ref:2312.01655#pg1,independent unit spheres in R 3>.

Mira: And these coordinates, theta and gamma, are what they call angular encodings, which they claim naturally line up with the state space of multiple unentangled qubits. They translate those coordinates into quantum states by only using RY and RZ gates.

Lev: The paper mentions that because they’re doing all the training classically, QPMeL avoids those barren plateaus that plague quantum circuit training, which is a big deal for running anything on current NISQ devices.

Kai: And they introduce this Projective Metric Function, PMeF, which uses those R three coordinates to compute similarity in the quantum state space by combining some polar-to-cartesian conversion and a complex kernel function to handle the periodicity and complex nature of those coordinates <ref:2312.01655#pg1>.

Mira: So, basically, they’re using classical training to learn these geometric mappings, and then using a clever metric function that only looks at those learned angles to figure out how similar two quantum states are.

Lev: The authors also introduce a gradient trick to help with training stability by replacing the product in their metric loss with a sum over single-qubit fidelities during the training process.

The paper's improvements: Kai: One of the main contributions they highlight is this unified feature space, which is composed of independent spherical surfaces common to both the classical and quantum domains, created by that classical encoder outputting those angular encodings theta and gamma.

Mira: They also emphasize the novel Projective Metric Function, PMeF, which computes similarity between points in quantum state space using only those R three coordinates derived from the angular encodings <ref:2312.01655#pg1,novel Projective Metric Function, PMeF>. This is a new way to measure that similarity without needing complex calculations directly.

Lev: And they have this gradient trick for PMeF, which modifies the metric used during training by swapping the product with a sum over single-qubit fidelities, which they say leads to more stable and faster convergence during training.

Kai: So, what this means is that we get these dense and expressive embeddings learned classically that respect Hilbert space geometry while avoiding the training instability you see when you train quantum circuits directly.

Mira: And this approach is particularly good because it allows classical training to yield those dense embeddings, which are then used to map to quantum states using just RY and RZ gates per qubit.

Lev: It’s still important to remember that the paper doesn't claim they can learn entangled states, so while it’s very stable for training, the limitation is that they aren't learning those complex correlations directly.

Conclusion: Kai: So, looking at the whole thing, Metric Learning with Quantum Feature Spaces presents this unified feature space approach using spherical surfaces and angular encodings as a way to bridge classical learning and quantum representation.

Mira: The combination of the Projective Metric Function PMeF with any metric loss creates what they call a quantum-aware loss function, which means it’s designed specifically to work well with quantum state similarity.

Lev: And they’ve shown that this classical training can produce dense embeddings that respect Hilbert space geometry while avoiding the training instability associated with training quantum circuits. That stability is key for getting anything reliable on real hardware.

Kai: The paper concludes that QPMeL is more efficient and learns better representations than existing Quantum Machine Learning methods, especially when dealing with few-shot learning regimes.

Mira: They also show that this method supports multi-modal few-shot learning, achieving over ninety percent accuracy in the fifteen-way one-shot setting for image–text classification using only twenty qubits.

Lev: So, the implication is that we can use classical training to create very good quantum encodings efficiently, and this is scalable and efficient for near term devices because it only requires two gates per qubit for encoding.

Vinayak Sharma, Ashish Padhy, Sourav Behera, Lord Sen, Shyamapada Mukherjee, Aviral Shrivastava

School of Computing and Augmented Intelligence at Arizona State University · National Institute of Technology, Rourkela

quant-ph, cs.AI

Submitted: 2023-12-04

Updated: 2026-10-20

License: http://creativecommons.org/licenses/by-nc-sa/4.0/

The gist: The gist The proposed Quantum Projective Metric Learning (QPMeL) framework is a quantum-aware, classically-trained method to learn dense and high-quality quantum encodings by mapping classical data

Key concepts

Unified Feature Space
This is a feature space combining classical data points with the surfaces of independent unit spheres in R3. A classical encoder maps input data to polar angles (theta, gamma) on these spheres. These angles naturally correspond to the state space of multiple unentangled qubits, providing a common geometric foundation for both classical and quantum representations.
Projective Metric Function (PMeF)
PMeF is a new function designed to calculate the similarity between two quantum states using only their R3 coordinates derived from the angular encodings. It combines polar-to-cartesian conversion with a Complex Kernel Function to handle coordinate periodicity and complex values, allowing classical training to measure quantum state space similarity effectively.
Gradient Trick for PMeF
This technique modifies the metric used during classical training by replacing standard product terms with a sum over single-qubit fidelities. This modification is crucial because it mitigates vanishing gradients, leading to more stable and faster convergence of the classical model when learning complex quantum representations.
Quantum-Aware Classical Training
QPMeL allows the entire learning process—encoding and metric computation—to happen classically in real-valued space. This avoids the instability issues (like barren plateaus) found when training quantum circuits, enabling classical models to learn dense, expressive embeddings that respect Hilbert space geometry using only two gates per qubit for encoding.

Terminology

Summary

The gist The proposed Quantum Projective Metric Learning (QPMeL) framework is a quantum-aware, classically-trained method to learn dense and high-quality quantum encodings by mapping classical data to the surface of independent unit spheres in R 3, which naturally aligns with the state of multiple unentangled qubits.

How it works

  1. The core idea of QPMeL is to define a unified feature space composed of the surfaces of independent unit spheres in R 3, which are mapped from classical data points by a learnable encoder to produce polar and azimuthal angles (θ, γ) that naturally align with the state space of multiple unentangled qubits <ref:2312.01655#pg5>. These coordinates are then directly translated into quantum states using only RY and RZ gates <ref:2312.01655#pg5>.

  2. The framework introduces a novel Projective Metric Function (PMeF) which can compute the similarity in quantum state space using the R 3 coordinates of the encoded points <ref:2312.01655#pg5>. This function is constructed by combining polar-to-cartesian conversion and a Complex Kernel Function (CKF) to address coordinate periodicity and complex-valued coordinates <ref:2312.01655#pg5>.

  3. During training, QPMeL operates entirely in classical real-valued space, relying on the novel PMeF to compute similarity in quantum state space for metric loss functions such as Prototypical loss <ref:2312.01655#pg5>. This approach avoids barren plateaus by training only classically and avoiding the challenges inherent to training quantum circuits <ref:2312.01655#pg5>.

  4. A gradient trick is introduced for PMeF, modifying the metric used during training by replacing the product with a sum over single-qubit fidelities to mitigate vanishing gradients during training <ref:2312.01655#pg5>.

Key Contributions and Performance

The key contributions of QPMeL are summarized as:

  1. A unified feature space consisting of independent spherical surfaces common to the classical and quantum domains created via a classical encoder which outputs angular encodings (θ, γ) <ref:2312.01655#pg5>.

  2. A novel Projective Metric Function (PMeF), which computes the similarity between points in quantum state space using only the R 3 coordinates derived from the angular encodings <ref:2312.01655#pg5>.

  3. A gradient trick for PMeF leading to more stable gradients during training, allowing the models to converge more consistently <ref:2312.01655#pg5>.

QPMeL achieves state-of-the-art performance on MNIST, Fashion-MNIST, and Omniglot, scaling up to 10-class classification and 15-way few-shot learning with high accuracy using significantly fewer qubits <ref:2312.01655#pg5>. It is also the first QML approach to support multi-modal (image–text) learning, achieving over 90% accuracy in the 15-way-1-shot setting with just 20 qubits <ref:2312.01655#pg5>.

Experimental Results and Benchmarking

QPMeL significantly outperforms previous methods in Standard Classification, achieving a 99% accuracy on binary tasks for MNIST and FashionMNIST <ref:2312.01655#pg5>. It is the only method that scales successfully to 10-class classification on both datasets while achieving ∼ 96% accuracy on MNIST and ∼ 85% on Fashion-MNIST <ref:2312.01655#pg5>. In few-shot learning (FSL), QPMeL outperforms or matches prior work, using only 1/6th the number of qubits to scale to 10-way FSL with 90% accuracy and maintaining over 85% accuracy in the 15-way setting <ref:2312.01655#pg5>. Furthermore, QPMeL achieves strong Multi-Modal FSL classification performance, reaching > 90% accuracy on the train-set even when scaling to 15-way-1-shot settings using only 20 qubits <ref:2312.01655#pg5>.

Limitations and Flexibility

While QPMeL may be limited by not being able to learn entangled states, the results show that this does not seem to affect the performance of QPMeL <ref:2312.01655#pg5>. The resulting quantum state can then be used as the input for ‘Downstream Applications’ such as generative or regressive models, and due to only requiring a single RY and RZ gate per qubit, QPMeL can be used with any circuit in place of static angle encoding <ref:2312.01655#pg5>. The downstream application circuit may need to be trained separately based on the target application; however, no retraining of QPMeL is required <ref:2312.01655#pg5>.

Conclusion

In this paper we introduce QPMeL, a novel framework that learns encodings for quantum computer classically via a unified feature space of independent spherical surfaces and a novel Projective Metric Function (PMeF) <ref:2312.01655#pg5>. Our results prove that QPMeL is more efficient and learns better representations than existing QML methods <ref:2312.01655#pg5>. The combination of PMeF with any metric loss creates a ‘Quantum-Aware’ loss function <ref:2312.01655#pg5>. The framework successfully demonstrates that classical training can yield dense, expressive embeddings that respect Hilbert space geometry while avoiding the training instability associated with quantum circuits <ref:2312.01655#pg5>. The framework is highly scalable and efficient for NISQ devices, as it only requires 2 gates per qubit for encoding <ref:2312.01655#pg5>.

--- Page 8 ---

References

Cerezo, M.; Sone, A.; Volkoff, T.; Cincio, L.; and Coles, P. J. 2021. Cost function dependent barren plateaus in shallow parametrized quantum circuits.

Chen, X.; Fang, H.; Lin, T.-Y.; Vedantam, R.; Gupta, S.; Dollar, P.; and Zitnick, C. L. 2015. Microsoft COCO Captions: Data Collection and Evaluation Server.

Chollet, F. 2017. Xception: Deep Learning with Depthwise Separable Convolutions.

Deng, L. 2012. The mnist database of handwritten digit images for machine learning research.

Havl´ıcek, V.; Cˇ orcoles, A. D.; Temme, K.; Harrow, A. W.; ´Kandala, A.; Chow, J. M.; and Gambetta, J. M. 2019. Supervised learning with quantum-enhanced feature spaces.

Hou, Y.-Y.; Li, J.; Chen, X.-B.; and Ye, C.-Q. 2023. Quantum adversarial metric learning model based on triplet loss function.

Huang, Z.; Shi, J.; and Li, X. 2025. Quantum Few-Shot Image Classification.

Hur, T.; Araujo, I. F.; and Park, D. K. 2023. Neural Quantum Embedding: Pushing the Limits of Quantum Supervised Learning.

Lake, B. M.; Salakhutdinov, R.; and Tenenbaum, J. B. 2015. Human-level concept learning through probabilistic program induction.

Liu, M.; Liu, J.; Liu, R.; Makhanov, H.; Lykov, D.; Apte, A.; and Alexeev, Y. 2022. Embedding Learning in Hybrid Quantum-Classical Neural Networks.

Lloyd, S.; Schuld, M.; Ijaz, A.; Izaac, J.; and Killoran, N. 2020. Quantum embeddings for machine learning.

Mari, A.; Bromley, T. R.; Izaac, J.; Schuld, M.; and Killoran, N. 2020. Transfer learning in hybrid classical-quantum neural networks.

McClean, J. R.; Boixo, S.

Improvements for AI systems

  1. Quantum-Aware Classical Training enables classical models to learn mappings to quantum feature space directly via PMeF, avoiding optimization issues associated with quantum circuits like barren plateaus. This allows for training classical models to learn dense, expressive embeddings that respect Hilbert space geometry while using only 2 gates per qubit for encoding.

  2. The Projective Metric Function (PMeF) computes similarity between quantum states using real-valued angular coordinates derived from the QPMeL encoder, addressing coordinate periodicity and complex-valued coordinates in quantum state space. This function allows for the computation of multi-qubit fidelity in linear time on classical computers via vectorized dot products.

  3. The gradient trick modifies the metric used during training by replacing the product with a sum over single-qubit fidelities, leading to more stable and faster convergence, especially for higher qubit settings. This stabilization improves the ability of QPMeL to learn discriminative and generalized encodings from limited labeled data in few-shot learning regimes.

  4. QPMeL supports multi-modal few-shot learning by achieving over 90 percent accuracy in the 15-way 1-shot setting for image-text classification using only 20 qubits. This demonstrates the ability to learn a shared latent space between modalities without requiring significantly more qubits than image-only models.

Abstract

The 2 N dimensions of Hilbert space give quantum metric learning exponentially many mutually orthogonal states with which to separate classes, but the same exponential dimension also degrades its optimization landscape and the tractability of evaluating its metric. By letting a classical network predict all gate parameters of a fixed ansatz, we isolate the reachable state manifold and its fidelity metric. We prove that this separability is already present on the unentangled manifold M unentangled = (CP 1) N, which saturates the 2 N maximal orthogonal capacity needed for classification, while entanglement adds states only at intermediate separations, which are costly to resolve under finite sampling. The same size carries costs. Global fidelity causes exponential gradient collapse across both unentangled (Θ(c-N)) and entangled (Θ(4-N)) manifolds; as fidelities concentrate, the fidelity signal-to-noise ratio at a fixed shot budget also decays exponentially in N; and because M unentangled already holds 2 N orthogonal states, expressive, unconstrained encoders under contrastive losses reach trivial minima by geometric shattering even without entanglement. We introduce Quantum Projective Metric Learning (QPMeL), an exact O(N) closed-form kernel on M unentangled that circumvents circuit simulation. QPMeL resolves gradient collapse via a curriculum annealing from a 1-local observable regime (restoring Θ(1/N 2) polynomial variance) to the global product kernel. Empirically, QPMeL as a complete design exceeds eight and matches two of 11 published quantum few-shot designs.

Sources

Related papers