Repository navigation
Conversation
Closes deepmodeling#8243. Align the energy with the existing weighted potential and update the verified non-unit-weight Al reference.
This branch has not been deployed
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.
Reminder
AGENTS.mdanddocs/developers_guide/agent_governance.md.source/changes.Linked Issue
Closes #8243.
What's changed?
With
nspin=1andof_tf_weight != 1, the TF total energy omitted the weight already used by its potential and pointwise energy density. Apply the stored weight to the energy integral so the energy, its density derivative, and the cached TF stress agree. The default weight of one and the spin-polarized energy formula are unchanged.Add three regressions covering weighted energy/pointwise integration/stress, particle-conserving energy differences against the TF potential, and the same derivative identity through the complete TF and WT manager paths. The tests use prescribed densities and independent analytic or finite-difference expectations.
Update the existing non-unit-weight Al reference after checking the analytic identities and rerunning the material case. The previous reference reproduced the omitted energy factor. For a single MPI rank, the measured changes are:
07_OF_KE_TF09_OF_KE_WT11_OF_TF_weightBoth versions converge for the non-unit-weight case. Its README explains the new energy and the stress collector's absolute-component sum. Validation scripts and tolerances are unchanged.
Unit Tests and/or Case Tests for my changes
CPU build: Ubuntu 24.04, GCC 13.3, FFTW3, OpenBLAS/ScaLAPACK, MPI, OpenMP. Binary reports
v3.11.0-beta11.developimplementation plus the regressions: 12 existing tests pass, all 3 new tests fail, reproducing the issue.Material checks used the existing harness, first with one MPI rank before/after the fix, then with four ranks against the updated reference:
git diff --check: passed. Agent governance checks: no blocking findings. Both changed test files pass the repository quality-score threshold.Governance Notes
KEDF_TF; no ESolver/HSolver interfaces, FFT implementation, global dependencies, or allocation behavior changed.