Repository navigation
Use mctc-lib Wigner-Seitz cell and cutoff-based EEQBC lattice sums - #75
Merged
Merged
Conversation
- Replace the local multicharge_wignerseitz module with mctc_wignerseitz from mctc-lib 0.7.0. - get_dir_trans now takes the structure and an optional real-space cutoff. EEQBC builds its direct lattice translations from the CN cutoff instead of a fixed +/-2 cells, so the energy and charges of an n-fold supercell now match n unit cells. For small cells the error per cell drops from up to 0.12 Eh to below 1e-8 Eh. EEQ keeps the fixed +/-2 cells for its Ewald direct sum. - Update the EEQ formamide energy reference. - Ignore subprojects/.wraplock.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #75 +/- ##
===========================================
- Coverage 51.57% 30.68% -20.90%
===========================================
Files 18 2 -16
Lines 1648 176 -1472
Branches 746 72 -674
===========================================
- Hits 850 54 -796
+ Misses 390 85 -305
+ Partials 408 37 -371 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
awvwgk
approved these changes
Oct 26, 2026
timchem1508
added a commit
to timchem1508/multicharge
that referenced
this pull request
Oct 27, 2026
…main Main v0.6.0 brings the analytical charge Hessian (grimme-lab#71) and the mctc-lib Wigner-Seitz cell (grimme-lab#75), both written against the dense solve and cache_container API that this branch replaced. Port them onto the solver architecture: - get_charges(..., dqdL, cache, efield) retains the response in mchrg_cache (new dqdr field); add_charge_hessian reuses get_coulomb_derivs with the adjoint in place of the charges - add_model_hessian for EEQ and EEQ-BC on the branch cache layout (element-indexed rvdw, EEQ-BC lattice cutoff) - exact derivative of the regularised EEQ CN term in get_xvec_derivs and get_grad, as on main - use new_wignerseitz_cell from mctc-lib and drop multicharge_wignerseitz; drop the CSR-list arguments of local_charge that mctc-lib lacks - pin mctc-lib v0.7.0 and restore main's fpm.toml (mstore v0.4.0, fortitude configuration) - add main's eeqbc-response-znoh tests and the updated formamide reference; use the EEQ-BC tolerance of test_dadr also in test_dadL Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EEQBC's periodic sums used a fixed ±2 cells of lattice translations, so results depended on the cell size: an n-fold supercell did not give n times the unit-cell energy. Small cells were affected most. This PR builds the EEQBC translations from the 25 bohr CN cutoff instead, and switches to the Wigner-Seitz cell from mctc-lib. The EEQ posseses the same problem, but not adressed here.
Changes
multicharge_wignerseitzwithmctc_wignerseitzfrom mctc-lib 0.7.0 and removesrc/multicharge/wignerseitz.f90.get_dir_transnow takes the structure and an optional cutoff.subprojects/.wraplock.Testing
Charge deviations follow the same pattern.