Skip to content
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

Remove code being deprecated in v0.39 #1220

Merged
merged 17 commits into from
Oct 3, 2024
Merged

Remove code being deprecated in v0.39 #1220

merged 17 commits into from
Oct 3, 2024

Conversation

mudit2812
Copy link
Contributor

@mudit2812 mudit2812 commented Sep 18, 2024

[sc-73935]

  • Remove deprecated code from demos.
  • Update various from pennylane import numpy as np to import numpy as np.

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!

@mudit2812 mudit2812 added the ci:build-all-qml-demos Build all the Demos for this Pull Request label Sep 19, 2024
@mudit2812 mudit2812 marked this pull request as ready for review September 19, 2024 15:35
Makefile Show resolved Hide resolved
@mudit2812
Copy link
Contributor Author

The build failure here seems to come from sphinx_gallery, and I don't know how to debug it, since there is no traceback. I've verified that the versions of pennylane and lightning that are installed account for all deprecations. Catalyst could be causing the issue, but qml has no references to qml.Device, which is the deprecated class that is causing the failure.

@josh146
Copy link
Member

josh146 commented Sep 22, 2024

Hey @mudit2812, how come the demos were updated to use pnp instead of np?

While we have been using pnp internally in the source code, we have deliberately kept demos/tutorials using from pennylane import numpy as np to stay consistent with all of our public documentation, papers, slides, codebook, etc.

@mudit2812
Copy link
Contributor Author

Hey @mudit2812, how come the demos were updated to use pnp instead of np?

While we have been using pnp internally in the source code, we have deliberately kept demos/tutorials using from pennylane import numpy as np to stay consistent with all of our public documentation, papers, slides, codebook, etc.

Thanks @josh146 , I'll revert the change. Though for the tutorial_tn_circuits demo, I can't get the demo to work unless we use vanilla numpy for the template_weights given to qml.MPS, and we need pennylane.numpy for optimization. What is the recommendation for demos where both vanilla and pennylane numpy are needed?

@josh146
Copy link
Member

josh146 commented Sep 23, 2024

What is the recommendation for demos where both vanilla and pennylane numpy are needed?

I don't think we've been in a position where we've had to do this in a demo before 🤔

Though for the tutorial_tn_circuits demo, I can't get the demo to work unless we use vanilla numpy for the template_weights given to qml.MPS, and we need pennylane.numpy for optimization.

Interesting! do we know why MPS doesn't work with PL numpy (sounds like a bug?)

In the meantime, I think it's okay to import vanilla numpy here (since original numpy is only being used to patch a bug/issue, we could import it as import numpy as onp)

conf.py Show resolved Hide resolved
demonstrations/tutorial_backprop.py Show resolved Hide resolved
Copy link

github-actions bot commented Oct 3, 2024

Thank you for opening this pull request.

You can find the built site at this link.

Deployment Info:

  • Pull Request ID: 1220
  • Deployment SHA: d7a8ae7b48ee47ddfface8ad706ec30917a07b62
    (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.

@mudit2812 mudit2812 enabled auto-merge (squash) October 3, 2024 20:59
@mudit2812 mudit2812 merged commit 3d02a26 into dev Oct 3, 2024
19 checks passed
@mudit2812 mudit2812 deleted the 0.39-deps branch October 3, 2024 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:build-all-qml-demos Build all the Demos for this Pull Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants