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

reciprocal_density not working in MPHSEBSSet #3492

Closed
fraricci opened this issue Dec 4, 2023 · 4 comments · Fixed by #3484 or #3499
Closed

reciprocal_density not working in MPHSEBSSet #3492

fraricci opened this issue Dec 4, 2023 · 4 comments · Fixed by #3484 or #3499
Labels
bug good first issue A new feature or bug fix suited for beginners to start contributing io Input/output functionality vasp Vienna Ab initio Simulation Package

Comments

@fraricci
Copy link
Contributor

fraricci commented Dec 4, 2023

In [24]: MPHSEBSSet(structure,mode="Uniform",reciprocal_density=100).reciprocal_density
Out[24]: 50
In [25]: MPHSEBSSet(structure,mode="Uniform",user_kpoints_settings={"reciprocal_density":100}).reciprocal_density
Out[25]: 50

# the only way to get it right
In [26]: MPHSEBSSet(structure,mode="Uniform",user_kpoints_settings={"reciprocal_density":100},reciprocal_density=100).reciprocal_density
Out[26]: 100

I think this is due to this flawed implementation in io.vasp.sets

if not reciprocal_density or "reciprocal_density" not in self.user_kpoints_settings:
    self.reciprocal_density = 50
else:
    self.reciprocal_density = reciprocal_density or self.user_kpoints_settings["reciprocal_density"]

here how it should be:

if reciprocal_density or "reciprocal_density" in user_kpoints_settings:
    self.reciprocal_density = reciprocal_density or self.user_kpoints_settings["reciprocal_density"]
else:
    self.reciprocal_density = 50

@janosh do you mind including this fix into one of your next pushes?

@janosh
Copy link
Member

janosh commented Dec 5, 2023

@fraricci Thanks for pointing this out. Your fix needs to be accompanied by a new test so PRs welcome!

@utf Good example for #3484 (comment)

@janosh janosh added bug io Input/output functionality vasp Vienna Ab initio Simulation Package good first issue A new feature or bug fix suited for beginners to start contributing labels Dec 5, 2023
@utf
Copy link
Member

utf commented Dec 5, 2023

Just to note that this was also fixed in #3484

kpoints: dict[str, Any] = {"reciprocal_density": self.reciprocal_density, "explicit": True}

@janosh
Copy link
Member

janosh commented Dec 5, 2023

With a test?

@utf
Copy link
Member

utf commented Dec 5, 2023

Nope, definitely need to add a test.

@janosh janosh changed the title Reciprocal_density not working in MPHSEBSSet reciprocal_density not working in MPHSEBSSet Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug good first issue A new feature or bug fix suited for beginners to start contributing io Input/output functionality vasp Vienna Ab initio Simulation Package
Projects
None yet
3 participants