I am trying to use EAM calculator in ASE. I want to perform simulation box relaxation with EAM potential. The code is working fine with EMT but fails in EAM as stress property is not implemented with EAM calculator. Any suggestion to solve this problem?

from ase.calculators.eam import EAM
from ase.build import bulk
from ase.optimize.sciopt import SciPyFminCG as CG
from ase.constraints import UnitCellFilter as box_relax
from ase.optimize import BFGS
from ase.calculators.emt import EMT
s1 = bulk('Al', 'fcc', a=4.10,cubic=True)

mishin = EAM(potential='Al99.eam.alloy')
s1.calc = mishin
ucf = box_relax(s1)
dyn = BFGS(ucf)


PropertyNotImplementedError: stress property not implemented

  • $\begingroup$ I gave my +1 long ago, but just wanted to say that I pinged Tristan and Fabian here to try to get answers before the bounty expires. Is there anyone else from MMSE or from outside of MMSE to whom you'd like me to bring attention about this question? $\endgroup$ Jan 30 at 21:38

2 Answers 2


I can't give you an elegant solution in that if a calculator does not supply stresses, then you cannot get them. However, the definition of stress allows for a numerical approach to be taken and you may be able to use this function in ASE to do so.

You may have to patch your calculator so that get_stress actually calls get_numerical_stress, but this is relatively simple if you derive a new class or simply run calc.get_stress = calc.get_numerical_stress. The performance will be much worse since it will do finite difference with respect to cell vectors, but if you need stress then this may be the only option.

  • 1
    $\begingroup$ EAM calculator is doing same thing as lammps do molecular statics. Stress can be added as static part of viral stress. I am waiting for other to answer or any ASE developer to add this. $\endgroup$ Jan 31 at 2:23

Calculating the virial tensor (and then the stress) is non-trivial for systems with many-body forces in a fully periodic simulation (see https://aip.scitation.org/doi/10.1063/1.3245303 -- note that some of the authors are core LAMMPS devs). It is a lot more straightforward with pair-wise central forces.

LAMMPS can do this calculation, but LAMMPS has very intricate programming "behind the scenes" to handle periodic images (this is why, for example, LAMMPS is not restricted by minimum image conventions). This is not something other packages may not bother to implement, especially if it is not asked for by most of their users. So the most straightforward way to proceed is to run this calculation in LAMMPS.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .