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

Incompatibility Issue with ALGO Parameter in Incar and Vasprun Classes #3780

Open
yanghan234 opened this issue Apr 23, 2024 · 0 comments
Open
Labels

Comments

@yanghan234
Copy link

Python version

Python 3.9

Pymatgen version

Version: 2024.4.13

Operating system version

Ubuntu 20.04 LTS

Current behavior

There appears to be an inconsistency in handling the ALGO parameter between the Incar and Vasprun classes. Specifically, when setting the ALGO parameter to "GW0" using the Incar class, the value is automatically reformatted to "Gw0" (with only the first letter capitalized).

ALGO = Gw0 
...

However, the Vasprun class expects "GW0" with all letters in uppercase when checking the parameter value:

if potcar and self.incar.get("ALGO", "") not in ["GW0", "G0W0", "GW", "BSE"]:

In fact, if I manually change "Gw0" in the vasprun.xml to "GW0", the problem is solved. So, it seems to me that we only need to modify the line to

if potcar and self.incar.get("ALGO", "").upper() not in ["GW0", "G0W0", "GW", "BSE"]: 

Expected Behavior

The Vasprun should parse the vasprun.xml generated with ALGO=Gw0 without any error.

Minimal example

# Note this script runs longer than 20 minutes
from pymatgen.core import Structure
from pymatgen.io.vasp.sets import MVLGWSet
from pymatgen.io.vasp import Vasprun
import os

# construct an FCC silicon structure
si_structure = Structure(
    lattice=[[0, 2.73, 2.73], [2.73, 0, 2.73], [2.73, 2.73, 0]],
    species=["Si", "Si"],
    coords=[[0, 0, 0], [0.25, 0.25, 0.25]],
)

static_job = MVLGWSet(si_structure, mode="STATIC")
static_job.write_input("test-static")
os.system("export OMP_NUM_THREADS=1 && cd test-static && mpirun -np 8 vasp_std && cd ..")

diag_job = MVLGWSet.from_prev_calc("test-static", mode="DIAG")
diag_job.write_input("test-diag")
os.system("export OMP_NUM_THREADS=1 && cd test-diag && mpirun -np 8 vasp_std && cd ..")

gw_job = MVLGWSet.from_prev_calc("test-diag", mode="GW")
gw_job.write_input("test-gw")
os.system("export OMP_NUM_THREADS=1 && cd test-gw && mpirun -np 8 vasp_std && cd ..")
vasprun = Vasprun("./test-gw/vasprun.xml") # Error

Relevant files to reproduce this bug

The minimal example above taks too long to run, but you may try to parse the following vasprun with Vasprun class.
vasprun.xml.zip

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

1 participant