I have VASP AIMD Outcar file with Hirshfeld charge per each atom.

I hope to convert this outcar file to extxyz file for MACE or NequIP MD framework training. Outcar file contains 800 frames (or images or configurations) of xyz and other data for atoms.

For the basic conversion from outcar to extxyz using ASE, I use script like this one:

from ase.io import read, write
input_data = read(input_file, index=':', format='vasp-out')
write(output_file, input_data, format='extxyz')

Or simply, I can execute

$ ase convert input.outcar output.extxyz

I can calculate virial of system from volume and stress of unit cell

input_data.info["virial"] = -input_data.get_volume() * input_data.get_stress()

But get_volume() and get_stress() cannot be used for list as I read the input file with index ":", all 800 frames of data. How can print virial of each frame to information line for all 800 frames?

Another problem is charge, but this is rather a double-check than a question. We know outcar file print out Hirshfeld charge table as:

  Hirshfeld-I charges:
            ion         q(e)        dq(e)

But I think ASE read/write cannot do anything about Hirshfeld charge, I can't find any ASE vasp read/write command related to Hirshfeld charge table.

So, I was thinking, I need write my own script to extract and append the Hirshfeld charge as new column to xyz file. Could anyone confirm this about ASE and Hirshfeld charge?


  • $\begingroup$ can you share a sample OUTCAR? $\endgroup$ Commented Mar 19 at 20:12


You must log in to answer this question.

Browse other questions tagged .