Atomic-site potential

Dear all,

I found Outcar class in pymatgen.io.vasp.outputs erroneously gets the electrostatic potential using read_electrostatic_potential method. For example, when the potential is as follows (note that the integer part of the potential is larger than -10 eV),

average (electrostatic) potential at core
the test charge radii are 1.2767 0.7215
(the norm of the test charge is 1.0000)
1 -9.4294 2 -9.4898 3 -8.5670 4 -9.4558 5 -9.4657
6 -9.2104 7 -9.5401 8 -9.5549 9 -9.4029 10 -9.5652

Then the generated electrostatic potential becomes [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, …
If the code of outputs.py at Line 1799 is modified as follows, the problem will be solved.
from
pots = re.findall(r"\s+\d+\s?([.-\d]+)+", pots)
to
pots = re.findall(r”\s+\d+\s*?([.-\d]+)+“, pots)
(change the regular expression for multiple spaces.)

Sincerely,
Yu Kumagai

1 Like

Thanks. I pushed a fix, though I do not have an example Outcar to test this.

Thank you for the prompt fix.