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

Add separate private qchem functions for external backends #5553

Merged
merged 12 commits into from
Jun 5, 2024

Conversation

soranjh
Copy link
Contributor

@soranjh soranjh commented Apr 22, 2024

Context:
The molecular_hamiltonian function currently supports three backends: the in-built differentiable Hartree-Fock backend, the pyscf backend, and the openfermion backend. This PR creates dedicated functions for calling these backends and puts them in proper modules. These changes are not user-facing but help with easier maintenance and extension of qchem functions.

Description of the Change:

  1. Create _openfermion_hamiltonian function for building a Hamiltonian with the openfermion backend.
  2. Move the molecular_hamiltonian function to hamiltonian.py.

Benefits:
Easier maintenance and extension of qchem functions.

Possible Drawbacks:
None

Related GitHub Issues:
None

@soranjh soranjh added the qchem ⚛️ Related to the QChem package label Apr 22, 2024
@soranjh
Copy link
Contributor Author

soranjh commented Apr 22, 2024

[sc-59834]

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.

Copy link

codecov bot commented Apr 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.67%. Comparing base (22342c9) to head (f9aea69).
Report is 254 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5553      +/-   ##
==========================================
- Coverage   99.67%   99.67%   -0.01%     
==========================================
  Files         414      414              
  Lines       39463    39172     -291     
==========================================
- Hits        39335    39043     -292     
- Misses        128      129       +1     

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

@soranjh soranjh force-pushed the qchem_separate_openfermion branch from fd4382f to 0ad2459 Compare May 30, 2024 21:19
@soranjh soranjh changed the title [WIP] Add separate private qchem functions for external backends Add separate private qchem functions for external backends May 30, 2024
@soranjh soranjh marked this pull request as ready for review May 30, 2024 22:17
Copy link
Contributor

@ddhawan11 ddhawan11 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. I only have a couple of minor comments.

pennylane/qchem/__init__.py Outdated Show resolved Hide resolved
pennylane/qchem/openfermion_obs.py Show resolved Hide resolved
@soranjh soranjh requested a review from ddhawan11 June 3, 2024 18:03
Copy link
Contributor

@ddhawan11 ddhawan11 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. Looks good to me.

Copy link
Contributor

@obliviateandsurrender obliviateandsurrender left a comment

Choose a reason for hiding this comment

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

Good to go, just a couple of minor points.

pennylane/qchem/openfermion_pyscf.py Show resolved Hide resolved
pennylane/qchem/openfermion_pyscf.py Show resolved Hide resolved
@soranjh soranjh merged commit 77e7ed0 into master Jun 5, 2024
40 checks passed
@soranjh soranjh deleted the qchem_separate_openfermion branch June 5, 2024 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
qchem ⚛️ Related to the QChem package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants