Hi, everyone
I am trying to read from OUTCAR (my results file of VASP) and rewrite it as XYZ file.
For MACE, the most important thing is the second line of XYZ file.
In the second line, I want to rewrite the key ‘free_energy’ as ‘energy_dft’
I try the follwing code but failed:
from ase.io import read, write
db = read(‘OUTCAR.vasp’,‘:’)
for at in db[:3]:
at.info[‘energy_dft’] = at.info[‘free_energy’]
print(at.info[‘energy_dft’])
Traceback (most recent call last):
File “d:\code\GAP\test.py”, line 18, in
at.info[‘energy_dft’] = at.info[‘free_energy’]
~~~~~~~^^^^^^^^^^^^^^^
KeyError: ‘free_energy’
It seems that ‘free_energy’ is not the key
but when I rewrite the OUTCAR as XYZ file
I find ‘free_energy’ at the second line of XYZ file like:
free_energy=-899.98937524 energy=-899.98937524 pbc=“T T T”
How can I make ASE realize that ‘free_energy’ at the second line of XYZ file is a info or key so that I can easily use its value?
I am new to ASE. Some description may not be correct.
Thank you!
Baoshuai.