-
Notifications
You must be signed in to change notification settings - Fork 214
Add demo on loading classical data with low-depth circuits #1554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…nist/requirements.in and update the reference types in demonstrations_v2/low_depth_circuits_mnist/metadata.json
Your preview is ready 🎉!You can view your changes here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made an initial skim and left comments. Overall a very nice/complete first draft.
Still pending from my side:
- In depth review of the text for clarity
- In depth review of the code for efficiency and output
But basically I think 1 or two more rounds of review and this should be ready to go.
Low‑Depth Quantum Circuits”** (2025). We will discuss the following three steps: 1) Quantum image | ||
states, 2) Low-depth image circuits, 3) Training a small variational‑quantum‑circuit (VQC) | ||
classifier on the dataset. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't mind getting a bit more information about what we will discuss. For example, we can include a verb in each item of the list:
- Define how images can be encoded in quantum states
- Introduce low-depth image circuits to generate these states
- ...
(just examples, no need to use those)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this idea! Added in the latest commit.
|
||
|
||
###################################################################### | ||
# Downloading the quantum image dataset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can link the datasets page in here somewhere https://pennylane.ai/datasets/collection/low-depth-image-circuits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's a good spot to reference the dataset, also added :)
Co-authored-by: Diego <67476785+DSGuala@users.noreply.github.com>
Co-authored-by: Diego <67476785+DSGuala@users.noreply.github.com>
Co-authored-by: Diego <67476785+DSGuala@users.noreply.github.com>
Co-authored-by: Diego <67476785+DSGuala@users.noreply.github.com>
Co-authored-by: Diego <67476785+DSGuala@users.noreply.github.com>
Co-authored-by: Diego <67476785+DSGuala@users.noreply.github.com>
Co-authored-by: Diego <67476785+DSGuala@users.noreply.github.com>
Co-authored-by: Diego <67476785+DSGuala@users.noreply.github.com>
Co-authored-by: Diego <67476785+DSGuala@users.noreply.github.com>
Co-authored-by: Diego <67476785+DSGuala@users.noreply.github.com>
Co-authored-by: Diego <67476785+DSGuala@users.noreply.github.com>
Co-authored-by: Diego <67476785+DSGuala@users.noreply.github.com>
Co-authored-by: Diego <67476785+DSGuala@users.noreply.github.com>
Co-authored-by: Diego <67476785+DSGuala@users.noreply.github.com>
…details one the three steps
# overlap between the exact FRQI state $ | ||
# \|:raw-latex:`\psi`\_{:raw-latex:`\text{exact}`}:raw-latex:`\rangle `$ and its 4-layer | ||
# center-sequential approximation :math:`|\psi_{\text{circ.}}\rangle`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not properly formatted, :math: and so on
# | ||
# On the right we decode the states back into pixel space. In line with the histogram, the | ||
# reconstructed “1” is virtually indistinguishable from its original, whereas the reconstructed “0” | ||
# shows minor blurring. By selecting a deeper circuit the quality of the reconstructed images could be |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# shows minor blurring. By selecting a deeper circuit the quality of the reconstructed images could be | |
# shows minor blurring. By selecting a deeper, circuit the quality of the reconstructed images could be |
# practical quantum machine learning approaches. | ||
# | ||
|
||
###################################################################### | ||
# References | ||
# ---------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# practical quantum machine learning approaches. | |
# | |
###################################################################### | |
# References | |
# ---------- | |
# practical quantum machine learning approaches. | |
# | |
# | |
# References | |
# ---------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for some reason, the References section is rendering without the underscore line. I am suggesting a few things to fix it
# Conclusion | ||
# ~~~~~~~~~~ | ||
# | ||
# | In this notebook we have demonstrated the use of low-depth quantum circuits to load and | ||
# subsequently classify (a subset of) the MNIST dataset. | ||
# | By filtering to specific target labels, constructing parametrized circuits from the provided | ||
# layouts, and evaluating their states and fidelities, we have gained hands-on experience with | ||
# quantum machine learning workflows on real data encodings. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Conclusion | |
# ~~~~~~~~~~ | |
# | |
# | In this notebook we have demonstrated the use of low-depth quantum circuits to load and | |
# subsequently classify (a subset of) the MNIST dataset. | |
# | By filtering to specific target labels, constructing parametrized circuits from the provided | |
# layouts, and evaluating their states and fidelities, we have gained hands-on experience with | |
# quantum machine learning workflows on real data encodings. | |
# Conclusion | |
# ~~~~~~~~~~ | |
# | |
# In this notebook we have demonstrated the use of low-depth quantum circuits to load and | |
# subsequently classify (a subset of) the MNIST dataset. | |
# By filtering to specific target labels, constructing parametrized circuits from the provided | |
# layouts, and evaluating their states and fidelities, we have gained hands-on experience with | |
# quantum machine learning workflows on real data encodings. |
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:
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.
Promote the new
qml.data
feature for loading datasets and show a PennyLane implementation of a recent paper on efficient data loading for QML.QML researchers, students, and practitioners interested in efficient data loading techniques and their application to image classification tasks.
Quantum Machine Learning, Quantum Datasets, Image Loading, Low-depth circuits, Variational Quantum Classifier, MNIST, PennyLane, qml.data
(more details here)