root / ase / test / Ag-Cu100.py @ 4
Historique | Voir | Annoter | Télécharger (1,59 ko)
| 1 |
from math import sqrt |
|---|---|
| 2 |
from ase import Atom, Atoms |
| 3 |
from ase.neb import NEB |
| 4 |
from ase.constraints import FixAtoms |
| 5 |
from ase.vibrations import Vibrations |
| 6 |
from ase.calculators.emt import EMT |
| 7 |
from ase.optimize import QuasiNewton |
| 8 |
|
| 9 |
# Distance between Cu atoms on a (100) surface:
|
| 10 |
d = 3.6 / sqrt(2) |
| 11 |
initial = Atoms('Cu',
|
| 12 |
positions=[(0, 0, 0)], |
| 13 |
cell=(d, d, 1.0),
|
| 14 |
pbc=(True, True, False)) |
| 15 |
initial *= (2, 2, 1) # 2x2 (100) surface-cell |
| 16 |
|
| 17 |
# Approximate height of Ag atom on Cu(100) surfece:
|
| 18 |
h0 = 2.0
|
| 19 |
initial += Atom('Ag', (d / 2, d / 2, h0)) |
| 20 |
|
| 21 |
if 0: |
| 22 |
view(initial) |
| 23 |
|
| 24 |
# Make band:
|
| 25 |
images = [initial.copy() for i in range(6)] |
| 26 |
neb = NEB(images, climb=True)
|
| 27 |
|
| 28 |
# Set constraints and calculator:
|
| 29 |
constraint = FixAtoms(range(len(initial) - 1)) |
| 30 |
for image in images: |
| 31 |
image.set_calculator(EMT()) |
| 32 |
image.set_constraint(constraint) |
| 33 |
|
| 34 |
# Displace last image:
|
| 35 |
images[-1].positions[-1] += (d, 0, 0) |
| 36 |
#images[-1].positions[-1] += (d, d, 0)
|
| 37 |
|
| 38 |
# Relax height of Ag atom for initial and final states:
|
| 39 |
dyn1 = QuasiNewton(images[0])
|
| 40 |
dyn1.run(fmax=0.01)
|
| 41 |
dyn2 = QuasiNewton(images[-1])
|
| 42 |
dyn2.run(fmax=0.01)
|
| 43 |
|
| 44 |
# Interpolate positions between initial and final states:
|
| 45 |
neb.interpolate() |
| 46 |
|
| 47 |
for image in images: |
| 48 |
print image.positions[-1], image.get_potential_energy() |
| 49 |
|
| 50 |
#dyn = MDMin(neb, dt=0.4)
|
| 51 |
#dyn = FIRE(neb, dt=0.4)
|
| 52 |
dyn = QuasiNewton(neb, trajectory='mep.traj')
|
| 53 |
dyn.run(fmax=0.05)
|
| 54 |
|
| 55 |
for image in images: |
| 56 |
print image.positions[-1], image.get_potential_energy() |
| 57 |
|
| 58 |
a = images[0]
|
| 59 |
vib = Vibrations(a, [4])
|
| 60 |
vib.run() |
| 61 |
print vib.get_frequencies()
|
| 62 |
vib.summary() |
| 63 |
print vib.get_mode(-1) |
| 64 |
vib.write_mode(-1, nimages=20) |