3
$\begingroup$

Here is a little python code that loops through a molecular dynamics trajectory (performed with the ASE package) and outputs the forces on the atoms at each frame:

from ase.io import read
traj = read('output.traj', index=':')

counter = 0
for atoms in traj:
    forces = atoms.get_forces()
    print("forces: ",forces)

    print("counter: ", counter)
    counter = counter + 1

This is all well and good... but I'm not sure what the units are on the forces that are outputted.

According to the documentation, the units from get_forces() depends on the calculator that is attached to the atoms object: Docs_get_forces

But I didn't specify a calculator in my little code snippet and it outputted the forces anyway. I tried to check the calculator used by adding these lines:

calculator = atoms.get_calculator()
print(calculator)

According to this, the calculator attached to my atoms is SinglePointCalculator. But when I looked up the source code for this calculator, I can't find where the get_forces() calculation is being done, or any of the units associated with it.

TLDR; What are the default force units outputted by ASE? Thank you for your help.

$\endgroup$
2
  • 3
    $\begingroup$ ASE typically uses $eV/Å$ for force measurements. But for the SinglePointCalculator: forces are stored, not calculated. Consequently, the forces you get via get_forces() are contingent on the units specified in the originating simulation. $\endgroup$ Sep 14 at 4:58
  • 1
    $\begingroup$ Thank you very much! $\endgroup$ Sep 14 at 19:19

0

You must log in to answer this question.