Skip to content

Conversation

fkiwit
Copy link

@fkiwit fkiwit commented Sep 22, 2025

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)
  • Tutorial
  • Demo
  • How-to

Copy link

Your preview is ready 🎉!

You can view your changes here

Copy link
Contributor

@DSGuala DSGuala left a 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.

Comment on lines 12 to 14
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.
Copy link
Contributor

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:

  1. Define how images can be encoded in quantum states
  2. Introduce low-depth image circuits to generate these states
  3. ...

(just examples, no need to use those)

Copy link
Author

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
Copy link
Contributor

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

Copy link
Author

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 :)

DSGuala and others added 16 commits September 29, 2025 17:52
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>
Comment on lines +221 to +223
# 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`.
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# 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

Comment on lines +500 to +505
# practical quantum machine learning approaches.
#

######################################################################
# References
# ----------
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# practical quantum machine learning approaches.
#
######################################################################
# References
# ----------
# practical quantum machine learning approaches.
#
#
# References
# ----------

Copy link
Contributor

@daniela-angulo daniela-angulo Oct 14, 2025

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

Comment on lines +486 to +493
# 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants