Repository navigation
Add POT_NS_CUTOFF / POT_NS_WRITE_CUTOFF keys to kkrparams - #255
Merged
Merged
Conversation
KKRimp: add POT_NS_CUTOFF (non-spherical potential cutoff applied every iteration, read by KKRimp config.f90, default 0.1*QBOUND) and POT_NS_WRITE_CUTOFF (non-spherical channels are written to the output potential only if their norm exceeds this value, default QBOUND). KKRhost: add POT_NS_WRITE_CUTOFF. All are optional reals written as '%e'. The existing KKRhost POT_NS_CUTOFF also switches from '%f' (written as '%21.12f', i.e. few significant digits for small cutoffs and zero below 1e-12) to '%e'. Only the keyword tables change; the generic writer needs nothing else.
This was referenced Sep 27, 2026
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
Only a minor changelog precision nit was identified; no blocking issues remain.
Review effort: Lite
Findings: None
What changed in this PR
Adds POT_NS_CUTOFF and POT_NS_WRITE_CUTOFF support for KKRhost and KKRimp.
Changes:
- Updates KKRhost and KKRimp keyword definitions.
- Changes KKRhost cutoff formatting from
%fto%e. - Adds regression tests and updates snapshots and changelog.
| File | Summary |
|---|---|
tests/test_kkrparams/test_read_slab.yml |
Updates expected parameter snapshot. |
tests/test_kkrparams/test_get_dict.yml |
Updates expected dictionary snapshot. |
tests/test_kkrparams.py |
Adds cutoff serialization and parsing tests. |
masci_tools/io/data_kkrparams/defaults_kkrimp.json |
Adds KKRimp cutoff definitions. |
masci_tools/io/data_kkrparams/defaults_kkrhost.json |
Adds the KKRhost write cutoff and updates formatting. |
CHANGELOG.md |
Documents the new keys and formatting change. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This was referenced Sep 27, 2026
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.
Adds keys for the two places where KKR cuts the non-spherical potential channels (LM ≥ 2):
POT_NS_CUTOFFQBOUNDPOT_NS_WRITE_CUTOFFQBOUND(today's behaviour)POT_NS_CUTOFFis read by KKRimpconfig.f90and KKRhostrinput13.F90.POT_NS_WRITE_CUTOFFis being added in jukkr (branchfix/kkrimp-pot-ns-write-cutoff); older binaries ignore keys they don't know. The motivation, from aiida-kkr: its straight-mixing step runs atQBOUND= 1e-2, so the potential written for the next step has lost every channel below that. This costs about 20 iterations for near-converged starts.Format change: the existing KKRhost
POT_NS_CUTOFFswitches from%fto%e. The writer turns%finto%21.12f, which keeps only 5 significant digits at 1e-8 (1.23456e-8→0.000000012346) and writes values below 1e-12 as zero. It is now written asPOT_NS_CUTOFF= 1.234560e-08. No stored test data in masci-tools or aiida-kkr sets this key. The new keys also use%e, likeQBOUND.Only the keyword tables (
masci_tools/io/data_kkrparams/*.json) change; the genericKEY= valuewriter needs nothing else. kkrparams cannot readconfig.cfgback in (read_keywords_from_inputcardhandles only KKRhost inputcards); that limitation already existed and doesn't affect aiida-kkr.Tests: new
test_pot_ns_cutoff_keys, which writesconfig.cfgand an inputcard and reads the inputcard back. Two kkrparams snapshot files gainPOT_NS_WRITE_CUTOFF: null, the only change. CI is red ondevelopindependently of this PR (#252).