qml icon indicating copy to clipboard operation
qml copied to clipboard

Differentiable error mitigation

Open Qottmann opened this issue 2 years ago • 15 comments

A simple notebook showing off the new differentiable error mitigation functions with ZNE https://github.com/PennyLaneAI/pennylane/pull/2757 as well as trying to initiate people also to think of variationally optimizing the mitigation scheme itself.

Initial commit only contains a rough sketch of the contents to enable early feedback on what the demo should contain.

Qottmann avatar Jul 06 '22 19:07 Qottmann

Thank you for opening this pull request.

You can find the built site at this link.

Deployment Info:

  • Pull Request ID: 529
  • Deployment SHA: aa94c5565575c99f8a90f8c00d8656808ffc996d (The Deployment SHA refers to the latest commit hash the docs were built from)

Note: It may take several minutes for updates to this pull request to be reflected on the deployed site.

github-actions[bot] avatar Jul 06 '22 20:07 github-actions[bot]

Is there a way to have fancy latex symbols like \lightning, in the demo? E.g. using \usepackage{wasysym} or stmaryrd. I think it makes a lot of sense here and would make it much more readable (or maybe I just like the symbol 😄 )

Qottmann avatar Jul 07 '22 22:07 Qottmann

@Qottmann you could use emojis (⚡) directly in the demo! Simply by copying and pasting the emoji directly into the text, or by using a VSCode plugin that allows you to insert emojis, should work.

josh146 avatar Jul 07 '22 22:07 josh146

Amazing! That is the last possibility I would have tried for latex text 😆

Qottmann avatar Jul 08 '22 15:07 Qottmann

Oh do you need to use the lightning symbol inside larger latex mathematical equations?

josh146 avatar Jul 08 '22 16:07 josh146

Yes, and it is working!

Qottmann avatar Jul 08 '22 21:07 Qottmann

Do I have to manually tell the repo to use the latest master of pennylane? The deployment fails due to an ImportError: cannot import name 'fold_global' from 'pennylane.transforms'

Qottmann avatar Jul 13 '22 22:07 Qottmann

@Qottmann you need to change the base of the PR to point to the dev branch:

  • the master branch of the QML repo is pinned to the released version of PL
  • the dev branch is pinned to the GitHub master version of PL

image

I just changed this for you, so retriggering the build should now work :)

josh146 avatar Jul 14 '22 02:07 josh146

Hello @KetpuntoG and @CatalinaAlbornoz , I tagged you for a review for this demo in which we want to showcase new functionalities added in https://github.com/PennyLaneAI/pennylane/pull/2757 as well as initiate discussion about differentiating mitigation parameters themselves. Do you think it is realistic to have this demo ready for publication with the new release, which includes these new features?

Qottmann avatar Jul 14 '22 21:07 Qottmann

Hello @KetpuntoG and @CatalinaAlbornoz , I tagged you for a review for this demo in which we want to showcase new functionalities added in PennyLaneAI/pennylane#2757 as well as initiate discussion about differentiating mitigation parameters themselves. Do you think it is realistic to have this demo ready for publication with the new release, which includes these new features?

Yes, I think it is possible! It's going to take some work, but it makes sense to have it ready 🚀

KetpuntoG avatar Jul 14 '22 22:07 KetpuntoG

I just found this demo, it would be good to quote it at some point

KetpuntoG avatar Aug 10 '22 19:08 KetpuntoG

This demo here (kind of) outdates this older demo, as it showcases the same functionality, but now with proprietary PennyLane functions that can be differentiated. This other demo is also more a mitiq than a PennyLane demo. I dont think it should be removed, but I would not advertise it here because it could be confusing. What do you think?

Qottmann avatar Aug 10 '22 19:08 Qottmann

This demo here (kind of) outdates this older demo, as it showcases the same functionality, but now with proprietary PennyLane functions that can be differentiated. This other demo is also more a mitiq than a PennyLane demo. I dont think it should be removed, but I would not advertise it here because it could be confusing. What do you think?

Ah great, glad to hear you had your eye on it. Forget it then 😄

KetpuntoG avatar Aug 10 '22 20:08 KetpuntoG

The last two deployments for some reason did not render my changes, is this a new CI feature? I.e. I changed some formatting but not the code itself, is it somehow recognizing that and hence not re-running the demo?

edit: resolved - browser cache

Qottmann avatar Aug 11 '22 13:08 Qottmann

It should be good now. @KetpuntoG can you give it a second pass?

Qottmann avatar Aug 11 '22 14:08 Qottmann

From my side this is perfect, thank you very much for the changes! We will carry out a last review and if all goes well next week it will be published 😄

KetpuntoG avatar Aug 16 '22 16:08 KetpuntoG

I could not get the suggested latex expression inside the matplotlib part rendered so I reversed that change. I could render it locally, so should be good now with the latest commit.

@isaacdevlugt I addressed your comments.

@larawatson Same, the only thing left is the "with respect to", not sure how to resolve that. Since we are talking about derivatives it would be okay for me to have "with respect to" appear multiple times in the last paragraph.

I also put it into "optimization" section since that felt more adequate (was "getting started" before). Let me know if you want to change that.

Qottmann avatar Aug 19 '22 21:08 Qottmann

Nice work @Qottmann 🥳

isaacdevlugt avatar Aug 22 '22 15:08 isaacdevlugt