[ase-users] Asking for Help

Jakob Schiøtz schiotz at fysik.dtu.dk
Wed Feb 23 10:48:23 CET 2022


Maybe you should not recreate the Langevin object inside the loop, but create it before the loop and just set the temperature with

dynamics.set_temperature(temperature_K=T)

Best regards

Jakob

--
Jakob Schiøtz, professor, Ph.D.
Department of Physics
Technical University of Denmark
DK-2800 Kongens Lyngby, Denmark




> On 22 Feb 2022, at 22.32, Firas Shuaib via ase-users <ase-users at listserv.fysik.dtu.dk> wrote:
> 
> Hi Adam,
> Thank you very much for your email. Sorry for not understanding what I mean. Please find attached documents. I did MD run at [1000 700 500 300], and at every temperature run I saved the log and traj files. T o make a simple example I took the last 25% from each log and traj file and I appended that to the file that I attached now. But when I plot T[K] VS time, I got this graph and this what I meant by start from scratch. Also For the traj file I see the same problem. But I will do your suggestion about moving the Maxwell Boltzmann Distribution part outside the loop,and see whether anything will change or not. Please let me know if there is any more suggestions.
> Thank you,
> Firas  
> 
> On Tuesday, February 22, 2022, 10:56:13 PM GMT+2, Adam Jackson <a.j.jackson at physics.org> wrote: 
> 
> 
> Hi Firas,
>  
> What exactly do you mean by “start from scratch”? Do you mean that the atom positions are reset to the original Si structure? I don’t understand how that would happen, because Dynamics does update the atom positions. I tried similar code to yours and the Atoms object was updated.
>  
> What I would expect to see from your code is that the atoms suddenly change direction in between each MD trajectory, because the velocities are re-initialised by MaxwellBoltzmannDistribution. Is this what you mean by “That can be seen when plot the Thermal cycle.”? Your code sets this distribution to double the thermostat temperature (2 * T * units.kB), so I’d expect the energy to spike high at each restart and then converge down to the target. To be honest I don’t see the benefit in doing it this way if you are doing a simulated annealing calculation; maybe you should move the MaxwellBoltzmannDistribution part outside the loop, and just do it for the first step?
>  
> All the best,
> Adam
>  
> From:Firas Shuaib <firasshuaib at yahoo.com>
> Date: Tuesday, 22 February 2022 at 19:53
> To: ase-users at listserv.fysik.dtu.dk <ase-users at listserv.fysik.dtu.dk>, Adam Jackson <a.j.jackson at physics.org>
> Subject: Re: Asking for Help
> 
> Hi Adam,
> Thank you for your email. Actually the problem not in writing data on a file, I did your suggestions and i got 4 files but all of then start from scratch not from the last point of the previous MD run. That can be seen when plot the Thermal cycle.
> 
> The problem is I get a data for the run at 1000K then, when the loop move on and start the run at 700K it starts from scratch not from the restart file. I do not know how to let the MD run starts from the last point of the previous run not from scratch.
> 
> Thank you in Advance,
> Firas
> 
> *****************************************
> Firas Shuaib, PHD Researcher.
> Institut de Recherche sur les Céramiques
> IRCER CNRS UMR 7315
> Centre Européen de la Céramique
> 12 Rue Atlantis, 87068 Limoges, France
> Tel: +33751084024
> E-mail: firasshuaib at yahoo.com, firas.shuaib at etu.unilim.fr
> *****************************************
> 
> On Tuesday, February 22, 2022, 06:02:26 PM GMT+2, Adam Jackson <a.j.jackson at physics.org> wrote:
>  
>  
> Hi Firas,
>  
> Something like that should indeed be possible. What errors are you encountering?
>  
> One possible issue I see in your code is that you create a new Trajectory with the same name in ‘w’ mode inside the loop. This means that each iteration will overwrite the last one, which is probably not what you intended. Perhaps it would be a good idea to e.g. include the temperature in the filename with
>  
> traj_writer = Trajectory(f‘md_runs_si/si_traj_{T}K.traj’, ‘w’, si)
>  
> Or you could append to the existing trajectory with ‘a’ mode, leaving existing steps intact. Or you could set up the trajectory writer outside the loop, and only update the dynamics.
>  
> Regards,
> Adam
> 
> Date: Mon, 21 Feb 2022 15:37:50 +0000 (UTC)
> From: Firas Shuaib <firasshuaib at yahoo.com>
> To: ase-users at listserv.fysik.dtu.dk
> Subject: [ase-users] Asking for Help
> Message-ID: <828946716.1074470.1645457870610 at mail.yahoo.com>
> Content-Type: text/plain; charset="utf-8"
> 
> Dear All,
> Hope this email finds you well. This Firas SHUAIB. I am a master holder of Condensed matter physics. Recently, I am trying to learn how to use ASE to train a gap model. I have a problem in creating a dateset. I want to run Molecular dynamics for a simple NVT system? Si? at different temperature [1000, 700, 500, 300]. I have a problem in restarting the simulation, I want when the simulation is done at 1000 to restart from the last point and just the change the temperature. I have tried different ways but non of them worked. Please find attached screenshot. could you guide me with this ?
> 
>  Thank you in advance,
>  Firas
> 
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: Screenshot from 2022-02-19 12-56-43.png
> Type: image/png
> Size: 261077 bytes
> Desc: not available
> URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20220221/cae95ce8/attachment.png>
> 
> <Selected_log><see.png>_______________________________________________
> 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