# Best way to read forces and positions and energies into Atomic Simulation Environment (ASE)?

My current procedure is to create a .xyz file out of my MD run for a crystal structure. I can read the energy and also each atomic position. But I want to add forces. If I add forces as the additional three columns for each atom, ASE seems to ignore this. ASE considers only the first three columns per atom which are the positions.

What's the best way to read positions and forces into ASE?

I'm working with FHI aims and I've just done an MD run. I don't think this is as important because the object to read FHI aims with ASE seems to be deprecated.

• +1 Welcome to our new community and thank you for contributing your question here!! We hope to see much more of you in the future! How did you find us? Jul 26, 2021 at 7:47
• @Vasista Googling!
– DLV
Jul 26, 2021 at 7:55
• I think the easiest way is to print the forces into a separate xyz-file. You can read this in as if it were positions into a second Atoms object, then loop over all images and copy the "forces/positions" from the second object into the first one. Jul 26, 2021 at 9:55

ASE should be able to read forces from the additional columns. Here is an example of an .xyz file which contains forces.

2
Lattice="6.0 0.0 0.0 0.0 6.0 0.0 0.0 0.0 6.0" Properties=species:S:1:pos:R:3:forces:R:3:magmoms:R:1 energy=-6.801137982077364 dipole="-1.3543798178593251e-15 -1.5609399349163789e-15 6.566746345129899e-16" magmom=0.0 pbc="F F F"
H        3.00000000       3.00000000       2.62674398      -0.00000000      -0.00000000      -0.00053835       0.00000000
H        3.00000000       3.00000000       3.37325602      -0.00000000      -0.00000000       0.00053835       0.00000000


For ASE to read it with forces, you can do

>>> import ase.io