File: test_emt2.py

package info (click to toggle)
python-ase 3.26.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,484 kB
  • sloc: python: 148,112; xml: 2,728; makefile: 110; javascript: 47
file content (17 lines) | stat: -rw-r--r-- 446 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# fmt: off
from ase import Atoms
from ase.build import molecule
from ase.calculators.emt import EMT


def test_emt2():
    a1 = Atoms('Au', calculator=EMT())
    e1 = a1.get_potential_energy()
    a2 = molecule('C6H6', calculator=EMT())
    e2 = a2.get_potential_energy()
    a1.translate((0, 0, 50))
    a3 = a1 + a2
    a3.calc = EMT()
    e3 = a3.get_potential_energy()
    print(e1, e2, e3, e3 - e1 - e2)
    assert abs(e3 - e1 - e2) < 1e-13