[ase-users] Dimer
Michael Joseph Waters
michael.j.waters at northwestern.edu
Fri Jan 17 17:33:39 CET 2020
Hi Zainab,
Frustratingly, my institute blocks me from downloading or viewing *.py files. Here's my expanded example:
#!/usr/bin/env python3
from ase.visualize import view
from ase.build import fcc100, add_adsorbate
from ase.constraints import FixAtoms
from ase.calculators.emt import EMT
from ase.optimize import BFGS
from ase.dimer import DimerControl, MinModeAtoms, MinModeTranslate
import numpy as np
logfile = '-'
fdstep = 0.2
fmax = 0.01
# Set up a small "slab" with an adatoms
atoms = fcc100('Pt', size = (3, 3, 2), vacuum = 10.0)
add_adsorbate(atoms, 'Cu', 1.611, 'hollow')
# Freeze the "slab"
mask = [atom.z < 11.0 for atom in atoms]
atoms.set_constraint(FixAtoms(mask = mask))
dimer_mask = [1]*len(atoms)
for flag,i in enumerate( mask):
if flag:
dimer_mask[i]=0
# Calculate using EMT
atoms.set_calculator(EMT())
#### relax initial structure
initial_energy = atoms.get_potential_energy()
dyn = BFGS(atoms, trajectory = 'bfgs.traj',logfile = logfile)
dyn.run(fmax=fmax)
relaxed_energy = atoms.get_potential_energy()
initial = atoms.copy()
#### Set up the dimer
d_control = DimerControl(initial_eigenmode_method = 'displacement', \
displacement_method = 'vector', logfile = None, \
mask = dimer_mask)
d_atoms = MinModeAtoms(atoms, d_control)
# Displace the atoms
displacement_vector = [[0.0]*3]*(len(atoms))
displacement_vector[-1] = [0.1, 0.02, 0.1]
displacement_vector = fdstep / np.linalg.norm(displacement_vector) *np.array(displacement_vector)
d_atoms.displace(displacement_vector = displacement_vector)
# Converge to a saddle point
dim_rlx = MinModeTranslate(d_atoms, trajectory = 'dimer_method.traj', \
logfile = logfile)
dim_rlx.run(fmax = fmax)
dimer_direction = dim_rlx.cg_direction
saddle = atoms.copy()
view([initial, saddle])
Best,
-Mike
________________________________
From: ase-users-bounces at listserv.fysik.dtu.dk <ase-users-bounces at listserv.fysik.dtu.dk> on behalf of Alaithan, Zainab via ase-users <ase-users at listserv.fysik.dtu.dk>
Sent: Friday, January 17, 2020 1:06 AM
To: Ase-users <ase-users at listserv.fysik.dtu.dk>
Subject: [ase-users] Dimer
Dear ASE-users,
This is my first go at the dimer method. I attached my script. I am getting the following error:
NotImplementedError: initial_eigenmode must use either 'gauss' or 'displacement', if the latter is used the atoms must have moved away from the original positions.You have requested 'displacement'.
It is not clear to me why I am getting this error.
I am also wondering how to accurately initialise the Eigen mode search if I already have frequency calculations.
Any help will be appreciated.
Regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20200117/0e170869/attachment.html>
More information about the ase-users
mailing list