-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nexus: Element names need to be capitalized in incorporate_system at fileio.py #4958
Conversation
Can you explain where the uppercase MO is coming from in your example? Ideally Nexus has and enforces a consistent use throughout. The fix here is user friendly so we could run with it, but there must be other cases where capitalization is not either converted or enforced. |
I think the bug is because of this: qmcpack/nexus/lib/qmcpack_input.py Line 2801 in 23c5f36
Nexus makes the upper/lower case correction of qmcpack input by keeping a list of parameters that are used in the XML file. Therefore the Molybdenum atom symbol is converted from 'Mo' to 'MO' in the qmcpack input file, despite it was written as 'Mo' in the nexus input script. I think this is a problem specific to Mo atom, because the "MO" is a tag in qmcpack input. This does not interfere with the qmcpack run, but only seems to be a problem when the structure info is read from the xml file (in qdens), where qmcpack does not check capitalization. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already a feature that performs this type of function (atomic symbol processing). Better to use this rather than duplicate. I think this loop in file fileio.py:
Can be replaced with this one:
@kayahans If you try this, does it fix the issue? |
@jtkrogel's suggestion works, pushed a new commit with his suggestion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks all
Test this please |
Test this please |
Proposed changes
Element names need to be capitalized to be able to run qdens.
For a MoS2 calculation, I used the qdens in the following way:
qdens -e 100 -a -v -f xsf -i dmc.g000.twistnum_0.in.xml *.s002.stat.h5
With averaging over multiple twists, the run dies without any error message (only prints "Killed" and terminates).
For a single twist, I get the following error:
*** KeyError: 'MO'
After debugging, I found that MO should stand for Molybdenum. After converting MO to Mo, qdens script works as expected for a single twist.
What type(s) of changes does this code introduce?
Does this introduce a breaking change?
What systems has this change been tested on?
Bilayer MoS2