18.11.2012 Views

ASE Manual Release 3.6.1.2825 CAMd - CampOS Wiki

ASE Manual Release 3.6.1.2825 CAMd - CampOS Wiki

ASE Manual Release 3.6.1.2825 CAMd - CampOS Wiki

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>ASE</strong> <strong>Manual</strong>, <strong>Release</strong> 3.6.1.2828<br />

Note: For this reaction, the reaction coordinate is very simple: The x-coordinate of the Au atom. In such cases,<br />

the NEB method is overkill, and a simple constraint method should be used like in this tutorial: Diffusion of gold<br />

atom on Al(100) surface (constraint).<br />

See Also:<br />

• neb<br />

• constraints<br />

• Diffusion of gold atom on Al(100) surface (constraint)<br />

• fcc100()<br />

Parallelizing over images<br />

Instead of having one process do the calculations for all three internal images in turn, it will be faster to have three<br />

processes do one image each. This can be done like this:<br />

from ase.io import read<br />

from ase.constraints import FixAtoms<br />

from ase.calculators.emt import EMT<br />

from ase.neb import NEB<br />

from ase.optimize import BFGS<br />

from ase.io.trajectory import PickleTrajectory<br />

from ase.parallel import rank, size<br />

initial = read(’initial.traj’)<br />

final = read(’final.traj’)<br />

constraint = FixAtoms(mask=[atom.tag > 1 for atom in initial])<br />

images = [initial]<br />

j = rank * 3 // size # my image number<br />

for i in range(3):<br />

image = initial.copy()<br />

if i == j:<br />

image.set_calculator(EMT())<br />

image.set_constraint(constraint)<br />

images.append(image)<br />

images.append(final)<br />

36 Chapter 6. Tutorials

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!