Skip to content

Commit 88a3653

Browse files
fkiwitDSGualadaniela-angulo
authored
Add demo on loading classical data with low-depth circuits (#1554)
**Title:** Add demo on loading classical data with low-depth circuits **Summary:** This pull request adds a new demonstration on how to efficiently load classical image data into quantum states using low-depth quantum circuits, based on the paper "Typical Machine Learning Datasets as Low‑Depth Quantum Circuits". The demo uses the MNIST dataset and shows how to train a variational quantum classifier on the encoded data. This demo leverages the new qml.data module for dataset loading. **Relevant references:** - "Typical Machine Learning Datasets as Low‑Depth Quantum Circuits" (2025) [1] - "A flexible representation of quantum images for polynomial preparation, image compression, and processing operations" [2, 3] - "A Multi-Channel Representation for images on quantum computers using the RGBα color space" [4, 5] - "Efficient MPS representations and quantum circuits from the Fourier modes of classical image data" [6] **Possible Drawbacks:** The dataset required for this demo is large (~1GB), which might be a consideration for users with limited bandwidth or storage. **Related GitHub Issues:** None ---- If you are writing a demonstration, please answer these questions to facilitate the marketing process. * GOALS — Why are we working on this now? Promote the new `qml.data` feature for loading datasets and show a PennyLane implementation of a recent paper on efficient data loading for QML. * AUDIENCE — Who is this for? QML researchers, students, and practitioners interested in efficient data loading techniques and their application to image classification tasks. * KEYWORDS — What words should be included in the marketing post? Quantum Machine Learning, Quantum Datasets, Image Loading, Low-depth circuits, Variational Quantum Classifier, MNIST, PennyLane, qml.data * Which of the following types of documentation is most similar to your file? (more details [here](https://www.notion.so/xanaduai/Different-kinds-of-documentation-69200645fe59442991c71f9e7d8a77f8)) - [ ] Tutorial - [x] Demo - [ ] How-to --------- Co-authored-by: Diego <67476785+DSGuala@users.noreply.github.com> Co-authored-by: Daniela Angulo <42325731+daniela-angulo@users.noreply.github.com> Co-authored-by: Diego <diego_guala@hotmail.com>
1 parent 14db0fa commit 88a3653

8 files changed

Lines changed: 737 additions & 0 deletions

File tree

49.3 KB
Loading
47 KB
Loading
12.2 KB
Loading
10.2 KB
Loading
3.13 KB
Loading

demonstrations_v2/low_depth_circuits_mnist/demo.py

Lines changed: 613 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
{
2+
"title": "Loading classical data with low-depth circuits",
3+
"authors": [
4+
{
5+
"username": "flokiwit"
6+
},
7+
{
8+
"username": "bernhard"
9+
},
10+
{
11+
"username": "criofrio"
12+
}
13+
],
14+
"executable_stable": true,
15+
"executable_latest": true,
16+
"dateOfPublication": "2025-12-04T00:00:00+00:00",
17+
"dateOfLastModification": "2025-12-04T00:00:00+00:00",
18+
"categories": [
19+
"Quantum Machine Learning"
20+
],
21+
"tags": [],
22+
"previewImages": [
23+
{
24+
"type": "thumbnail",
25+
"uri": "/_static/demo_thumbnails/regular_demo_thumbnails/pennylane-demo-loading-data-low-depth-thumbnail.png"
26+
},
27+
{
28+
"type": "large_thumbnail",
29+
"uri": "/_static/demo_thumbnails/opengraph_demo_thumbnails/pennylane-demo-loading-data-low-depth-open-graph.png"
30+
}
31+
],
32+
"seoDescription": "This demo shows how to efficiently encode classical image data into quantum states using low-depth circuits, and train a variational quantum classifier on a low-depth MNIST dataset.",
33+
"doi": "",
34+
"references": [
35+
{
36+
"id": "kiwit2025",
37+
"type": "article",
38+
"title": "Typical Machine Learning Datasets as Low-Depth Quantum Circuits",
39+
"authors": "Kiwit, F.J., Jobst, B., Luckow, A., Pollmann, F., Riofrío, C.A.",
40+
"year": "2025",
41+
"journal": "Quantum Sci. Technol.",
42+
"doi": "10.1088/2058-9565/ae0123",
43+
"url": "https://doi.org/10.1088/2058-9565/ae0123"
44+
},
45+
{
46+
"id": "le2011a",
47+
"type": "article",
48+
"title": "A flexible representation of quantum images for polynomial preparation, image compression, and processing operations",
49+
"authors": "Le, P.Q., Dong, F., Hirota, K.",
50+
"year": "2011",
51+
"journal": "Quantum Inf. Process",
52+
"doi": "10.1007/s11128-010-0177-y",
53+
"url": "https://doi.org/10.1007/s11128-010-0177-y"
54+
},
55+
{
56+
"id": "le2011b",
57+
"type": "other",
58+
"title": "A Flexible Representation and Invertible Transformations for Images on Quantum Computers",
59+
"authors": "Le, P.Q., Iliyasu, A.M., Dong, F., Hirota, K.",
60+
"year": "2011",
61+
"booktitle": "New Advances in Intelligent Signal Processing. Studies in Computational Intelligence, vol 372",
62+
"publisher": "Springer, Berlin, Heidelberg",
63+
"doi": "10.1007/978-3-642-11739-8_9",
64+
"url": "https://doi.org/10.1007/978-3-642-11739-8_9"
65+
},
66+
{
67+
"id": "sun2011",
68+
"type": "other",
69+
"title": "A Multi-Channel Representation for Images on Quantum Computers Using the RGBα Color Space",
70+
"authors": "Sun, B. et al.",
71+
"year": "2011",
72+
"booktitle": "2011 IEEE 7th International Symposium on Intelligent Signal Processing, Floriana, Malta",
73+
"pages": "1–6",
74+
"doi": "10.1109/WISP.2011.6051718",
75+
"url": "https://doi.org/10.1109/WISP.2011.6051718"
76+
},
77+
{
78+
"id": "sun2013",
79+
"type": "article",
80+
"title": "An RGB Multi-Channel Representation for Images on Quantum Computers",
81+
"authors": "Sun, B., Iliyasu, A., Yan, F., Dong, F., Hirota, K.",
82+
"year": "2013",
83+
"journal": "J. Adv. Comput. Intell. Intell. Inform.",
84+
"volume": "17",
85+
"number": "3",
86+
"pages": "404–417",
87+
"doi": "10.20965/jaciii.2013.p0404",
88+
"url": "https://doi.org/10.20965/jaciii.2013.p0404"
89+
},
90+
{
91+
"id": "jobst2024",
92+
"type": "article",
93+
"title": "Efficient MPS representations and quantum circuits from the Fourier modes of classical image data",
94+
"authors": "Jobst, B., Shen, K., Riofrío, C.A., Shishenina, E., Pollmann, F.",
95+
"year": "2024",
96+
"journal": "Quantum",
97+
"volume": "8",
98+
"pages": "1544",
99+
"doi": "10.22331/q-2024-12-03-1544",
100+
"url": "https://doi.org/10.22331/q-2024-12-03-1544"
101+
}
102+
],
103+
"basedOnPapers": ["10.1088/2058-9565/ae0123"],
104+
"referencedByPapers": [],
105+
"relatedContent": [
106+
{
107+
"type": "demonstration",
108+
"id": "tutorial_constant_depth_mps_prep",
109+
"weight": 1.0
110+
},
111+
{
112+
"type": "demonstration",
113+
"id": "tutorial_adversarial_attacks_QML",
114+
"weight": 1.0
115+
},
116+
{
117+
"type": "demonstration",
118+
"id": "tutorial_initial_state_preparation",
119+
"weight": 0.8
120+
}
121+
]
122+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
autoray==0.8
2+
tqdm==4.67.1

0 commit comments

Comments
 (0)