Source-linked AI summary

Quantum embeddings for machine learning

Seth Lloyd, Maria Schuld, Aroosa Ijaz, Josh Izaac, Nathan Killoran

arXiv:2001.03622v2quant-ph

TL;DR

Quantum classifiers typically train measurements to distinguish data after feature-map encoding, while the embedding itself is not optimized for class separation. The paper proposes quantum metric learning, training embeddings to maximize Hilbert-space distances so that known measurements provide the linear-loss classifiers, while noting resource limits for near-term implementations.

  • Problem

    Quantum classifiers typically train the measurement rather than the embedding, leaving the objective of separating classes in Hilbert space as the central research gap.

  • Method

    The paper trains quantum embeddings to maximize class separation in Hilbert space and uses metric-dependent optimal measurements, including fidelity and Helstrøm classifiers.

  • Results

    Maximizing Hilbert-Schmidt distance minimizes the fidelity classifier’s linear-loss empirical risk, while maximizing trace distance minimizes the Helstrøm classifier’s risk.

  • Takeaways & Limitations

    The approach provides an analytic framework in which classifier power is expressed through finding embeddings that maximize distances between data clusters in Hilbert space.

  • Takeaways & Limitations

    The study does not determine whether quantum embeddings outperform classical machine learning methods.

Abstract

from arXiv · show

Quantum classifiers are trainable quantum circuits used as machine learning models. The first part of the circuit implements a quantum feature map that encodes classical inputs into quantum states, embedding the data in a high-dimensional Hilbert space; the second part of the circuit executes a quantum measurement interpreted as the output of the model. Usually, the measurement is trained to distinguish quantum-embedded data. We propose to instead train the first part of the circuit -- the embedding -- with the objective of maximally separating data classes in Hilbert space, a strategy we call quantum metric learning. As a result, the measurement minimizing a linear classification loss is already known and depends on the metric used: for embeddings separating data using the l1 or trace distance, this is the Helstrom measurement, while for the l2 or Hilbert-Schmidt distance, it is a simple overlap measurement. This approach provides a powerful analytic framework for quantum machine learning and eliminates a major component in current models, freeing up more precious resources to best leverage the capabilities of near-term quantum information processors.

I. QUANTUM EMBEDDINGS

Quantum embeddings map classical data into high-dimensional Hilbert spaces, where class ensembles can be compared using quantum distances. Trainable feature-map parameters are optimized with classical methods to represent inputs as quantum states.

  • Kernel methods embed data vectors in Hilbert space so linear algebra can exploit a representation preserving the data’s known metric.
  • An n-qubit quantum computer represents states in a Hilbert space of dimension 2^n and estimates overlaps through quantum measurements.
  • The trace distance compares class ensembles as Dtr(ρ, σ) = 1/2 tr(|ρ − σ|), while the Hilbert-Schmidt distance is Dhs(ρ, σ) = tr((ρ − σ)^2).
  • A quantum feature map embeds each classical input x as a quantum state |x⟩ using a circuit Φ(x, θ) with trainable parameters.
  • For binary classification, class A and B are represented by density-matrix ensembles ρ and σ formed by averaging embedded training states.

II. OPTIMAL MEASUREMENTS

Quantum classifiers measure embedded states, but under linear loss the optimal measurement is determined analytically by the metric separating the class ensembles. Trace-distance embeddings use Helstrøm measurements, whereas Hilbert-Schmidt embeddings use fidelity measurements.

  • A quantum classifier outputs f(x) = ⟨x|M|x⟩ and classifies by thresholding the expectation value of a Hermitian measurement operator.
  • Under linear loss, the empirical risk is ˆI[f] = −tr((ρ − σ)M), linking classifier optimization to the class-ensemble difference.
  • The fidelity classifier evaluates f_fid(x) = ⟨x|(ρ − σ)|x⟩, and its empirical risk equals −D_hs(ρ, σ), so Hilbert-Schmidt separation minimizes risk.
  • The Helstrøm classifier projects onto the positive and negative eigenspaces of ρ − σ and is optimal for state discrimination.
  • The Helstrøm classifier’s linear-loss risk is −2D_tr(ρ, σ), so maximizing trace distance minimizes its empirical risk.
  • On a 2-d moons dataset, separately trained ℓ1 and ℓ2 embeddings produced overall similar but non-identical decision boundaries.

III. TRAINING THE EMBEDDING IN PRACTICE

