Fix redundant density symmetrization in OFDFT - #7749
Merged
mohanchen merged 1 commit intoAug 2, 2026
Conversation
There was a problem hiding this comment.
Pull request overview
This PR targets the OFDFT initialization hotspot reported in #7724 by avoiding a redundant density symmetrization step when the initial (non-file) density is immediately replaced with a uniform density in ESolver_OF::before_opt.
Changes:
- Guard
Symmetry_rho::symmetrize_rho(...)so it only runs wheninit_chg == "file"inESolver_OF::before_opt. - Add an in-code note explaining why symmetrization is skipped for non-file initialization.
- Minor whitespace/formatting cleanups in
esolver_of.cpp.
Cstandardlib
force-pushed
the
fix/7724-symmetrize-rho-ofdft
branch
from
August 1, 2026 19:26
281f08e to
d8fe1db
Compare
Cstandardlib
force-pushed
the
fix/7724-symmetrize-rho-ofdft
branch
from
August 1, 2026 19:44
d8fe1db to
65d533b
Compare
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
Fix #7724
Unit Tests and/or Case Tests for my changes
What's changed?
rho_symmetrizeoperation whose results will soon be overwritten inesolver_of.cpp.ofdftwithinit_chg!=file, saving up to 95% of total time.Governance Notes