[wien2k] Add init_dmftpr, the case.indmftpr generator - #21
Open
harrisonlabollita wants to merge 1 commit into
Open
[wien2k] Add init_dmftpr, the case.indmftpr generator#21harrisonlabollita wants to merge 1 commit into
harrisonlabollita wants to merge 1 commit into
Conversation
dmftproj reads case.indmftpr, which init_lapw does not produce. Writing it by
hand means matching a positional format with one lsort/lnreps entry per l, so
this ports the interactive generator from triqs_dft_tools (bin/init_dmftpr):
it reads case.struct for the species and multiplicities, asks what to project
and how, and writes the file in the layout dmftproj expects.
Installed with install(PROGRAMS) so the execute bit is set, unlike the
install(FILES) dft_tools used.
Fixes carried over the port:
* the energy window is always written. Previously a third token that was not
exactly 'ev'/'eV'/'Ev' -- e.g. '-0.6 0.14 Ry', or 'EV' -- fell through the
unit test without writing anything, silently producing a case.indmftpr with
no window line at all.
* the irrep default was the string "0 0 0 0\n" passed to list.extend, which
iterates it character by character and wrote eight separate lines. This hit
every correlated d shell with no t2g/eg split, and every correlated f shell.
* the struct file is taken as <case>.struct rather than the first *.struct
glob match, which could pick up a stray tmp.struct.
* orbital letters are validated instead of raising KeyError.
* the file is written only once every answer is in, so aborting part way
through cannot leave a half-finished case.indmftpr on disk.
* python3 shebang.
the-hampel
approved these changes
Sep 2, 2026
the-hampel
left a comment
Member
There was a problem hiding this comment.
Looks clean. Thanks @harrisonlabollita ! So I guess we should then eventuall retire the one in dft_tools? Otherwise these bite each other? Should we remove it there?
Collaborator
Author
|
Ah, that's a good point. I think we should. dft_tools depends on dft_kit now correct? Then the experience would be consistent? |
Member
|
Hm, in the end we do not enforce having dftkit for dft_tools. That was the case for a brief moment but we removed it because then modest and dft_tools would pull both dftkit in and that would clash. But I think we can anyway remove it on dft_tools. But only on unstable. So on the next release it will land but for 4.0.x we maybe keep it as is. What you think? |
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
This PR ports the Wien2k-style initialization program `init_dmftpr`` from dft_tools to dftkit.
dmftprojtakes acase.indmftprfile as input to generate projectors. Writing itby hand means matching a positional format with one lsort/lnreps entry per l, so
this ports the interactive generator from
triqs_dft_tools(bin/init_dmftpr):it reads
case.structfor the species and multiplicities, asks what to projectand how, and writes the file in the layout
dmftprojexpects.Installed with
install(PROGRAMS)so the execute bit is set, unlike theinstall(FILES)dft_tools used.Fixes carried over during the port
exactly
ev/eV/Ev— e.g.-0.6 0.14 Ry, orEV— fell through the unittest without writing anything, silently producing a
case.indmftprwith nowindow line at all.
<case>.structrather than the first*.structglob match, which could pick up a stray struct file.
KeyError.cannot leave a half-finished
case.indmftpron disk.