File: test_idpp.py

package info (click to toggle)
python-ase 3.21.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 13,936 kB
  • sloc: python: 122,428; xml: 946; makefile: 111; javascript: 47
file content (22 lines) | stat: -rw-r--r-- 568 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
22
from ase.build import molecule
from ase.neb import NEB, idpp_interpolate


def test_idpp():
    initial = molecule('C2H6')
    final = initial.copy()
    final.positions[2:5] = initial.positions[[3, 4, 2]]

    images = [initial]
    for i in range(5):
        images.append(initial.copy())
    images.append(final)

    neb = NEB(images)
    d0 = images[3].get_distance(2, 3)
    neb.interpolate()
    d1 = images[3].get_distance(2, 3)
    idpp_interpolate(neb, fmax=0.005)
    d2 = images[3].get_distance(2, 3)
    print(d0, d1, d2)
    assert abs(d2 - 1.74) < 0.01