root / ase / test / neb.py @ 4
Historique | Voir | Annoter | Télécharger (695 octet)
| 1 |
from ase.io import PickleTrajectory |
|---|---|
| 2 |
from ase.neb import NEB |
| 3 |
from ase.calculators.lj import LennardJones |
| 4 |
from ase.optimize import QuasiNewton |
| 5 |
|
| 6 |
print [a.get_potential_energy() for a in PickleTrajectory('H.traj')] |
| 7 |
images = [PickleTrajectory('H.traj')[-1]] |
| 8 |
for i in range(4): |
| 9 |
images.append(images[0].copy())
|
| 10 |
images[-1].positions[6, 1] = 2 - images[0].positions[6, 1] |
| 11 |
neb = NEB(images) |
| 12 |
neb.interpolate() |
| 13 |
|
| 14 |
for image in images: |
| 15 |
image.set_calculator(LennardJones()) |
| 16 |
|
| 17 |
for a in neb.images: |
| 18 |
print a.positions[-1], a.get_potential_energy() |
| 19 |
|
| 20 |
dyn = QuasiNewton(neb, trajectory='mep.traj')
|
| 21 |
print dyn.run(fmax=0.01, steps=25) |
| 22 |
for a in neb.images: |
| 23 |
print a.positions[-1], a.get_potential_energy() |