File: test_forcecurve.py

package info (click to toggle)
python-ase 3.24.0-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 15,448 kB
  • sloc: python: 144,945; xml: 2,728; makefile: 113; javascript: 47
file content (21 lines) | stat: -rw-r--r-- 561 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from ase.build import bulk
from ase.calculators.emt import EMT
from ase.io import read
from ase.md import VelocityVerlet
from ase.units import fs
from ase.utils.forcecurve import force_curve


def test_forcecurve(testdir, plt):
    atoms = bulk('Au', cubic=True) * (2, 1, 1)
    atoms.calc = EMT()
    atoms.rattle(stdev=0.05)

    with VelocityVerlet(atoms, timestep=12.0 * fs,
                        trajectory='tmp.traj') as md:
        md.run(steps=10)
    images = read('tmp.traj', ':')
    force_curve(images)

    # import pylab as plt
    # plt.show()