materialsproject / pymatgen

Python Materials Genomics (pymatgen) is a robust materials analysis code that defines classes for structures and molecules with support for many electronic structure codes. It powers the Materials Project.
https://pymatgen.org
Other
1.5k stars 862 forks source link

Zr is written as "r" in vasprun.xml hence exception is raised by Vasprun #377

Closed albalu closed 8 years ago

albalu commented 8 years ago

System

``` python from pymatgen.io.vasp.outputs import Vasprun run = Vasprun("vasprun.xml") ``` ## Error message ``` Traceback (most recent call last): File "test_Vasprun.py", line 5, in run = Vasprun("vasprun.xml") File "/home/research/alireza/.local/lib/python2.7/site-packages/pymatgen/io/vasp/outputs.py", line 378, in __init__ parse_projected_eigen=parse_projected_eigen) File "/home/research/alireza/.local/lib/python2.7/site-packages/pymatgen/io/vasp/outputs.py", line 417, in _parse self._parse_atominfo(elem) File "/home/research/alireza/.local/lib/python2.7/site-packages/pymatgen/io/vasp/outputs.py", line 964, in _parse_atominfo sym in atomic_symbols], potcar_symbols File "/home/research/alireza/.local/lib/python2.7/site-packages/pymatgen/io/vasp/outputs.py", line 960, in parse_atomic_symbol raise e ValueError: r is not a valid Element ``` ## Suggested solution (if any) - contacting VASP is a good idea but may take long. - similar to Xe add a condition: ``` python # ensure atomic symbols are valid elements def parse_atomic_symbol(symbol): try: return str(Element(symbol)) # vasprun.xml uses X instead of Xe for xenon except ValueError as e: if symbol == "X": return "Xe" elif symbol == "r": return "Zr" raise e ``` ## Files ``` The following example is for ZrSnO3 self consistent vasprun.xml ran on VASP 5.3.3 [ZrSnO3_Vasprun-test.zip](https://github.com/materialsproject/pymatgen/files/264679/ZrSnO3_Vasprun-test.zip) ```
shyuep commented 8 years ago

I don't think this is a standard bug. We have extensively worked with Zr based systems and this issue has never come up. Can you check your VASP compilation? Thanks.

albalu commented 8 years ago

Ok I just ran the same system on Edison on 5.3.3 (attached) and got the same error. Have you used Zr_sv in those materials? self.zip

mbkumar commented 8 years ago

I too faced this issue many times. On May 14, 2016 2:51 PM, "Shyue Ping Ong" notifications@github.com wrote:

I don't think this is a standard bug. We have extensively worked with Zr based systems and this issue has never come up. Can you check your VASP compilation? Thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/materialsproject/pymatgen/issues/377#issuecomment-219253556

shyuep commented 8 years ago

As far as I can see, the standard MP input set uses Zr_sv. There are plenty of Zr compounds on the MP website. If such a bug exists, it would have been detected some time ago.

What version of the PSP are you using? MP is using a pretty old one.

albalu commented 8 years ago

This is the heading of POTCAR for Zr:

PAW_PBE Zr_sv 04Jan2005
12.0000000000000
parameters from PSCTR are: VRHFIN =r: 4s4p5s4d LEXCH = PE EATOM = 1284.2219 eV, 94.3876 Ry

TITEL = PAW_PBE Zr_sv 04Jan2005 LULTRA = F use ultrasoft PP ? IUNSCR = 1 unscreen: 0-lin 1-nonlin 2-no RPACOR = 2.200 partial core radius POMASS = 91.224; ZVAL = 12.000 mass and valenz RCORE = 2.500 outmost cutoff radius RWIGS = 3.070; RWIGS = 1.625 wigner-seitz radius (au A) ENMAX = 229.898; ENMIN = 172.424 eV ICORE = 3 local potential LCOR = T correct aug charges LPAW = T paw PP EAUG = 461.257 DEXC = 0.000 RMAX = 2.561 core radius for proj-oper RAUG = 1.300 factor for augmentation sphere RDEP = 2.597 radius for radial grids RDEPT = 2.007 core radius for aug-charge

I agree that this is strange. I do not understand why VASP would print '>r' in vasprun.xml instead of '>Zr' which seems like the part pymatgen use to read the symbols.

computron commented 8 years ago

I am pretty sure MP is using PAW_PBE Zr_sv 07Sep2000

It would need to be confirmed, but this could be the reason for the difference

On Sun, May 15, 2016 at 10:12 AM, Alireza Faghanina < notifications@github.com> wrote:

This is the heading of POTCAR for Zr:

PAW_PBE Zr_sv 04Jan2005

12.0000000000000

parameters from PSCTR are: VRHFIN =r: 4s4p5s4d LEXCH = PE EATOM = 1284.2219 eV, 94.3876 Ry

TITEL = PAW_PBE Zr_sv 04Jan2005 LULTRA = F use ultrasoft PP ? IUNSCR = 1 unscreen: 0-lin 1-nonlin 2-no RPACOR = 2.200 partial core radius POMASS = 91.224; ZVAL = 12.000 mass and valenz RCORE = 2.500 outmost cutoff radius RWIGS = 3.070; RWIGS = 1.625 wigner-seitz radius (au A) ENMAX = 229.898; ENMIN = 172.424 eV ICORE = 3 local potential LCOR = T correct aug charges LPAW = T paw PP EAUG = 461.257 DEXC = 0.000 RMAX = 2.561 core radius for proj-oper RAUG = 1.300 factor for augmentation sphere RDEP = 2.597 radius for radial grids RDEPT = 2.007 core radius for aug-charge

I agree that this is strange. I do not understand why VASP would print '>r' in vasprun.xml instead of '>Zr' which seems like the part pymatgen use to read the symbols. This is what I get when I do 'grep ">r" vasprun.xml': r 3 1r 91.22400000 12.00000000 PAW_PBE Zr_sv 04Jan2005

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/materialsproject/pymatgen/issues/377#issuecomment-219298027

mbkumar commented 8 years ago

I faced this issue two years ago at LBNL. If I remember correctly, I was not using MP's psp. I was using one of the newer ones.

On Sat, May 14, 2016 at 10:37 PM, Shyue Ping Ong notifications@github.com wrote:

As far as I can see, the standard MP input set uses Zr_sv. There are plenty of Zr compounds on the MP website. If such a bug exists, it would have been detected some time ago.

What version of the PSP are you using? MP is using a pretty old one.

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/materialsproject/pymatgen/issues/377#issuecomment-219267580

Bharat Medasani Postdoctoral Associate, Pacific Northwest National Lab Richland, WA 99354 USA

shyuep commented 8 years ago

Ok. Pls implement a solution with a unittest and send a pull request. I will merge. Thanks.

gauthierlab commented 2 weeks ago

Apologies for reviving this nearly 10 year old issue, but since this is one of the first hits on a google search for relevant keywords, I thought I would comment here. After running into this issue myself (granted not using pymatgen or any MP packages), I spent too long digging into it and found the cause. I believe this is caused by a typo in the latest pseudo52 Zr_sv pseudopotential as hinted above. The VASP code that generates vasprun.xml determines the element symbol from the line "VRHFIN" in the POTCAR file, which for the Jan 4, 2005 Zr_sv POTPAW_PBE POTCAR file is erroneously labeled "r" rather than "Zr". Adjusting the text in this POTCAR file seems to resolve the issue. Hoping this will save anyone trying to resolve this problem in the future some time.