/usr/share/pyshared/ase/test/replay.py is in python-ase 3.6.0.2515-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | from math import sqrt
from ase import Atoms, Atom
from ase.constraints import FixAtoms
from ase.calculators.emt import EMT
from ase.optimize import QuasiNewton
from ase.io import read
from ase.vibrations import Vibrations
# Distance between Cu atoms on a (100) surface:
d = 3.6 / sqrt(2)
a = Atoms('Cu',
positions=[(0, 0, 0)],
cell=(d, d, 1.0),
pbc=(True, True, False))
a *= (2, 2, 1) # 2x2 (100) surface-cell
# Approximate height of Ag atom on Cu(100) surfece:
h0 = 2.0
a += Atom('Ag', (d / 2, d / 2, h0))
if 0:
view(a)
constraint = FixAtoms(range(len(a) - 1))
a.set_calculator(EMT())
a.set_constraint(constraint)
dyn1 = QuasiNewton(a, trajectory='AgCu1.traj', logfile='AgCu1.log')
dyn1.run(fmax=0.1)
a = read('AgCu1.traj')
a.set_calculator(EMT())
print a.constraints
dyn2 = QuasiNewton(a, trajectory='AgCu2.traj', logfile='AgCu2.log')
dyn2.replay_trajectory('AgCu1.traj')
dyn2.run(fmax=0.01)
|