-
Notifications
You must be signed in to change notification settings - Fork 186
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
Fix demos to use jax that require grads #1226
base: dev
Are you sure you want to change the base?
Changes from 13 commits
f0206fb
1459f09
2bb386a
bc07969
e744d78
3d9caef
881fd61
ab8053a
3bfecc7
ace56a6
264bde6
1f2b1fd
a3565b9
db16c7b
35c516b
da50b3a
a7ed510
088d9d0
34490a1
a4ee968
67adb01
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ jobs: | |
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Nightly Merge | ||
uses: robotology/[email protected] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,11 +202,11 @@ | |
# coordinates. | ||
|
||
from pennylane import qchem | ||
from pennylane import numpy as np | ||
from jax import numpy as jnp | ||
|
||
symbols = ['H', 'H'] | ||
geometry = np.array([[0.0, 0.0, -0.69434785], | ||
[0.0, 0.0, 0.69434785]], requires_grad = False) | ||
geometry = jnp.array([[0.0, 0.0, -0.69434785], | ||
[0.0, 0.0, 0.69434785]]) | ||
Comment on lines
204
to
+209
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This demo is already updated in another PR, correct? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it's not updated in that PR. Well that PR had a one line change in this demo by accident. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This demo doesn't work without the requires_grad changes because it calls fermionic_hamiltonian directly |
||
|
||
mol = qchem.Molecule(symbols, geometry) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we update this demo in this PR as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it cannot be done. This demo calls
electronic_integrals()
directly, which checks for requires_grad, leading to an error.