Getting LDAU-related parameters from Vasprun.parameters

There seems to be a trivial issue in getting LDAU-related parameters from vasprun.xml using the Vasprun(“vasprun.xml”).parameters.

I tried to get LDAUU or LDAUJ parameters using Vasprun(“vasprun.xml”).parameters (“Incar object with parameters that vasp actually used”). But it only gave the LDAUU or LDAUJ parameter for the first element, even though LDAUU or LDAUJ parameters for all elements are set correctly in the OUTCAR file.

Code:
from pymatgen.io.vasp.outputs import Vasprun
vasprun = Vasprun(‘vasprun.xml’)
print(vasprun.incar.get(“LDAUU”))
print(vasprun.parameters.get(“LDAUU”))

Results:
[0.0, 3.3, 0.0]
[0.0]

Hi @sjoo,

This is actually not a pymatgen bug, but a problem in VASP itself. That’s how it stores the LDAU data in parameters and it’s still unclear to me how someone is supposed to figure out which parameter goes with which element and what happens if someone was to use site-specific U’s. I’ve stopped using Vasprun as a source of LDAU parameters.

1 Like

Hi @shyamd,
Thanks for your detailed response. If so, I will use the Incar object (or vasprun.incar) instead, and check the OUTCAR carefully as well.

@sjoo, have you tried looking inside the vasprun.xml to verify? I’m examining a sample file of my own and I see the LDAUU key repeated twice:

  <v name="LDAUU">      5.30000000      0.00000000</v>

and then, later,

  <v name="LDAUU">      5.30000000</v>

The first instance can be accessed via vasprun.incar['LDAUU'] and the second with vasprun.parameters['LDAUU'].

It’s not clear to me why VASP does not store the full list in the parameters, but the correct information seems to be still accessible via the .incar attribute.

1 Like

@mkhorton , I’m just going through the vasprun.xml and get the same results as yours. I recognize that it is a problem in VASP itself, as @shyamd mentioned. Thanks for useful instructions.

1 Like