File: vacancy.py

package info (click to toggle)
python-ase 3.17.0-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 16,340 kB
  • sloc: python: 117,348; makefile: 91
file content (40 lines) | stat: -rw-r--r-- 1,124 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from ase import Atoms
from ase.optimize import QuasiNewton
from ase.neb import NEB
from ase.optimize.mdmin import MDMin
try:
    from asap3 import EMT
except ImportError:
    pass
else:

    a = 3.6
    b = a / 2
    initial = Atoms('Cu4',
                    positions=[(0, 0, 0),
                               (0, b, b),
                               (b, 0, b),
                               (b, b, 0)],
                    cell=(a, a, a),
                    pbc=True)
    initial *= (4, 4, 4)
    del initial[0]
    images = [initial] + [initial.copy() for i in range(6)]
    images[-1].positions[0] = (0, 0, 0)
    for image in images:
        image.set_calculator(EMT())
        #image.set_calculator(ASAP())

    for image in [images[0], images[-1]]:
        QuasiNewton(image).run(fmax=0.01)
    neb = NEB(images)
    neb.interpolate()

    for a in images:
        print(a.positions[0], a.get_potential_energy())

    dyn = MDMin(neb, dt=0.1, trajectory='mep1.traj')
    #dyn = QuasiNewton(neb)
    print(dyn.run(fmax=0.01, steps=25))
    for a in images:
        print(a.positions[0], a.get_potential_energy())