Skip to content

Fix matdyn parser column offset and ph.py parameter handling#1233

Open
LIU-Binbin wants to merge 1 commit intoaiidateam:mainfrom
LIU-Binbin:fix-matdyn-parser
Open

Fix matdyn parser column offset and ph.py parameter handling#1233
LIU-Binbin wants to merge 1 commit intoaiidateam:mainfrom
LIU-Binbin:fix-matdyn-parser

Conversation

@LIU-Binbin
Copy link

1, The parser assumed 3 values per k-point line but matdyn.x outputs 4 (kx, ky, kz, weight), causing all phonon frequencies to be incorrectly parsed with a cumulative offset.
Fix: Correct k-point stride from 3 to 4 for proper frequency parsing in parse_raw_matdyn_phonon_file() in matdyn.py

  1. PhCalculation: Missing parameter normalization and unsafe INPUTPH access.
    Fix:
  1. Restored parameter case normalization (_uppercase_dict / _lowercase_dict)
  2. Changed to safe dict access: parameters.get('INPUTPH', {}).get('electron_phonon')

- matdyn.py: Correct k-point stride from 3 to 4 for proper frequency parsing
- ph.py: Restore parameter case normalization and safe INPUTPH access
@dbidoggia
Copy link
Contributor

This is a good point. Indeed the weights were indeed introduced in qe7.4 (https://gitlab.com/QEF/q-e/-/commit/2e4ee8f50a44aaef4d65f7a994d83fed9436aee9).

However, simply changing the offset increments is not a good solution, as it would break compatibility with older QE versions where these weights are not present. I think that either the increment is choose according to the version parsed from stdout or a new logic for parsing ph frequencies should be implemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants