Loading Classical Data with Low-Depth Circuits
Overview
Loading Classical Data with Low-Depth Circuits
This PennyLane demo shows how to load classical image data into quantum states using shallow circuits, following the paper 'Typical Machine Learning Datasets as Low-Depth Quantum Circuits' by Kiwit and collaborators. Encoding arbitrary data is generally expensive, but real-world images carry structure that can be exploited. The tutorial first defines how an image with a power-of-two number of pixels is mapped to a quantum state whose address register holds pixel positions and whose extra color qubits encode intensities, using the flexible representation of quantum images (FRQI) for grayscale and the multi-channel representation (MCRQI) for color. It then explains why such image states are only weakly entangled and are therefore well approximated by matrix-product states, so that instead of the exponential gate count required for exact preparation, an approximate circuit inspired by an MPS in mixed-canonical form prepares them with a depth scaling only linearly in the number of qubits. Finally the demo trains and evaluates a small variational quantum classifier on the encoded dataset. It matters because efficient, low-depth data loading is a central bottleneck for near-term quantum machine learning, and this structure-aware approach makes encoding realistic datasets substantially more practical on hardware.
Run it
pip install -r requirements.txt
python demo.py
Source and license
Imported from demonstrations_v2/low_depth_circuits_mnist/demo.py in PennyLaneAI/demos at c52c0abeb5122218aa96b38eea848864cce7323f, under the Apache License 2.0. Original authors: Xanadu and the PennyLane community. The upstream LICENSE is included alongside this example.
This entry was created automatically from publicly available records. QCR links to public sources and only stores repository content where the license permits redistribution.
Publication
doi:10.48550/arxiv.2505.03399Florian J. Kiwit, Bernhard Jobst, Andre Luckow, Frank Pollmann, Carlos A. Riofrío
Versions
Cite all versions? Use the base QCR ID to always reference the latest version of this entry.
Join the Discussion
Comments (0)
No comments yet. Be the first to share your thoughts!