Abstract
Amplitude embedding (AE) is essential in quantum machine learning (QML) for encoding classical data onto quantum circuits. However, conventional AE methods suffer from deep, variable-length circuits that introduce high output error due to extensive gate usage and variable error rates across samples, resulting in noise-driven inconsistencies that degrade model accuracy. We introduce EnQode, a fast AE technique based on symbolic representation that addresses these limitations by clustering dataset samples and solving for cluster mean states through a low-depth, machine-specific ansatz. Optimized to reduce physical gates and SWAP operations, EnQode ensures all samples face consistent, low noise levels by standardizing circuit depth and composition. With over 90% fidelity in data mapping, EnQode enables robust, high-performance QML on noisy intermediate-scale quantum (NISQ) devices. Our open-source solution provides a scalable and efficient alternative for integrating classical data with quantum models.
Introduction
To perform Quantum Machine Learning (QML) on classical data, the data must first be "embedded" into a quantum state. The gold standard for this is Amplitude Embedding (AE), which maps a vector of numbers to the amplitudes of a quantum wavefunction. However, traditional AE has two major flaws on today’s Noisy Intermediate-Scale Quantum (NISQ) devices:
- Circuit Depth: Exact AE often requires incredibly deep circuits with many gates. On noisy hardware, more gates mean more errors, often destroying the quantum state before the computation even begins.
- Inconsistency: Traditional methods produce circuits of varying lengths depending on the specific data values. This means different data samples experience different levels of noise, creating "noise-driven inconsistencies" that make it nearly impossible for a QML model to learn effectively.
EnQode is a novel framework that solves this "noise and depth" problem by using an approximate, cluster-based approach to data encoding. By replacing deep, variable-length circuits with short, standardized, and hardware-optimized ones, it achieves a 28× reduction in circuit depth and a 14× improvement in state fidelity on noisy quantum simulators.
Methodology
EnQode shifts the goal from exact embedding to high-fidelity approximate embedding using a hardware-aware strategy. The workflow involves several key stages:
- Clustering for Efficiency: Instead of solving the embedding problem for every single data point from scratch, EnQode uses k-means clustering to group similar data samples. It then optimizes a "mean" embedding circuit for each cluster.
- Hardware-Optimized Ansatz: The researchers designed a specific circuit structure (an ansatz) tailored for IBM’s quantum hardware. It maximizes the use of "virtual" $R_z$ gates (implemented in software with zero error) and uses a sparse $CY$ (controlled-Y) gate layout to avoid expensive SWAP operations.
- Symbolic Representation: Rather than using slow numerical simulations to find circuit parameters, the authors derived an analytical (symbolic) function for the state vector. This allows for fast, gradient-based optimization (L-BFGS) to find the best parameters in seconds.
- Transfer Learning: When a new data sample arrives, EnQode identifies its nearest cluster and uses that cluster's optimized parameters as a starting point. This "warm start" allows for near-instantaneous generation of high-fidelity embedding circuits.
Experimental Evaluation
The researchers evaluated EnQode using three standard machine learning benchmarks: MNIST (handwritten digits), Fashion-MNIST (clothing images), and CIFAR-10 (color images). For all datasets, Principal Component Analysis (PCA) was used to reduce dimensionality before embedding the features into 8-qubit circuits.
Key Results
Compared to the standard "Baseline" (exact) amplitude embedding:
- Massive Compression: EnQode reduced circuit depth by over 28× and total gate counts by 12×.
- Zero Variability: While the Baseline's circuit length fluctuated wildly depending on the data, EnQode’s circuits remained perfectly consistent.
- Superior Fidelity under Noise: In noisy IBM hardware simulations, EnQode improved state fidelity by over 14×. While the Baseline's deep circuits collapsed under noise, EnQode maintained over 90% fidelity in ideal settings and remained robust in noisy ones.
- Speed: Compilation time variability was reduced by 3×, facilitating real-time QML applications.
Discussion and Insights
A core insight of this work is that standardized noise is better than low (but variable) noise. By fixing the circuit depth for every sample, EnQode ensures a uniform error profile. This consistency is often more important for training QML models than achieving perfect fidelity on a few samples while failing on others. Furthermore, the paper highlights that since $R_z$ gates are essentially "free" (zero noise) on many platforms, they should be the primary tool for parameterization in NISQ-era algorithms.
Limitations and Future Work
EnQode is an approximate method. For certain niche algorithms that require 100% exact amplitudes, the >90% fidelity might introduce a small amount of "representation error," though this is a worthy trade-off for the massive reduction in hardware noise. Additionally, the current ansatz is optimized for IBM’s heavy-hexagonal connectivity. While the method is general, the specific circuit layout would need to be redesigned for different architectures like trapped ions or neutral atoms. Future work will explore how the number of clusters ($k$) needs to scale as datasets grow from thousands to millions of samples.
Summary updated