Fix DFT+U occupation matrix output format - #7829
Open
lanshuyue wants to merge 1 commit into
Open
Conversation
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.
Problem
write_occup_m()currently writes DFT+U occupation-matrix labels and integer values without whitespace separation:However,
read_occup_m()uses whitespace-delimited stream extraction and expects the labels and values as separate tokens:As a result, the DFT+U band workflow cannot read the
dm_onsite.txtgenerated by the preceding SCF calculation and fails with:The regression context is
fa14bddd5666ba254b02d3cbc2c83a4db6b3bb98(DFT+U Refactor (#7538)).Fix
This adds the missing whitespace separator between the labels and their integer values in
write_occup_m().No reader logic is changed.
No DFT+U numerical behavior is changed.
No occupation matrix values are changed.
No INPUT behavior is changed.
Validation
Reproduced the failure using the existing NiO DFT+U SCF -> band workflow.
Confirmed that the original writer generated compact tokens such as
Atom=1andspin=1.Confirmed that adding whitespace after
=alone allowed the existing reader to complete the band calculation.Confirmed that
source/source_lcao/module_dftu/dftu_io.cpphas no writer/reader diff fromv3.11.0-beta8to currentupstream/develop.Rebuilt beta8-equivalent DFT+U code after applying this writer fix.
Confirmed that SCF now generates the expected whitespace-separated labels and values automatically:
Used the newly generated
dm_onsite.txtdirectly, without manual modification.Confirmed that the subsequent band calculation completed and produced
bands1.txtandbands2.txt.Automated regression test added: no.
Runtime reproduction/validation: yes.
Note: the current
upstream/developfull local Intel build is blocked on this workstation by an unrelated LR compile error insource/source_lcao/module_lr/utils/exciton_plotter.cpp. Runtime validation was therefore performed with the beta8-based validation worktree, whosedftu_io.cppwriter/reader code is unchanged from currentupstream/developbefore this fix.