[ase-users] Using sockets to do NEB calculations
Ask Hjorth Larsen
asklarsen at gmail.com
Thu Jun 18 20:28:55 CEST 2020
Dear Kushagra,
The mail software destroys the script formatting, Can you attach the
text file so the formatting is intact please?
Best regards
Ask
Am Mi., 17. Juni 2020 um 13:30 Uhr schrieb Kushagra Agrawal via
ase-users <ase-users at listserv.fysik.dtu.dk>:
>
> Hi everyone
>
> I am trying to run neb with sockets using FHI-aims calculator. But the problem is, the sockets are not working. When I try to define the socket calculator outside the for loop of images, it tells me I need a new calculator for every image. And when I try to define it within the for loop, it just gives me a socket time out error.
> Can anyone confirm whether it is possible to run the NEB at all with the sockets? for reference, I am copying the code here.
>
> from ase.constraints import FixAtoms
> from ase.io import read, write
> from ase.calculators.aims import Aims, AimsCube
> from ase.calculators.lj import LennardJones
> from ase.neb import NEB
> #from ase.optimize import MDMin
> from ase.optimize.fire import FIRE as QuasiNewton
> from ase.calculators.socketio import SocketIOCalculator
> import socket
>
> #port
> port=22736
>
> #Calculator
> def calc():
> cal= Aims(k_grid='5 5 4',
> xc='pbe',
> vdw_correction_hirshfeld='true',
> spin="none",
> relativistic="atomic_zora scalar",
> sc_iter_limit="300",
> compute_forces="true",
> final_forces_cleaned='true',
> use_dipole_correction="true",
> use_pimd_wrapper=(socket.gethostname(), port))
> return SocketIOCalculator(cal, port=port)
>
> # Make images
> images = read('traj.traj@:')
>
> #define atoms to freeze
> freeze=FixAtoms(indices=[12,36,14,38,18,42,16,40,0,24,2,26,6,30,4,28,45,21,47,23,33,9,35,11])
>
> #setting the calculator
> for image in images:
> image.set_calculator(calc())
> image.set_constraint(freeze)
>
> # Make the NEB object, interpolate to guess the intermediate steps
> neb = NEB(images, climb=True)
>
> # Relax the NEB path:
> minimizer = QuasiNewton(neb, trajectory='neb.traj')
> minimizer.run(fmax=0.05)
>
> socket.close()
>
>
> Any leads with this will be appreciated.
>
> Regards
> Kushagra Agrawal
> Visiting Doctoral Researcher
> 0.27, Department of Chemistry
> Cardiff School of Chemistry
> Cardiff University
> Cardiff CF10 3AT
> UK
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
More information about the ase-users
mailing list