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

Line mode and reciprocal density bug int MPHSEBSSet #3607

Open
fraricci opened this issue Feb 6, 2024 · 2 comments
Open

Line mode and reciprocal density bug int MPHSEBSSet #3607

fraricci opened this issue Feb 6, 2024 · 2 comments
Labels

Comments

@fraricci
Copy link
Contributor

fraricci commented Feb 6, 2024

Python version

python 3.11

Pymatgen version

2024.1.27

Operating system version

No response

Current behavior

In: mpset = MPHSEBSSet(st, mode="Line",reciprocal_density=100)
Out: Correct list of kpoints

In: mpset = MPHSEBSSet(st, mode="Line",user_kpoints_settings={"reciprocal_density":100})
Out:

pymatgen with grid density = 1239 / number of atoms
0
Gamma
2 2 2

Expected Behavior

In: mpset = MPHSEBSSet(st, mode="Line",user_kpoints_settings={"reciprocal_density":100})
Out: Correct list of kpoints

Minimal example

No response

Relevant files to reproduce this bug

No response

@fraricci fraricci added the bug label Feb 6, 2024
@utf
Copy link
Member

utf commented Feb 7, 2024

Hi @fraricci, thanks for bringing this up.

In the older version of MPHSEBSSet, setting user_kpoints_settings={"reciprocal_density":100} wouldn't have any effect. It was simply ignored.

In the new version of the input sets, the user_kpoints_settings is strictly respected. In this case you are only asking for uniform k-points, hence no line mode k-points none are generated. If you want to produce line mode k-points you'd have to do:

mpset = MPHSEBSSet(
    st, 
    mode="Line",
    user_kpoints_settings={"reciprocal_density":100, "zero_weighted_line_density": 20}
)

The reason for this is that I wanted to always respect user_*_settings. If for some reason you want to use the rest of the HSE line mode settings but with a uniform mesh, then this should be possible. This is in contrast to the older input sets where user_kpoints_settings was completely ignored in MPHSEBSSet.

The recommendation is to simply configure everything using the init parameters, which will configure the k-points for you. For completeness, these are:

MPHSEBSSet(
    reciprocal_density=50,                # controls density of weighted uniform mesh for all modes
    kpoints_line_density=20,              # controls density of zero weighted line k-points for mode=line
    zero_weighted_reciprocal_density=100  # controls density of zero weighted uniform for mode=uniform_dense
)

@fraricci
Copy link
Contributor Author

fraricci commented Feb 8, 2024

Hi @utf , thanks for the explanation here.

Though, I still find this behavior a little obscure for these reasons:

  1. If I want to use the user_kpoints_setting I need to set all the keys and not just the one I want to change. Shouldn't just take the rest from the init params?
  2. Apparently, when only a single key is set, reciprocal_density in this case, the mode is changed internally and not transparently.
  3. The key zero_weighted_line_density spells differently from the init param kpoints_line_density but they represent the same thing. Shouldn't be called the same? This is something I found also in other sets...

Anyway, I agree the best way is to just use the init parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants