Giter Site home page Giter Site logo

atomisticnet / aenet-lammps Goto Github PK

View Code? Open in Web Editor NEW
9.0 3.0 3.0 10.37 MB

Interface aenet with the LAMMPS molecular dynamics software (https://lammps.sandia.gov)

License: Mozilla Public License 2.0

C++ 2.30% Makefile 3.62% Shell 0.50% Jupyter Notebook 93.58%

aenet-lammps's Introduction

ænet-LAMMPS Interface

If you make use of the aenet-LAMMPS interface, please cite the following reference:

M.S. Chen, T. Morawietz, H. Mori, T.E. Markland, N. Artrith, AENET-LAMMPS and AENET-TINKER: Interfaces for Accurate and Efficient Molecular Dynamics Simulations with Machine Learning Potentials, J. Chem. Phys. 155, 074801 (2021). doi: https://doi.org/10.1063/5.0063880

Preprint (Preprint where the data is discussed) arXiv (2021) doi: https://arxiv.org/abs/2107.11311

The database can be obtained from the Materials Cloud repository, DOI: https://doi.org/10.24435/materialscloud:dx-ct

ænet-LAMMPS

This directory provides all files needed to link the LAMMPS molecular dynamics code with aenetLib.

The present interface code has been tested with the LAMMPS version released on February 4, 2020 (Download).

The interface relies on a serial build of the aenet library for predicting energies and forces and leaves LAMMPS to handle parallelization. Hence the usual MPI and OpenMP implementations of LAMMPS are compatible with this interface.

Prerequisites

A serial aenet library is required and can be compiled by calling one of the following calls:

make -f ./makefiles/Makefile.gfortran_serial lib
make -f ./makefiles/Makefile.gfortran_openblas_serial lib
make -f ./makefiles/Makefile.ifort_serial lib

in the ænet src directory.

Building LAMMPS with ænet support

After compiling the aenet library files and downloading the aenet-LAMMPS interface from this repository:

  1. Copy the USER-AENET folder to $LAMMPSROOT/src/ where $LAMMPSROOT is the path to your LAMMPS codebase
  2. Replace $LAMMPSROOT/src/Makefile with ‘Makefile-aenetlammps‘
  3. In $LAMMPSROOT/src/USER-AENET/ you will find multiple ‘Install.sh-*‘ files. Select the file analogous to which makefile you used to compile the aenet library and copy it into a new file in the same directory called ‘Install.sh‘. In other words, if you compiled the aenet library using ‘Makefile.gfortran_serial‘ then you should select ‘Install.sh-gfortran_serial‘.
  • Note: if you are using the Intel compilers, you may have to recompile the aenet library using
    ‘Makefile.ifort_serial‘ but editing the makefile so as to remove the ‘-check-bounds‘ flag.
  • Note: if you are using the Intel compilers, you might have to add the ifcore library with to the PKG_LIB
    line in the file $LAMMPSROOT/src/Makefile.package. At the end of the line, add -lifcore.
  • Note: it might be desirable to link the ænet libraries statically, so that no environment paths need
    to be set. To link statically, change -laenet -llbfgsb to ../../lib/aenet/lib/libaenet.a ../../lib/aenet/lib/liblbfgsb.a in the file Makefile.package
  1. Create the folders $LAMMPSROOT/lib/aenet/include and $LAMMPSROOT/lib/aenet/lib and make sure to copy or link over:
  • aenet.h to $LAMMPSROOT/lib/aenet/include/
  • library files (i.e. libaenet.a, libaenet.so, liblbfgsb.a, liblbfgsb.so) to $LAMMPSROOT/lib/aenet/lib/
  • Note: in aenet.h, change _Bool to bool to make the header file compatible with C++
  1. In $LAMMPSROOT/src/, run 'make yes-user-aenet' to enable the interface package. Be sure to enable any other packages you want to use as well
  2. Compile LAMMPS as usual (e.g. go to $LAMMPSROOT/src and call ‘make mpi’)
  • Note: when compilation with the Intel compilers is desired, use make intel_cpu_openmpi or similar.
    (For a list of available targets, run make without any option.)

Running LAMMPS simulations using ænet potentials

The aenet library files, as well as any other dependencies, need to be properly loaded (i.e. on the $LD_LIBRARY_PATH). The LAMMPS input script also needs to be configured so as to use the ‘aenet’ pair style and to specify which neural network parameter files to use. A partial example for water is provided below:

units metal
mass 1  1.007825
mass 2 15.999491
pair_style aenet H.ann O.ann
pair_coeff * *

The user must specify the aenet fits such that the first fit corresponds to element 1 and so on.

The parameter files (*.ann files) need to be enumerated in a specific order. In the example above element 1 is designated to be hydrogen and element 2 is oxygen. Consequently, the aenet parameter file for hydrogen (i.e. H.ann) needs to be specified first and then followed by the parameter file for oxygen.

The selected LAMMPS units should match the units of the training data that was fitted by aenet. In the example above, ‘metal’ units are used meaning that the aenet potentials were fitted to training data for which the energies were reported in electron-volts and the positions in Angstroms. If instead the training data used Hartrees and Bohrs, then the corresponding LAMMPS units should be ‘electron’.

The notebook can be obtained from the provided GitHub links [1] and can also be run online via Google Colaboratory [2] aenet-lammps (a tutorial of short MD simulation liquid bulk water):

[1] https://github.com/atomisticnet/aenet-lammps/tree/master/tutorial

[2] https://colab.research.google.com/drive/1Km8JVFM2DCeElAeE2n_WgMgLa7IU_IFh?usp=sharing

aenet-lammps's People

Contributors

nartrith avatar michaelstchen avatar wei-zixiong avatar tmorawie avatar

Stargazers

Daniel Castillo Castro avatar Srikanth Divi avatar leeleolay avatar In Won Yeu avatar Salatan D. avatar Janex avatar Shenghui Zhong avatar  avatar Chi Chen avatar

Watchers

 avatar  avatar Zhufeng Hou avatar

aenet-lammps's Issues

Compiling issue for M1 Macbook Pro

when compiling LAMMPS with a rosetta enabled terminal, getting the following error
Undefined symbols for architecture x86_64:
"_aenet_Rc_max", referenced from:
LAMMPS_NS::PairAenet::init_style() in pair_aenet.o
"_aenet_all_loaded", referenced from:
LAMMPS_NS::PairAenet::init_style() in pair_aenet.o
"_aenet_atomic_energy_and_forces", referenced from:
LAMMPS_NS::PairAenet::compute(int, int) in pair_aenet.o
"_aenet_final", referenced from:
LAMMPS_NS::PairAenet::~PairAenet() in pair_aenet.o
"_aenet_init", referenced from:
LAMMPS_NS::PairAenet::init_style() in pair_aenet.o
"_aenet_load_potential", referenced from:
LAMMPS_NS::PairAenet::init_style() in pair_aenet.o
ld: symbol(s) not found for architecture x86_64

I am using the exact same versions for aenet, lammps as those given on the GitHub tutorial (aenet-2.0.4 and lammps 4feb20). I switched to rosetta terminal since aenet was only able to compile on that terminal. Has anyone faced a similar problem and/or have a solution for the same?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.