.. _example-md: Molecular dynamics ######################################## This tutorial will use MLatom@XACS program. See its `manual `_ and `tutorials `_ for more details. In this workshop tutorial, we mentioned several times that you can use different models and methods implemented in MLatom ranging from your own ML models to pure QM methods for different kinds of simulations, e.g., to make new predictions, geometry optimizations, frequency calculations, dynamics, spectra simulations, etc. Here we show how to run molecular dynamics with MLatom. .. note:: MLatom also supports `machine learning methods for quantum dissipative dynamics `_ via the interface to Arif Ullah's `MLQD package `_. Here we will use the KREG model of ethanol already pre-trained for you and run molecular dynamics with it. This model was trained with the KREG model, which employs kernel ridge regression (KRR) with relative-to-equilibrium (RE) descriptor and Gaussian kernel. Input file looks like this: .. code:: text MD # molecular dynamic initXYZ=ethanol.xyz # initial geometry; Unit: Angstrom initVXYZ=ethanol.vxyz # initial velocity; Unit: Angstrom/fs dt=0.3 # time step; Unit: fs trun=30 # total time; Unit: fs MLprog=MLatomF # KREG model is implemented in the Fortran part of MLatom (MLatomF) MLmodelIn=ethanol.unf # file that saves the model thermostat=nose-hoover # NVT ensemble (Nosé-Hoover thermostat) temp=300 # temperature for NVT; Unit: K The KREG model is implemented in the Fortran part of MLatom (``MLatomF``), so we use ``MLprog=MLatomF`` here. The input files such as the :download:`initial geometry `, :download:`initial velocity ` and :download:`ML model ` can be downloaded here. See `this paper `_ on implementation details of the KREG model as well as `this tutorial `_ on how to train your own KREG model. After the simulations finish, you can find in the trajectory files in different formats: * H5MD in the file with the extension ``.h5`` * XYZ file with trajectory snapshots in ``traj.xyz`` file * XYZ velocities in ``traj.vxyz`` * kinetic, potential and total energies in ``traj.ekin``, ``traj.epot``, and ``traj.etot`` files. .. note:: We have also developed a radically new way of running dynamics by learning molecules directly in the 4D spacetime, i.e., by creating AI models which can predict nuclear coordinates as a function of time. See our `preprint `_.