[ase-users] Using sockets to do NEB calculations

Kushagra Agrawal AgrawalK2 at cardiff.ac.uk
Fri Jun 19 22:07:53 CEST 2020


Hi,

Thank you for your email.
Please find attached the script.


Regards
Kush
________________________________
From: Ask Hjorth Larsen <asklarsen at gmail.com>
Sent: 18 June 2020 19:28
To: Kushagra Agrawal <AgrawalK2 at cardiff.ac.uk>
Cc: ase-users at listserv.fysik.dtu.dk <ase-users at listserv.fysik.dtu.dk>
Subject: Re: [ase-users] Using sockets to do NEB calculations

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://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.fysik.dtu.dk%2Fmailman%2Flistinfo%2Fase-users&amp;data=02%7C01%7CAgrawalK2%40cardiff.ac.uk%7C53f38fe4c4c248eceab608d813b57d37%7Cbdb74b3095684856bdbf06759778fcbc%7C1%7C0%7C637281017489411884&amp;sdata=%2BGgYz13HafgHFq%2Fk9N0wcbB2%2FfWdvjWV%2Bgf%2F5fpoPLk%3D&amp;reserved=0
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20200619/cd380012/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: neb
Type: application/octet-stream
Size: 1182 bytes
Desc: neb
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20200619/cd380012/attachment-0001.obj>


More information about the ase-users mailing list