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

Support for pennylane >=0.33.0 (and thereby newer versions of numpy) #1871

Open
Andrew-S-Rosen opened this issue Dec 1, 2023 · 8 comments
Open
Labels
feature New feature addition priority / medium One of the priorities in a month

Comments

@Andrew-S-Rosen
Copy link
Contributor

Andrew-S-Rosen commented Dec 1, 2023

What should we add?

#1845 (comment)

Recently, Pennylane has removed the operations attribute from their DefaultQubit class which means the following error might be thrown for users installing covalent in a new environment [with pennylane >= 0.33.0]: AttributeError: type object 'DefaultQubit' has no attribute 'operations'

Because of the above issue, the maximum version of pennylane is fixed (which also fixes the maximum version of numpy as a result). I'm opening an issue just so this is logged somewhere.

Describe alternatives you've considered.

No response

@Andrew-S-Rosen Andrew-S-Rosen added the feature New feature addition label Dec 1, 2023
@Andrew-S-Rosen
Copy link
Contributor Author

Andrew-S-Rosen commented Dec 6, 2023

Looks like this is the offending line:

operations = DefaultQubit.operations

@kessler-frost: Is the QEDevice.operations attribute actually used anywhere? I couldn't spot it from a quick search in the codebase, but maybe I missed it.

@kessler-frost
Copy link
Member

@Andrew-S-Rosen so when creating a new device in Pennylane there are some attributes that the custom device is required to have, essentially describing what are all the operations and observables that this particular device supports as not all devices can physically support all operations/observables. This is why here we are simply making our device support whatever the default device supports. This is why you couldn't find it in the codebase 😅 because it's something that is required by pennylane when defining a custom device.

@Andrew-S-Rosen
Copy link
Contributor Author

@kessler-frost: Ah, that explains it! So then in order to resolve this issue, we basically need to swap out the required attributes (if any) and then would need to pin a lower-bound version on pennylane if I understand correctly.

@kessler-frost
Copy link
Member

That is correct.

@kessler-frost
Copy link
Member

Sorry @Andrew-S-Rosen , but I think this issue will be blocked by #1877 😓 . We don't currently have tests enabled for the qelectrons (which are the reason behind the Pennylane dependency), thus we cannot know whether upgrading to version 33 will break the feature or not (or if the feature has gotten broken due to a recent change yet).

@Andrew-S-Rosen
Copy link
Contributor Author

Andrew-S-Rosen commented Dec 7, 2023

@kessler-frost: Makes perfect sense to me! I was admittedly relying blind on the test suite for this since I don't know anything about pennylane. I'll go ahead and close this!

Edit: Oops, I thought this was a PR. The issue should still be kept open until it's resolved!

@Andrew-S-Rosen Andrew-S-Rosen closed this as not planned Won't fix, can't repro, duplicate, stale Dec 7, 2023
@Andrew-S-Rosen Andrew-S-Rosen reopened this Dec 7, 2023
@kessler-frost
Copy link
Member

I'd say even your PR should be open 😅 . I can comment on there once it's resolved. Until then you can keep it in draft mode instead I believe.

@Andrew-S-Rosen
Copy link
Contributor Author

Sounds good!!

@jimmylism jimmylism added the priority / medium One of the priorities in a month label Dec 15, 2023
@Andrew-S-Rosen Andrew-S-Rosen changed the title Support for pennylane >=0.33.0 Support for pennylane >=0.33.0 (and thereby newer versions of numpy) Dec 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature addition priority / medium One of the priorities in a month
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants