Table of Contents
Fetching ...

Typical Machine Learning Datasets as Low-Depth Quantum Circuits

Florian J. Kiwit, Bernhard Jobst, Andre Luckow, Frank Pollmann, Carlos A. Riofrío

TL;DR

This work tackles the data-loading bottleneck in quantum machine learning by designing low-depth, tensor-network–inspired circuits that efficiently encode realistic image data into quantum states. It introduces FRQI and MCRQI encodings, with hierarchical indexing and patching/multi-copy strategies, and presents an optimization pipeline to realize these states with circuits whose depth scales linearly with qubits while keeping qubit counts logarithmic in data size. The authors benchmark various quantum classifiers (VQCs, nonlinear variants, quantum-kernel SVM) and tensor-network models on MNIST, Fashion-MNIST, CIFAR-10, and Imagenette, both in uncompressed and compressed forms, finding that nonlinearities improve performance on simple datasets but that CNNs still outperform on harder tasks. The released datasets and code enable community benchmarking, highlighting that while low-depth encodings are practical today, achieving parity with state-of-the-art classical methods will require further architectural innovations that introduce or exploit nonlinearities in processing quantum-encoded data.

Abstract

Quantum machine learning (QML) is an emerging field that investigates the capabilities of quantum computers for learning tasks. While QML models can theoretically offer advantages such as exponential speed-ups, challenges in data loading and the ability to scale to relevant problem sizes have prevented demonstrations of such advantages on practical problems. In particular, the encoding of arbitrary classical data into quantum states usually comes at a high computational cost, either in terms of qubits or gate count. However, real-world data typically exhibits some inherent structure (such as image data) which can be leveraged to load them with a much smaller cost on a quantum computer. This work further develops an efficient algorithm for finding low-depth quantum circuits to load classical image data as quantum states. To evaluate its effectiveness, we conduct systematic studies on the MNIST, Fashion-MNIST, CIFAR-10, and Imagenette datasets. The corresponding circuits for loading the full large-scale datasets are available publicly as PennyLane datasets and can be used by the community for their own benchmarks. We further analyze the performance of various quantum classifiers, such as quantum kernel methods, parameterized quantum circuits, and tensor-network classifiers, and we compare them to convolutional neural networks. In particular, we focus on the performance of the quantum classifiers as we introduce nonlinear functions of the input state, e.g., by letting the circuit parameters depend on the input state.

Typical Machine Learning Datasets as Low-Depth Quantum Circuits

TL;DR

This work tackles the data-loading bottleneck in quantum machine learning by designing low-depth, tensor-network–inspired circuits that efficiently encode realistic image data into quantum states. It introduces FRQI and MCRQI encodings, with hierarchical indexing and patching/multi-copy strategies, and presents an optimization pipeline to realize these states with circuits whose depth scales linearly with qubits while keeping qubit counts logarithmic in data size. The authors benchmark various quantum classifiers (VQCs, nonlinear variants, quantum-kernel SVM) and tensor-network models on MNIST, Fashion-MNIST, CIFAR-10, and Imagenette, both in uncompressed and compressed forms, finding that nonlinearities improve performance on simple datasets but that CNNs still outperform on harder tasks. The released datasets and code enable community benchmarking, highlighting that while low-depth encodings are practical today, achieving parity with state-of-the-art classical methods will require further architectural innovations that introduce or exploit nonlinearities in processing quantum-encoded data.

Abstract

Quantum machine learning (QML) is an emerging field that investigates the capabilities of quantum computers for learning tasks. While QML models can theoretically offer advantages such as exponential speed-ups, challenges in data loading and the ability to scale to relevant problem sizes have prevented demonstrations of such advantages on practical problems. In particular, the encoding of arbitrary classical data into quantum states usually comes at a high computational cost, either in terms of qubits or gate count. However, real-world data typically exhibits some inherent structure (such as image data) which can be leveraged to load them with a much smaller cost on a quantum computer. This work further develops an efficient algorithm for finding low-depth quantum circuits to load classical image data as quantum states. To evaluate its effectiveness, we conduct systematic studies on the MNIST, Fashion-MNIST, CIFAR-10, and Imagenette datasets. The corresponding circuits for loading the full large-scale datasets are available publicly as PennyLane datasets and can be used by the community for their own benchmarks. We further analyze the performance of various quantum classifiers, such as quantum kernel methods, parameterized quantum circuits, and tensor-network classifiers, and we compare them to convolutional neural networks. In particular, we focus on the performance of the quantum classifiers as we introduce nonlinear functions of the input state, e.g., by letting the circuit parameters depend on the input state.
Paper Structure (17 sections, 28 equations, 13 figures, 4 tables)

This paper contains 17 sections, 28 equations, 13 figures, 4 tables.

Figures (13)

  • Figure 1: Hierarchical ordering of the pixels and encoding patches of an image. (a) We choose a hierarchical ordering for enumerating the pixels when encoding an image according to Eq. \ref{['eq:target_state']}latorre2005imagecompressionentanglementLe2011Le2011_2jobst2023efficientmpsrepresentationsquantum. In this order, the first two bits of the index labeling the position of the pixel denote the quadrant it lies in, the next two bits label its subquadrant, and so on. (b) To interpolate between the FRQI- or MCRQI-based encodings and the rotation encoding, we can encode patches of the image and take a product state of the individually encoded patches as an input state Dilip2022. This is shown here for four patches.
  • Figure 2: Illustration of quantum circuits inspired by MPSs. The left side shows a circuit with a staircase pattern with two layers (represented in turquoise and pink), where two-qubit gates are applied sequentially, corresponding to a right-canonical MPS. The right side shows the proposed circuit architecture corresponding to an MPS in mixed canonical form. By effectively shifting the gates with the dashed outlines to the right, the gates are applied sequentially outward starting from the center. This reduces the circuit depth while maintaining its expressivity.
  • Figure 3: Approximate analytical decomposition of the target state to initialize circuit layers. In the first step, if we already have layers of the circuit, we contract their conjugate transpose with the target state, partially disentangling it. Next, we have the partially disentangled target state and truncate it to an MPS with a bond dimension of two. This truncated MPS corresponds exactly to one layer of a center-sequential circuit, which we can use as a new first layer of the multi-layer circuit.
  • Figure 4: Sweeping optimization algorithm. The sweeping algorithm maximizes the fidelity of the state generated by the quantum circuit and the target state by one-by-one replacing each unitary gate in the circuit with the one maximizing the fidelity. For each unitary $U$, we can compute its environment tensor $E$, such that the fidelity is given by $\Tr(E U)$. If we consider general two-qubit gates $U \in SU(4)$, the updated gate can be obtained from the singular value decomposition (SVD) of the environment $E = X \Lambda Y^{\dagger}$ as $U \to U' = YX^{\dagger}$Evenbly2009Lin2021Higham1989. Similar update rules exist for the other gate sets we consider. The algorithm is efficient because we can cache partial contractions of the environment tensor as an MPS since both the target state and the quantum circuit are lowly entangled states.
  • Figure 5: Scaling of the infidelity with an increasing number of CNOTs. We encode $100$ randomly selected images ($10$ per class) from the MNIST, Fashion-MNIST, CIFAR-10 and Imagenette datasets as discussed in Sec. \ref{['sec:encoding']}. The markers show the average infidelity between the exactly encoded states and their quantum circuit approximation (defined as $1 - \left|\braket{\psi_{\text{exact}}}{\psi_{\text{circ.}}}\right|^2$) plotted against the number of CNOTs in the circuit using sparse (blue circles), special orthogonal (orange squares) and general unitary (green triangles) two-qubit gates. The shaded areas show the $25$th--$75$th percentiles, the dashed lines show the results of fitting an algebraic decay $f(x)=\alpha \, x^{-\beta}$ to the data. The fitted values, including their uncertainties, are given in Table \ref{['tab:encoding_cnot_infid']} in the appendix. We observe that the infidelity of the circuits using special orthogonal or unitary gates decays in the same way, with the difference that the circuits utilizing special orthogonal gates save on CNOT gates due to their cheaper decomposition.
  • ...and 8 more figures