[gpaw-users] NEB problem
moussounda mba giscard melvins
mbmoussounda at yahoo.fr
Mon Sep 30 19:38:32 CEST 2024
Hello,I am Doctor Giscard, I am contacting you. indeed, I would like to do a NEB calculation, to start I used the scripts that are on the sites:from ase.build import add_adsorbate, fcc100
from ase.calculators.emt import EMT
from ase.constraints import FixAtoms
from ase.optimize import QuasiNewton
# 2x2-Al(001) surface with 3 layers and an
# Au atom adsorbed in a hollow site:
slab = fcc100('Al', size=(2, 2, 3))
add_adsorbate(slab, 'Au', 1.7, 'hollow')
slab.center(axis=2, vacuum=4.0)
# Make sure the structure is correct:
# view(slab)
# Fix second and third layers:
mask = [atom.tag > 1 for atom in slab]
# print(mask)
slab.set_constraint(FixAtoms(mask=mask))
# Use EMT potential:
slab.calc = EMT()
# Initial state:
qn = QuasiNewton(slab, trajectory='initial.traj')
qn.run(fmax=0.05)
# Final state:
slab[-1].x += slab.get_cell()[0, 0] / 2
qn = QuasiNewton(slab, trajectory='final.traj')
qn.run(fmax=0.05)The file nitial.traj and final.traj have been created. but unfortunately by applying this NED execution script
from ase.calculators.emt import EMT
from ase.constraints import FixAtoms
from ase.io import read
from ase.mep import NEB
from ase.optimize import BFGS
initial = read('initial.traj')
final = read('final.traj')
constraint = FixAtoms(mask=[atom.tag > 1 for atom in initial])
images = [initial]
for i in range(3):
image = initial.copy()
image.calc = EMT()
image.set_constraint(constraint)
images.append(image)
images.append(final)
neb = NEB(images)
neb.interpolate()
qn = BFGS(neb, trajectory='neb.traj')
qn.run(fmax=0.05)
I encountered a problem while executing ase.mep NEB.Import ase.mep NEB is not recognized,
moussounda at moussounda-HP-Compaq-8200-Elite-SFF-PC:~/Bureau/NEB_essai$ python3 neb_cal_2.py
Traceback (most recent call last):
File "/home/moussounda/Bureau/NEB_essai/neb_cal_2.py", line 2, in <module>
from ase.mep import NEB
ModuleNotFoundError: No module named 'ase.mep'
I wanted to apply NEB on the script below
from ase import *
from ase.visualize import *
from numpy import *
import numpy as np
from ase.constraints import FixAtoms
import pickle
from ase.lattice import bulk
from gpaw import GPAW, PW, FermiDirac
from ase.dft.kpoints import ibz_points, get_bandpath
from ase.optimize import BFGS
from ase.build import fcc100, add_adsorbate
maille = np.array([2*3.7520, 2*2.653, 13*1.32653])
slab = Atoms(symbols='Cu16N1O2',
cell = maille,pbc=True,
positions = maille * np.array([
[ 0.25, 0.25, -1/13.], # Cu
[ 0.75, 0.25, -1/13.], # Cu
[ 0.25, 0.75, -1/13.], # Cu
[ 0.75, 0.75, -1/13.], # Cu
[ 0.0, 0.0, 0.0], # Cu
[ 0.5, 0.0, 0.0], # Cu
[ 0.0, 0.5, 0.0], # Cu
[ 0.5, 0.5, 0.0], # Cu
[ 0.25, 0.25, 1/13.], # Cu
[ 0.75, 0.25, 1/13.], # Cu
[ 0.25, 0.75, 1/13.], # Cu
[ 0.75, 0.75, 1/13.], # Cu
[ -0.002657649, -0.005406709, 0.146849415], # Cu
[ 0.502691764, -0.004386167, 0.146925495], # Cu
[ 0.012483076, 0.497581606, 0.152054319], # Cu
[ 0.489395389, 0.498185639, 0.151707259],# Cu
[ 0.256866205, 0.306353185, 0.295564309], # N
[ 0.403167377, 0.361709197, 0.260746401],# O
[ 0.110092884, 0.361707878, 0.261133472]]))# O
c = FixAtoms(indices=range(12))
slab.set_constraint(c)
view(slab*[2,2,2])
calc = GPAW(txt='2x2_NO2hollow_0.25_110_vdW',
xc='vdW-DF',
mode=PW(400),
setups={'N2O': '1'},
kpts=(6,6,1),
atoms=slab)
dyn = BFGS(slab)
dyn.run(fmax=0.05)
e1 = slab.get_potential_energy()
slab.calc.write('NO2hollow_0.25_zero.gpw')
print (e1)
print (slab.get_forces())
slab.pbc = True
slab.calc.set(txt='NO2hollow_0.25_periodic.txt')
e2 = slab.get_potential_energy()
slab.calc.write('NO2hollow_0.25_periodic.gpw')
print (e2)
slab.pbc = (True, True, False)
slab.calc.set(poissonsolver={'dipolelayer': 'xy'},
txt='NO2hollow_0.25_corrected.txt')
e3 = slab.get_potential_energy()
slab.calc.write('NO2hollow_0.25_corrected.gpw')
print (e3)
Hoping to have a follow-up, I send you my greetings.
Sincerely
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/gpaw-users/attachments/20240930/cb5f3474/attachment-0001.htm>
More information about the gpaw-users
mailing list