-
Notifications
You must be signed in to change notification settings - Fork 2
feat: picture change correction for dipole integrals #132
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR implements picture change corrections for dipole integrals in X2C (exact two-component) relativistic calculations. Picture change corrections ensure that property operators are transformed consistently with the one-electron decoupling transformation applied to the Dirac Hamiltonian. The implementation refactors X2C routines into a X2CHelper class with hcore_x2c as a cached property to avoid redundant computations.
Key Changes:
- Refactored X2C implementation from module-level functions into an
X2CHelperclass with cached computation - Added picture change correction support for dipole operators via new
electric_dipole_momentandpicture_change_even_operatormethods - Introduced
cint_sprspintegral function for small-component dipole integrals needed for picture change corrections
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
forte2/x2c/x2c.py |
Refactored X2C code into X2CHelper class; added methods for picture-changed dipole integrals; converted hcore_x2c to cached property |
forte2/x2c/__init__.py |
Updated export from get_hcore_x2c function to X2CHelper class |
forte2/system/system.py |
Integrated X2CHelper instance and updated to use x2c_helper.hcore_x2c property |
forte2/props/props.py |
Added skip_picture_change parameter; implemented picture change logic for dipole calculations |
forte2/integrals/integrals.py |
Added cint_sprsp function for computing small-component dipole integrals |
forte2/integrals/libcint_two_center.h |
Added declaration for int1e_sprsp integral with 12 components |
forte2/api/integrals_api.cc |
Exposed cint_int1e_sprsp_sph to Python API |
forte2/helpers/matrix_functions.py |
Added i_sigma_dot function for constructing spin-orbit coupling matrices; improved block_diag_2x2 logic |
forte2/helpers/__init__.py |
Exported new i_sigma_dot function |
tests/props/test_props.py |
Added tests for dipole calculations with sfx2c1e and sox2c1e |
tests/integrals/test_libcint.py |
Added test for cint_sprsp with shifted origin |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
… needs further investigation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #132 +/- ##
==========================================
+ Coverage 92.48% 92.55% +0.06%
==========================================
Files 141 141
Lines 11647 11735 +88
Branches 943 949 +6
==========================================
+ Hits 10772 10861 +89
+ Misses 659 658 -1
Partials 216 216 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This PR implements picture change corrections for properties, currently only dipole integrals can be picture changed. Picture change here means consistently applying the one-electron decoupling transformation that was applied to the Dirac Hamiltonian to other one-electron operators, such as the dipole operator here. Currently only even operators (those that don't couple large and small components, i.e., all non-relativistic operators) can be picture changed.
The X2C routines are refactored into the
X2CHelperclass, with thehcore_x2cmethod now acached_propertyso no recalculation is needed.