The practical training strategy focuses on Hilbert-Schmidt distance because it is measurable with relatively small circuits and encourages compact class embeddings. Its cost is estimated from within- and between-class overlaps.

  • Hilbert-Schmidt distance can be measured and optimized with a smaller quantum circuit than trace distance, which benefits near-term quantum computing.
  • For rank-one ensembles, the distances satisfy D_tr^2 = 1/2 D_hs, while Hilbert-Schmidt training minimizes C = 1 − 1/2D_hs.
  • The Hilbert-Schmidt cost uses repeated SWAP or inversion tests to estimate trρσ, trρ^2, and trσ^2.
  • The inter-cluster term trρσ measures overlap between class ensembles, while trρ^2 and trσ^2 measure intra-cluster overlap.
  • Hilbert-Schmidt optimization produces low-rank embeddings corresponding to tight Hilbert-space clusters and can improve generalization and measurement sampling requirements.

IV. NUMERICAL EXPERIMENTS

The experiments demonstrate trainable quantum embeddings with QAOA-inspired circuits and hybrid classical–quantum models. Toy examples show that training can form separated clusters and induce nonlinear decision boundaries in the original input space.

  • The experiments use PennyLane and a QAOA-inspired embedding ansatz with programmable one- and two-qubit operations.
  • Input features are encoded in Rx parameters, while trainable parameters θ determine the unitary Φ(x, θ) that prepares |x⟩.
  • A hybrid ResNet–quantum model learns a periodic data structure that suits Rx feature encoding.
  • In a one-dimensional toy example, training maps data into tight, linearly separable clusters on the Bloch sphere.
  • A linear boundary on the Bloch sphere can correspond to two linear decision boundaries in the original one-dimensional input space.
  • The study demonstrates trainable embeddings but does not determine whether quantum embeddings outperform classical machine-learning methods.

V. CAPACITY OF EMBEDDINGS ON NEAR-TERM QUANTUM DEVICES

The paper estimates the capacity and feasibility of quantum embeddings on near-term devices, using pulse bandwidth, coherence time, interaction strength, and circuit depth as constraints. Its examples indicate that large classical datasets can be embedded within device coherence times.

  • Embedding requirements: Quantum embeddings create n-qubit states from input-dependent pulse sequences Φ(x, θ)|0...0⟩.The input x specifies the data, while θ determines the embedding form.
  • Embedding requirements: The proposed intractability condition requires circuit depth O(n) so quantum information spreads through qubit-qubit interactions.This assumes individually addressable qubits driven by time-varying electromagnetic pulses with bandwidth Ω.
  • Device capacity: O(10^10) classical bits can be embedded within the decoherence time of a 100-qubit superconducting device under the stated parameters.The example uses Ω = 10 GHz, 10 bits per field-strength sample, and a 10^-3 s coherence time.
  • Hybrid demonstration: A hybrid ResNet–quantum circuit maps 512-dimensional outputs to 2-dimensional features and can perfectly separate two classes after 1500 Adagrad steps.The classical layer and quantum circuit are trained together using batches of two randomly sampled training points.
  • Device capacity: O(10^11) classical bits can be embedded within the decoherence time of a 100-qubit ion-trap device under the stated parameters.The example uses Ω = 100 MHz, 10 bits per sample, and a 1 s coherence time; depth 10^4 is supported by 10 kHz interactions.

VI. CONCLUSION

The conclusion frames quantum classifiers as embeddings followed by measurements and presents metric quantum learning as a strategy for training the embedding to separate classes. The approach links the embedding metric to a known measurement and focuses quantum resources on representation learning.

  • Conclusion: Metric quantum learning trains the quantum feature map to maximally separate data classes in Hilbert space.The paper presents this as an analytically promising and experimentally accessible approach.
  • Problem setup: Binary classification assigns a new input to one of two classes using a classifier that maps inputs to real-valued outputs and thresholds them.The default threshold is zero when no other threshold information is given.
  • Quantum classifier framework: A quantum embedding maps an input x to a quantum state |x⟩ through a feature map, often implemented by a data-dependent quantum circuit.A quantum classifier combines this embedding with a measurement whose expectation supplies the classifier output.
  • Existing models: Typical models train a variational circuit after the embedding to adjust the measurement basis, although most nonlinear discriminating power is determined by the embedding.The measurement output is a quadratic form ⟨x|M|x⟩ in the embedded state.
  • Quantum classifier framework: Quantum binary classification assigns embedded states to two data ensembles represented by mixed states ρ and σ formed from uniformly selected training states.The ensembles describe selecting embedded examples from the two training classes.

Appendix B: Quantum classifiers and state discrimination

This appendix distinguishes quantum classification from single-shot state discrimination and explains why the preferred measurement depends on the embedding and loss. It also notes a near-term implementation constraint for the Helstrøm classifier.

  • Classification versus state discrimination: Quantum state discrimination commonly uses minimum-error or unambiguous discrimination, whereas quantum classifiers can repeatedly prepare and measure states to estimate expectations.Repeated measurements make single-shot minimum-error considerations insufficient for the classifier setting.
  • Classification versus state discrimination: The best measurement for classification depends on the chosen embedding and loss rather than being universally optimal.This differs from single-shot discrimination, where the Helstrøm measurement is optimal for assigning an unknown state to one of two clusters.
  • Implementation feasibility: The appendix presents circuits for fidelity and Helstrøm classifiers, both with gate counts that do not grow with Hilbert-space dimension.The Helstrøm implementation can nevertheless require many copies of training-data registers for optimal sample complexity.
  • Implementation feasibility: The Helstrøm circuit is therefore not feasible for near-term quantum computers under the stated optimal-sample-complexity implementation.

Appendix C: The fidelity classifier

The fidelity classifier estimates overlaps between an input state and class-training states using SWAP or inversion tests. Its empirical risk under linear loss is minimized by maximizing the Hilbert-Schmidt distance between class ensembles.

  • Overlap measurements: SWAP tests estimate overlaps using 2n + 1 qubits without general requirements on the feature map, while inversion tests save resources when Φ† is implementable.Repeated ancilla measurements estimate |⟨c|x⟩|^2 for a training state c.
  • Relation to Helstrøm classification: The fidelity classifier is equivalent to the Helstrøm classifier but weights eigenvalues by magnitude instead of using only their signs.

Appendix D: The Helstrøm classifier

The Helstrøm classifier can be implemented using QPCA-based density-matrix exponentiation and quantum phase estimation. Measuring the first QPE qubit resolves eigenvalue signs, producing the classification signal.

  • The implementation is efficient when the exponentiated matrix rank grows at most polynomially with the number of qubits.For sampled pure states, the relevant matrix has rank at most two, supporting this condition.
  • The expectation ⟨σz⟩ determines assignment: positive values map inputs to ρ, while otherwise they map inputs to σ.Implementing this rule requires evaluating a non-smooth sign function.
  • QPCA implements the Helstrøm measurement through density-matrix exponentiation and quantum phase estimation.The approach encodes phases in ancilla computational-basis states before measuring the sign information.
  • Measuring the first qubit in the QPE register resolves the signs of eigenvalues of ρ − σ, weighted by overlaps with the corresponding eigenvectors.The result depends on a superposition of extracted phases rather than a single phase.

2. Sampling pure training states

The QPCA-based Helstrøm circuit reconstructs mixed-state expectations by averaging results from circuits using sampled pure training states. This sampling requirement prevents shortcut methods that rescale single-run estimates by unknown factors.

  • Each circuit run samples pure states |a⟩ and |b⟩ from the two classes and estimates the corresponding expectation ⟨σz⟩a,b.Averaging these pairwise expectations recovers the overall mixed-state expectation.
  • Averaging over sampled pairs is formally equivalent to taking the mixed-state quantum expectation with class-sampling probabilities pa and pb.The equivalence follows by averaging the circuit expectation tr{WηW†M} over the sampled states.
  • Unknown multiplicative factors from single-run pointer methods skew the ensemble average and cannot be used in this reconstruction.This restriction prevents several quantum phase-estimation shortcuts from reducing the circuit’s resources.

3. The Helstrøm measurement is efficient

The Helstrøm measurement is efficient because each sampled-state difference has constant rank, but near-term hardware still faces prohibitive register requirements. Better-trained embeddings increase eigenvalue magnitudes and ease sign estimation.

  • The sampled-state matrix |a⟩⟨a| − |b⟩⟨b| has rank 2 when |a⟩ ≠ |b⟩ and trace zero, with eigenvalues ±λ.The magnitude λ ranges from 1 for orthogonal states to 0 for identical states.
  • A successful embedding decreases inter-class overlaps and increases the average absolute eigenvalue, making its sign easier to estimate with QPE.The exponentiated matrix therefore remains low-rank while embedding quality improves phase-estimation distinguishability.
  • Despite efficient implementation, near-term hardware requires prohibitive numbers of registers to simulate the sampled-state difference for QPE.For time 1, δ = 0.01, and L = 10 QPE qubits, the circuit needs k = 100 copies of each state, or at least 2000n qubits.
Loading 2001.03622v2…