-
Notifications
You must be signed in to change notification settings - Fork 40
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
Enable direct reading of UPF version >= 2 PP files #980
Conversation
The Note: for use of |
Just as a comment: SSSP currently still contains many UPFv1 pseudos (GRBV), but in the future it will be all UPFv2 🎉 . |
Imho as long as QE parses the UPFs, |
Adding a test under |
if (!nl_node.child("PP_AUGMENTATION").empty()) { | ||
for (int i = 0; i < nbf; i++) { | ||
std::string istr = "PP_BETA." + std::to_string(i + 1); | ||
pugi::xml_node inode = nl_node.child(istr.data()); | ||
int li = inode.attribute("angular_momentum").as_int(); | ||
|
||
for (int j = i; j < nbf; j++) { | ||
std::string jstr = "PP_BETA." + std::to_string(j + 1); | ||
pugi::xml_node jnode = nl_node.child(jstr.data()); |
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.
(@simonpintarelli redirect me to this PR. I am maintaining SSSP and working on update SSSP with some improvement to v2)
I think in order to compatible with GBRV pseudos, nqf!=0
should also be supported here. And GBRV pseudos has q_ij rather than q_ijl, https://github.com/QEF/q-e/blob/57a97fe3ac56c6862ee083bf10d27505835c092a/upflib/read_upf_v1.f90#L65-L67
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.
As far as I can tell, GBRV pseudos are stored as UPF version 1 files. We are not aiming to write such a parser. If you are planing to convert to GBRV pseudos to v2, we could cover them as well. But then, I assume they would follow the UPF v2 standard?
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.
But then, I assume they would follow the UPF v2 standard?
Yes, but the UPF v2 standard is for the format, the non-zero nqf
and q_ij
are still the valid fields according to the UPF v2 schema and according to the notes provided in QEF/qeschemas#11 (comment)
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.
As far as I remember V2 UPF pseudos introduced Q_ij^\ell(r) radial functions as a hard standard. Long term it is better to conver V1 GBRV to V2.
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.
https://gist.github.com/unkcpz/c3287268c84ba46b3366edb5537d65c7
Here is a Pd pseudo I convert from UPF.v1 GBRV to UPF.v2. In the QE, it will then be read by read_upf_new.f90 instead of fallback read by read_upf_v1.f90.
It is true from Giannozzi's note (QEF/qeschemas#11 (comment)) that qfcoef
and rinner
are to be considered obsolescent. The plan for the SSSP v2 is to provide GBRV with converting it to UPFv2 format (let me know if this is useful, I need more test on such UPFv2 file I converted), I assume in SIRIUS you still can use it? But as @toxa81 pointed, maybe in the long term should push to have use uniformed expression.
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.
I personally think that having the whole SSSP library in UPF v2 format would be very useful, especially for people outside of QE. I also think that having a single uniform standard is important. For example, in this case, we would have to implement a special case for qfcoef
and rinner
, which in the end, is not very different from having 2 distinct parsers.
As far as I understand, it is possible to go from UPF v1 PP_QIJ
to UPF v2 PP_QIJL
seamlessly. For example, the upf_to_json
tool of SIRIUS parses both UPF v1 and UPF v2 to the same JSON structure, which happens to be very close to that of UPF v2 (PP_QIJL
).
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.
For example, the upf_to_json tool of SIRIUS parses both UPF v1 and UPF v2 to the same JSON structure
That is cool, I didn't know it actually convert not only the format but the expression as well. I'll talk to @simonpintarelli to see how it can be realize and I can probably add it to my v1 -> v2 converter.
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.
Just quick update from my side. The converter are ready to convert to PP_QIJL and did exactly the same as what happened in QE internally. So it will be safe with this implementation with the new SSSP 2.0 in the future.
cscs-ci run default |
cscs-ci run default |
cuda container is failing on non-existent +pugixml variant: 🤔 the cscs-ci container takes the |
cscs-ci run default (why does it keep disappearing?) |
Ping @finkandreas we are running into a timeout when building the cuda base container: Should we skip it until rosa is back? |
or increase timeout to e.g. 3h, 4h, 5h. No idea how long it takes, but the runner allows long runtimes. |
cscs-ci run default |
cscs-ci run default |
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.
It's getting out of hand :)
…ure#980) * Enable direct reading of UPF version >= 2 PP files * update spack in cscs-ci * use local spack recipe for cscs-ci * Fix github CI * increase timeout * 4h -> 10h --------- Co-authored-by: Simon Pintarelli <[email protected]>
This PR enables the direct reading of standard pseudopotential UPF files with version >= 2, without the need for the
upf_to_json
tool. Thepugixml
library is used for this purpose.All functions reading information from JSON PP files, namely
Atom_type::read_pseudo_uspp
andAtom_type::read_pseudo_paw
have been overloaded with function reading from xml files (stepwise identical). The relevant function is called depending on the file termination in the SIRIUS input file.This PR is fully backward compatible. At this stage, the dependency on the
pugixml
library was made a hard requirement. This would imply a change in the spack recipe for the next release.Edit: at this stage, it is an open question whether
pugixml
should be a hard requirement or an option.