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

Replace indexing with slicing in qchem integrals #4685

Merged
merged 6 commits into from
Oct 20, 2023
Merged

Conversation

soranjh
Copy link
Contributor

@soranjh soranjh commented Oct 17, 2023

Context:
The qchem code for computing molecular integrals needs to be modified for a better compatibility with JAX as described here.

Description of the Change:
The function integrals.py is modified to replace indexing with slicing in the computationally expensive functions electron_repulsion and _hermite_coulomb.

Benefits:

Possible Drawbacks:

Related GitHub Issues:

@github-actions
Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@soranjh
Copy link
Contributor Author

soranjh commented Oct 17, 2023

[sc-43000]

@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c899d6d) 99.64% compared to head (3af5fcc) 99.64%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4685      +/-   ##
==========================================
- Coverage   99.64%   99.64%   -0.01%     
==========================================
  Files         380      381       +1     
  Lines       34275    34056     -219     
==========================================
- Hits        34154    33934     -220     
- Misses        121      122       +1     
Files Coverage Δ
pennylane/qchem/integrals.py 100.00% <100.00%> (ø)
pennylane/templates/state_preparations/__init__.py 100.00% <100.00%> (ø)
...lane/templates/state_preparations/cosine_window.py 100.00% <100.00%> (ø)

... and 42 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@soranjh soranjh added the qchem ⚛️ Related to the QChem package label Oct 19, 2023
@soranjh soranjh marked this pull request as ready for review October 19, 2023 14:15
@soranjh soranjh changed the title [WIP] replace indexing with slicing in qchem integrals Replace indexing with slicing in qchem integrals Oct 19, 2023
Copy link
Member

@maliasadi maliasadi left a comment

Choose a reason for hiding this comment

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

Thanks @soranjh! It looks really good 🎉

Copy link
Contributor

@dime10 dime10 left a comment

Choose a reason for hiding this comment

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

Seems like a straightforward change 👍

pennylane/qchem/integrals.py Show resolved Hide resolved
@mudit2812 mudit2812 added this to the v0.33 milestone Oct 20, 2023
@soranjh soranjh added the merge-ready ✔️ All tests pass and the PR is ready to be merged. label Oct 20, 2023
@mudit2812 mudit2812 enabled auto-merge (squash) October 20, 2023 17:49
@mudit2812 mudit2812 merged commit 7f560b5 into master Oct 20, 2023
33 checks passed
@mudit2812 mudit2812 deleted the qchem_jax_slicing branch October 20, 2023 18:08
@mlxd mlxd restored the qchem_jax_slicing branch October 20, 2023 21:14
@mlxd mlxd deleted the qchem_jax_slicing branch October 20, 2023 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-ready ✔️ All tests pass and the PR is ready to be merged. qchem ⚛️ Related to the QChem package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants