pymatgen icon indicating copy to clipboard operation
pymatgen copied to clipboard

More robust parsing of (electronic) piezoelectric tensor from OUTCAR

Open knoori opened this issue 1 year ago • 0 comments

Feature Requested

Using VASP v6.3.2:

  1. Running a calculation with LEPSILON=.TRUE. and LRPA=.FALSE. produces the following OUTCAR line: PIEZOELECTRIC TENSOR (including local field effects) for field in x, y, z (C/m^2). This line does not match the search string in pymatgen > io > vasp > outputs.py line 2909, resulting in an improperly parsed piezo_tensor
  2. It would be useful to define a read_lcalceps() method, equivalent to read_lepsilon(), to extract the piezoelectric tensor from calculations using LCALCEPS=.TRUE. since it is sometimes beneficial to use the finite differences approach

Proposed Solution

  1. Modify the search string to look for the relevant elements of the output string, i.e. "PIEZOELECTRIC TENSOR" && "for field in x, y, z (C/m^2)" as opposed to the whole string. This would accommodate variations in the output related to VASP versions.
  2. Add a check for lcalceps and create a duel of the read_lepsilon()

Relevant Information

These changes would allow for

  1. greater compatibility with different VASP versions, which seem to use different output strings in the OUTCAR.
  2. ability to parse the piezolectric tensor from LCALCEPS calculations

knoori avatar Jul 12 '24 22:07 knoori