Skip to content
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

Issues with DFT XC extraction #115

Open
JosePizarro3 opened this issue Sep 11, 2024 · 5 comments
Open

Issues with DFT XC extraction #115

JosePizarro3 opened this issue Sep 11, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@JosePizarro3
Copy link
Collaborator

Matyas Novak from the SPRKKR is trying to write a parser and found some errors. This is the message he sent me:

  1. I ecounter an error
    ValueError: max() arg is an empty sequence
    raised from
    nomad_simulations/schema_packages/model_method.py
    line 352, where the following line
    highest_rung_abbrev = max(abbrevs, key=lambda x: rung_order[x])
    failed, if abbrevs is empty - which could be. There is check for None,
    but not for an empty list.

  2. Moreover, there is probably an another bug: during normalize in
    nomad_simulations/schema_packages/model_method.py(202)normalize()
    the libxc_name is from same reason altered as follows:
    self.libxc_name = libxc_name_weight + self.libxc_name

However, in the code mentined above in the method
resolve_jacobs_ladder
line 340 of the
nomad_simulations/schema_packages/model_method.py
does not take the "weight" preffix into account,
so the name is not parsed and the result is the same exception,
as in 1, since the list of known names is empty

@ndaelman-hu my guess is that the normalization of the DFT and XCFunctional class is broken. Would you mind taking a look and taking this chance to work on #13 and polishing the DFT schema? It shouldn't be complicated.

@JosePizarro3 JosePizarro3 added the bug Something isn't working label Sep 11, 2024
@ndaelman-hu
Copy link
Collaborator

I pushed a branch fixing issue 1. Regarding issue 2, I need some more context: this piece of code was implemented in function of GW, but I'm not sure what purpose it serves.
All I can gather is some code dev 6 years ago decided to generate a long-format search string. Typically, functional names are used directly. There's definitely some benefit in searching all functionals that contain a certain percentage of one, but this format isn't very conducive to it. My first thought is to simply remove this.

@JosePizarro3
Copy link
Collaborator Author

All boils down to:

  1. Check the DFT schema and,
  2. have some testing

I'll merge your fix.

@ndaelman-hu
Copy link
Collaborator

Regarding issue 2, I need some more context: this piece of code was implemented in function of GW, but I'm not sure what purpose it serves.

@JosePizarro3 I was actually directing this question to you, but I should've been a bit more explicit.

From what I gather, you introduced functional_long_name_from_method in the legacy code, which then got ported over. Could you pls give me some more explanation on its original purpose? That would help with deciding on the next action.
It's of course possible that you moved it over from somewhere else, but the trail ends there.

@JosePizarro3
Copy link
Collaborator Author

I am not sure what you meant with "...was implemented in function of GW.". If it is a piece of code old and useless, you are welcome to delete it.

It seems something with the libxc name and the weighting, but my expertise finishes there. I just moved everything to keep consistent about the old normalization.

@ndaelman-hu
Copy link
Collaborator

I am not sure what you meant with "...was implemented in function of GW.". If it is a piece of code old and useless, you are welcome to delete it.

I meant that git traces it back to a commit named "Hotfix GW workflow method section".

It seems something with the libxc name and the weighting, but my expertise finishes there. I just moved everything to keep consistent about the old normalization.

Okay, thank you for clarifying

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants