Skip to content

Demo DQI #1524

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

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open

Demo DQI #1524

wants to merge 34 commits into from

Conversation

daniela-angulo
Copy link
Contributor

Before submitting

Please complete the following checklist when submitting a PR:

  • Ensure that your tutorial executes correctly, and conforms to the
    guidelines specified in the README.

  • Remember to do a grammar check of the content you include.

  • All tutorials conform to
    PEP8 standards.
    To auto format files, simply pip install black, and then
    run black -l 100 path/to/file.py.

When all the above are checked, delete everything above the dashed
line and fill in the pull request template.


Title:
Decoded quantum interferometry

Summary:

Relevant references:

Possible Drawbacks:

Related GitHub Issues:


If you are writing a demonstration, please answer these questions to facilitate the marketing process.

  • GOALS — Why are we working on this now?

    Eg. Show a PL implementation of a recent paper.

  • AUDIENCE — Who is this for?

    Eg. Researchers.

  • KEYWORDS — What words should be included in the marketing post?

  • Which of the following types of documentation is most similar to your file?
    (more details here)

  • Tutorial
  • Demo
  • How-to

Copy link

👋 Hey, looks like you've updated some demos!

🐘 Don't forget to update the dateOfLastModification in the associated metadata files so your changes are reflected in Glass Onion (search and recommendations).

Please hide this comment once the field(s) are updated. Thanks!

Copy link

Your preview is ready 🎉!

You can view your changes here

@daniela-angulo daniela-angulo changed the title Demo dqi files Demo DQI Aug 19, 2025
@dwierichs dwierichs self-requested a review August 20, 2025 08:24
Copy link
Contributor

@dwierichs dwierichs left a comment

Choose a reason for hiding this comment

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

Amazing work packing such a complex work into a demo, @daniela-angulo 🚀 💪

I left quite a few comments, a good bit of which are just tiny code ideas and subjective suggestions.

Overall, the flow of the demo is great. I think it would benefit from (additional) markers here or there that make clear to readers that they can't expect to get all details from the demo. I'd suggest to reduce code duplication between the DQI function definitions to not interrupt the nice flow and improve readability. :)

Now that we have this nice code, is there any way we can apply it to a larger problem? 👀 😁

return qml.counts(wires=range(0, m + 1))


print(DQI(m, n, l))
Copy link
Contributor

Choose a reason for hiding this comment

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

Horizontal scrollbar in output. Might be fine, just wanted to bring it up.

# the random sampling done af first.
#

dev = qml.device("default.qubit", wires=range(0, 1 + m + n), shots=n_samples)
Copy link
Contributor

Choose a reason for hiding this comment

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

See above :)

Comment on lines +101 to +108
# The objective function :math:`f(\mathbf{x})` has a very sparse Hadamard spectrum. This means that
# there are only :math:`m` non-zero “frequency” components :math:`\mathbf{b_i}` out of :math:`2^n`
# possible in :math:`f(\mathbf{x})`. Consequently, preparing the state
# :math:`\sum_{\mathbf{x}} f(\mathbf{x})|\mathbf{x}\rangle` can be seen as a simple task by creating
# an appropriate superposition of the :math:`m` amplitudes and apply a Hadamard transform. The same
# principle holds for preparing :math:`|P(f)\rangle`, even though it is not as simple, we will still first
# prepare the Hadamard transform of the state, taking advantage of its sparse spectrum, and then
# transform back. The Hadamard transform of :math:`P(f(\mathbf{x}))` is:
Copy link
Contributor

Choose a reason for hiding this comment

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

This paragraph marks the beginning of where I would have to dive into the literature and//or accept that I won't understand all details while reading.
This is totally fine, given the complexity of the topic/algorithm, but it felt a little bit abrupt, using the notions of Hadamard spectrum and frequencies.

Could you maybe ease a bit more into things becoming hard from here on? :) Maybe just with a tiny disclaimer that not all technical details will be explained or so? 🤔

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.

4 participants