Skip to content

WIP: Additional integral getters#243

Merged
haneug merged 15 commits into
faccts:mainfrom
vaferreiQMT:feat/integral-getters
May 28, 2026
Merged

WIP: Additional integral getters#243
haneug merged 15 commits into
faccts:mainfrom
vaferreiQMT:feat/integral-getters

Conversation

@vaferreiQMT

@vaferreiQMT vaferreiQMT commented May 22, 2026

Copy link
Copy Markdown
Contributor

Closes Issues

Closes #240

Description

  • Adds t_matrix, v_matrix and hmo to Molecule along with corresponding getters in src/opi/output/core.py (get_int_kinetic, get_int_nuclear, get_int_hmo)
  • Adds TwoElectronIntegralElement type for the sparse COO 4 index matrix elements
  • Adds MolecularTwoElectronIntegral class for two electron integrals in MO basis
  • Adds TwoElectronIntegrals class for all two electron integral information and corresponding twoelintegrals in Molecule class

I have attempted to reproduce the style and format of the existing code but of course a lot of it is also up to taste in terms of how things are arranged and named so very happy for you to change it as you see fit.


Release Notes

Added

@CLAassistant

CLAassistant commented May 22, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@vaferreiQMT

Copy link
Copy Markdown
Contributor Author

Although the additional objects added here are sufficient to extract and parse the two electron integral information (at least from my testing), I have not yet gone ahead and added getters. Given there are so many possible two electron integrals I'm not sure if you wish to have separate getters as is currently done or go for a different approach, but I wanted to check before adding hundreds of lines of boilerplate.

@haneug haneug added enhancement New feature or request side output Concerning parsing ORCA output labels May 27, 2026
@haneug

haneug commented May 27, 2026

Copy link
Copy Markdown
Contributor

Thank you very much for your nice PR. The unit tests uv run nox -s unit_tests are currently failing because the new pydantic fields are not covered by our JSON file fixtures.
You can either add the new fields to the list of attributes to ignore which can be found here:


Or, if you would provide an example that makes use of the new pydantic fields and getters we could add it to the JSON fixtures and cover them in the attribute output tests.

@vaferreiQMT

Copy link
Copy Markdown
Contributor Author

Thanks for the help! I've updated the integrals test example with the additional single electron getters and added the two electron integrals to the ignore list for now. Unit tests now seem to pass locally.

@haneug haneug left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Very Nice PR, I only found a small typo and have two suggestions for slightly different naming. I did not come to thoroughly check the two electron integrals but from what I see it looks good.

Comment thread src/opi/output/core.py Outdated
Comment thread src/opi/output/core.py Outdated
@haneug haneug marked this pull request as ready for review May 28, 2026 08:40
@haneug haneug requested a review from a team as a code owner May 28, 2026 08:40
@haneug

haneug commented May 28, 2026

Copy link
Copy Markdown
Contributor

Nice, I would merge your PR. If you could also add your release note section to the CHANGELOG.md file before that. That would be great.

@vaferreiQMT

Copy link
Copy Markdown
Contributor Author

Great, updated the changelog now! Just wanted check as well if you had any thoughts on the format for the two electron integral getters (which currently aren't included here).

@haneug

haneug commented May 28, 2026

Copy link
Copy Markdown
Contributor

@vaferreiQMT Thanks for the additions to the changelog. There seems to be an issue with the license. That sometimes happens and in my experience an empty commit can resolve the issue sometimes.

@haneug haneug merged commit 85dbbe9 into faccts:main May 28, 2026
6 checks passed
@haneug

haneug commented May 28, 2026

Copy link
Copy Markdown
Contributor

Thank you for contributing to OPI and making it better. Regarding the two electron integral getters I do not have a strong opinion and would just expose them as ORCA supplies them. If you require anything specific / any specific convention we would love to hear it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request side output Concerning parsing ORCA output

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding getters for other electronic integrals

3 participants