Git Product home page Git Product logo

n2p2's Introduction

n2p2 - A neural network potential package

DOI GitHub release Build Status Coverage License: GPL v3

This repository provides ready-to-use software for high-dimensional neural network potentials in computational physics and chemistry.

This package uses automatic documentation generation via Sphinx, Breathe and doxygen. An online version of the documentation which is automatically updated with the master branch of the repository can be found here.

Authors

See AUTHORS.rst for a list of contributions.

License

This software is licensed under the GNU General Public License version 3 or any later version (GPL-3.0-or-later).

n2p2's People

Contributors

akohlmey avatar danielmarchand avatar dwhswenson avatar jeremylauret avatar mpbircher avatar philippedavid avatar singraber avatar streeve avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

n2p2's Issues

scale_symmetry_functions

Hello,

I have an issue with the scaling procedure of symmetry functions. I set Smin and Smax to -1 and 1 respectively as it is written above. However in the nnp-scaling.log it is written "No scaling for symmetry functions".

Best regards,

Amaury

scale_symmetry_functions # Scale all symmetry functions with min/max values.
scale_min_short -1.0 # Minimum value for scaling.
scale_max_short 1.0 # Maximum value for scaling.

example-verbose

Describe the bug
I am running the given example "example-verbose" for pynnp and the command
m.setupSymmetryFunctionScaling("scaling.data") is throwing an error.
Any help is appreciated.
Using latest git update:::
​---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
in
----> 1 m.setupSymmetryFunctionScaling("scaling.data")

pynnp.pyx in pynnp.Mode.setupSymmetryFunctionScaling()

RuntimeError: ERROR: Inconsistent scaling statistics.

Support of multiple pair styles via hybrid/overlay in lammps interface

I am trying to setup a lammps simulation adding a NNP for some atoms/elements to a LJ interaction with other elements (using the hybrid/overlay pair style). Unfortunately, I wasn't able to make this work, because the n2p2 lammps interface seems to not support multiple pair styles at the moment. As far as I can tell, the n2p2 interface uses always all atoms from lammps.

E.g. the quip interface does solve this problem by mapping lammps atom types to quip elements via the pair_coeff (see also documentation):
pair_coeff * * quip.xml "QUIP initialization string" atomic_numbers

It would be great, if support for multiple pair styles could be added to the lammps interface.

Thanks!
Christoph

Problem in buildling nnp-train

Hi everyone, I am trying to build (locally) the n2p2 library on our institute's HPC system. I am able to build all the components of the package apart from nnp-train. I am getting the following error when I am trying to build the nnp-train:

make[1]: Leaving directory `/groups/MultiSMArt/Arpit/n2p2-master/src/libnnptrain'
cd application && make nnp-train COMP=gnu MODE=static
make[1]: Entering directory `/groups/MultiSMArt/Arpit/n2p2-master/src/application'
mpic++ -O3 -march=native -std=c++11 -g -pedantic-errors -Wall -Wextra -I./ -I../../include/ -I/groups/MultiSMArt/Arpit/n2p2-master/gsl/include -I/groups/MultiSMArt/Arpit/n2p2-master/eigen-3.3.7 -DEIGEN_USE_BLAS -DEIGEN_DONT_PARALLELIZE -DIMPROVED_SFD_MEMORY -o nnp-train.o -c nnp-train.cpp
mpic++ -O3 -march=native -std=c++11 -g -pedantic-errors -Wall -Wextra -DEIGEN_USE_BLAS -DEIGEN_DONT_PARALLELIZE -DIMPROVED_SFD_MEMORY -o nnp-train nnp-train.o ../../lib/libnnptrain.a ../../lib/libnnp.a -L/groups/MultiSMArt/Arpit/n2p2-master/gsl/lib -lgsl -lgslcblas -L/groups/MultiSMArt/Arpit/n2p2-master/BLAS-3.8.0 -lblas
/usr/bin/ld: /groups/MultiSMArt/Arpit/n2p2-master/BLAS-3.8.0/libblas.a(xerbla.o): undefined reference to symbol '_gfortran_transfer_character_write@@GFORTRAN_7'
/opt/apps/gcc/7.3.0/lib64/libgfortran.so.4: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [nnp-train] Error 1
make[1]: Leaving directory `/groups/MultiSMArt/Arpit/n2p2-master/src/application'
make: *** [nnp-train] Error 2

I am not able to figure the source for this error. I have locally built (and linked) the GSL and Eigen library. Can anyone tell me which library I am missing (to link) or what is the source of the above error?

New release of n2p2

Hi Andreas,
Today, I've updated my n2p2 package to the latest version 2.0.1. However, in the output files it still prints "NNP LIBRARY v2.0.0". I double checked everything and I am pretty sure that I am using the newest release (2.0.1). I wonder what and where the problem is.

Thanks,
Mostafa

training procedure

Thanks very much for sharing your code. I got some problems about the training procedure. Unfortunately, the document about the training procudure is incomplete. Hope you can give me some guide on the training procedure of n2p2.

Specifing cutoff radius (rc)

Hi.
I need to apply a different value for the cutoff radius (rc) than the default (12 Bohr). I've been wondering how it would be possible to change it. I've got an idea from the Cu2S example to specify it using "r_c" keyword in the SYMMETRY FUNCTIONS section (https://github.com/CompPhysVienna/n2p2/blob/master/examples/input.nn.recommended), i. e. "r_c = value" . However, even with this keyword, it is still using the default value. Maybe it has to be specified in a different way. Any help would be greatly appropriated. Thanks.

Error estimate during MD simulation

With multiple networks (different random seed at training) calculating the same total energy at each timestep, we could compute a spread (min/max-difference or standard error) of energies which indicates missing information in the training data.

Since no additional symmetry functions need to be calculated the performance will not be affected much.

ASE (atomic simulation environment) lammps calculator with n2p2

I am trying to use an existing library which calculates all sorts of material parameters with n2p2.
It works with with an MEAM-type potential, but not with n2p2 somehow.

The solution would of course be that it works.

The library can be found here:
gitlab link
In the folder scripts is a script with name minimal_example_n2p2.py, which should show the issue.
You need lammps compiled with make mpi mode=shlib and the python library ase.
If have enforced error messages in the lammps python api, but that did not help.

I first had the idea that maybe it is the atom types, which have to be different when working with n2p2 (ordered 1,2,3, not the atomic numbers), but that did not change the problem.

nnp-sacling wrong output order

Hi, I noticed that nnp-scaling outputs symmetry function values to function.data file in random order when MPI parallelization is used.
This does not happen if nnp-scaling runs in serial mode

Support for the latest LAMMPS Version

I build a conda package for n2p2 and try to connect it to the lammps package. I get the following error:

2021-02-14T22:00:04.3025280Z /home/conda/feedstock_root/build_artifacts/lammps_1613339059218/work/src/USER-NNP/pair_nnp.cpp: In member function 'virtual void LAMMPS_NS::PairNNP::settings(int, char**)':
2021-02-14T22:00:04.3029224Z /home/conda/feedstock_root/build_artifacts/lammps_1613339059218/work/src/USER-NNP/pair_nnp.cpp:133:26: error: 'class LAMMPS_NS::Force' has no member named 'inumeric'
2021-02-14T22:00:04.3031142Z   133 |       showewsum = force->inumeric(FLERR,arg[iarg+1]);
2021-02-14T22:00:04.3032110Z       |                          ^~~~~~~~
2021-02-14T22:00:04.3033951Z /home/conda/feedstock_root/build_artifacts/lammps_1613339059218/work/src/USER-NNP/pair_nnp.cpp:139:22: error: 'class LAMMPS_NS::Force' has no member named 'inumeric'
2021-02-14T22:00:04.3035691Z   139 |       maxew = force->inumeric(FLERR,arg[iarg+1]);
2021-02-14T22:00:04.3036888Z       |                      ^~~~~~~~
2021-02-14T22:00:04.3039072Z /home/conda/feedstock_root/build_artifacts/lammps_1613339059218/work/src/USER-NNP/pair_nnp.cpp:156:25: error: 'class LAMMPS_NS::Force' has no member named 'numeric'
2021-02-14T22:00:04.3040845Z   156 |       cflength = force->numeric(FLERR,arg[iarg+1]);
2021-02-14T22:00:04.3041921Z       |                         ^~~~~~~
2021-02-14T22:00:04.3043743Z /home/conda/feedstock_root/build_artifacts/lammps_1613339059218/work/src/USER-NNP/pair_nnp.cpp:162:25: error: 'class LAMMPS_NS::Force' has no member named 'numeric'
2021-02-14T22:00:04.3045466Z   162 |       cfenergy = force->numeric(FLERR,arg[iarg+1]);
2021-02-14T22:00:04.3046408Z       |                         ^~~~~~~
2021-02-14T22:00:04.3049072Z /home/conda/feedstock_root/build_artifacts/lammps_1613339059218/work/src/USER-NNP/pair_nnp.cpp: In member function 'virtual void LAMMPS_NS::PairNNP::coeff(int, char**)':
2021-02-14T22:00:04.3051512Z /home/conda/feedstock_root/build_artifacts/lammps_1613339059218/work/src/USER-NNP/pair_nnp.cpp:179:10: error: 'class LAMMPS_NS::Force' has no member named 'bounds'; did you mean 'bond'?
2021-02-14T22:00:04.3053321Z   179 |   force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi);
2021-02-14T22:00:04.3054206Z       |          ^~~~~~
2021-02-14T22:00:04.3054986Z       |          bond
2021-02-14T22:00:04.3056844Z /home/conda/feedstock_root/build_artifacts/lammps_1613339059218/work/src/USER-NNP/pair_nnp.cpp:180:10: error: 'class LAMMPS_NS::Force' has no member named 'bounds'; did you mean 'bond'?
2021-02-14T22:00:04.3058619Z   180 |   force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi);
2021-02-14T22:00:04.3059515Z       |          ^~~~~~
2021-02-14T22:00:04.3060243Z       |          bond
2021-02-14T22:00:04.3061974Z /home/conda/feedstock_root/build_artifacts/lammps_1613339059218/work/src/USER-NNP/pair_nnp.cpp:182:28: error: 'class LAMMPS_NS::Force' has no member named 'numeric'
2021-02-14T22:00:04.3063708Z   182 |   maxCutoffRadius = force->numeric(FLERR,arg[2]);
2021-02-14T22:00:04.3064625Z       |                            ^~~~~~~
2021-02-14T22:00:04.4159150Z make[2]: *** [CMakeFiles/lammps.dir/build.make:10209: CMakeFiles/lammps.dir/home/conda/feedstock_root/build_artifacts/lammps_1613339059218/work/src/USER-NNP/pair_nnp.cpp.o] Error 1
2021-02-14T22:00:04.4160988Z make[1]: *** [CMakeFiles/Makefile2:666: CMakeFiles/lammps.dir/all] Error 2

conda-forge/lammps-feedstock#59

I used the patch provided in:
#54

And the primary issue seems to be related to LAMMPS moving several datatypes out of forces into utils:
https://lammps.sandia.gov/threads/msg89360.html

Atom charge for short range NN

Hi.

According to the manual, the atomic charges have to be introduced in the data file only for long-range NN training. I wonder for the short-range NN, would it be enough to set all atomic charges to zero in the data file or the corresponding column has to be removed completely? Many thanks.

Best,

Building CabanaMD interface

Hi Andreas,
I am trying to build the CabanaMD interface. I am getting this error message:
error_message.txt

It seems, it's related to the n2p2 part. Could you please have a look into this and see if you can help me to fix it.

Many thanks.

Mostafa

Finding similar data points

Hi.

I have a big data set. I wonder if there is a way in n2p2 to find/determine (very)similar data points, which enables me to remove redundant structures. Thanks.

Restarting the training process

Hi Andreas,
Is it possible to restart the training procedure from a fitted nnp model in n2p2? I want to see if more epochs can improve the quality of the model.

Thanks,
Mostafa

Automatic selection of fingerprints

Hello!

One of your papers introduces the automatic selection of fingerprints. It seems useful. How can I use these methods in n2p2 training procedure? Have you implemented automatic selection in your program?

Improving the force RMSE

Hi Andreas,
I wonder how I can improve the force RMSE. I need to know which parameter(s) I should play with. I would guess one of them should be "short_force_fraction". I greatly appropriate it if you could share your experiences in this case with me.
Here is my input file.
input.nn.txt

Many thanks.
Mostafa

Energy and forces prediction

Hi Andreas,
I wonder how I can predict the energy and forces for a bunch of structures by a single run of the "nnp-predict" module. I tried that, but it seems it doesn't go through all structures in the "input.data" file and it only takes the first one.

n2p2 in GPUs

Hello, hope you're doing well.

Is it possible to use n2p2 on a GPU? I know that LAMMPS offers some packages that let GPUs build the neighbor lists. However, according to LAMMPS documentation when a non-GPU enabled command requires a neighbor list, the list will be built on the CPU. So I guess this won't work out with a neural network potential made with n2p2.

I was wondering if there are any other ways in which I can take advantage of a GPU when using n2p2.

Thanks :)

Count dead neurons during training

It would be useful to have some information during training about how many hidden neurons are way outside of their nonlinear regime, i.e. count all "dead" neurons. Maybe this helps to identify problems when training is not working as expected.

Relation between "force_weight" and "short_force_fraction"

Hi Andreas,
Previously, in order to improve the force RMSE, you suggested to play with the "short_force_fraction" keyword. If I set a value for this keyword so that a 1:10 ratio between energy and force updates is obtained, do I need to specify 10 for "force_weight". From the definition it seems there is a relation between these two keywords. I would be thankful if you have a comment on this. Many thanks.

Best,
Mostafa

instructions to build n2p2 with lammps

I prefer the cmake builds of lammps for various reasons. Below a simple guide and needed patch how to build lammps with cmake and n2p2.

  • build n2p2 lib as usual
cd n2p2/src
make libnnpif
cd ../../
  • get lammps from their git. I played here with patch_30Jun2020 and let us call the folder lammps-nnp
cd lammps-nnp
cd src
ln -s ../../n2p2/src/interface/LAMMPS/src/USER-NNP
cd ../
#apply the patch, attached here as zip
patch -p1 < 0001-n2p2-support.patch
mkdir build-gnu
export N2P2ROOT=<path to n2p2>
CXX=mpicxx CXXFLAGS="-Ofast  -DIMPROVED_SFD_MEMORY" cmake ../cmake/ \
 -DLAMMPS_MACHINE=mpi -DBUILD_MPI=On -DPKG_OPT:BOOL=ON -DPKG_RIGID:BOOL=On -DPKG_MISC:BOOL=On \
 -DPKG_CORESHELL:BOOL=On -DPKG_KSPACE:BOOL=on -DPKG_MOLECULE:BOOL=On -DPKG_DIPOLE:BOOL=On \
 -DPKG_USER-COLVARS:BOOL=on -DPKG_USER-MOFFF:BOOL=ON -DPKG_USER-MISC:BOOL=On -DPKG_USER-NNP:BOOL=On \
 -DFFT=FFTW3 

make -j4

at the end in build-gnu you shall find lmp_mpi

patches apply on patch_30Jun2020 or newer, probably on older too but they may need rebase.
for the stable_03March2020 another patch is needed

0001-n2p2-support.zip

Discrepancy in energy predictions and CP2K calculations

The question
I am running an NVT simulation in LAMMPS using n2p2 and then ran CP2K calculations on the trajectory. The energy values from N2P2 stdout is roughly 27.4x the CP2K calculation. I am not sure about the places to look into for the same

Derivative of symmetries function

Dear n2p2 team,

I would like to know if there is a inbuild method to get acces to the derivatives of the symmetries functions. I would like to use n2p2 to compute symmetries function but i would also need their derivatives. I know that they are computed at some point, because they are needed to compute the forces, but i would like to have access to them. They are called dGdr in the source code.

What i would like is a file containg the derivative of each symmetries function with respect to each position. I guess they could be a optional keyword to call this feature.

Maybe this is already implemented and i missed it. In this case i would be really sorry for the disagrement.

Thank you very much in advance
Best regards

Oriel

Pressure calculation from the stress tensor

Hi,

I noticed that for an example of the bulk liquid water MD simulation at ambient conditions there is a discrepancy between the pressure that is evaluated directly from LAMMPS Press variable and the from diagonal components of the stress tensor.

For any given potential, such as SPC/E, both pressures are expected to be exactly the same at any given time. However, as you can see from the part of the 'log.lammps' file, the pressures ('Press' vs. v_press) are different:

Per MPI rank memory allocation (min/avg/max) = 7.872 | 7.873 | 7.873 Mbytes
Step Temp TotEng Press v_press v_dens
10000 300 -24805.565 16173.004 4116.885 1.0088118
10010 309.72891 -24805.818 -6442.4868 4249.4215 1.0085808
10020 370.76634 -24806.738 13054.728 5085.9069 1.0083952
10030 368.9284 -24808.713 -10678.673 5057.6896 1.0077962
10040 368.35577 -24812.762 14130.233 5048.4766 1.0075243
10050 324.97034 -24817.324 -8696.6602 4450.5506 1.0067756
10060 344.73275 -24822.403 11243.846 4718.753 1.0062534
10070 350.02017 -24827.523 -5208.2374 4786.6142 1.0053054
10080 355.17204 -24832.361 5075.6256 4853.0034 1.0044642
10090 344.0271 -24836.953 135.99129 4695.8461 1.0034225
...

lammps version: 20 Apr 2020
n2p2: the most recent version
nnp potential parameters: I used mine but it can be also this
pressure calculation from stress tensor:

compute     Tw all temp
compute     peratom all stress/atom Tw
compute     sxx all   reduce sum c_peratom[1]
compute     syy all   reduce sum c_peratom[2]
compute     szz all   reduce sum c_peratom[3]
variable    press equal   -(c_sxx+c_syy+c_szz)/(3*vol)  # pressure 

Best,
Hossein

lammps rigid body simulations

Hi Andreas,

I'm going to run rigid body simulations for a solute+solvent systems. What I am trying to do is running the simulations by keeping the solute fixed in middle of box while all solvent molecules are flexible. To do so, I should group all atoms, for example to the solute and solvent groups by their atom types. However, this way leads to an inconsistency between the number of LAMMPS atom types and the NNP elements. I've been thinking maybe I should try pair_style hybrid and using the same nnp for both groups, but I have no idea how the lammps input file should look like. The following is an example: my solute in 17 solvent molecules. I appropriate if you can help me.

lmp_input.txt
data_file.txt

where are the atoms giving EW

Hi n2p2 developers,

I am doing relaxation for a large atom system (about 1MIo atoms). It works fine for most of the time, even when I start with some slightly unphysical system. Namely, at the beginning the relaxation throws some EW (extrapolation warnings). With the simulation going, the relaxation can pull the system back to normal state (no EW any more). I am using a mix of minimization method (cg and fire in lammps).

However, for one case, the system is fine at the beginning, then starts to give a lot of EW and then fail with too many EW. To understand why this happens, I would like to check where are these atoms throwing EW. Then I can tell whether the system is physical in that region or not (too many close atoms? or some configurations that I did not sample in my training data sets).

So I would like to know whether the following is possible,

  1. output the atom id for EW
  2. what types of symfunc that gives this EW, radial or angular, what is the index of symfunc

I have checked the documentation. The showew option can tell some information, somehow it is not very detailed.

Thanks for helping!

Charge/Partial Charge Caluclation

Is it possible to use fix qeq with N2P2?

I am trying with an example of Water H2O with the same potential in the example directory. I tried with Fix qeq/fire it doesn't consider the charge, or it doesn't change the energy for some reason. I assume it will same for other qeq style also.

Is there anyway I can use partial charge of each atoms in the simulation with N2P2? Do I have to consider charge per atom during the NN training?

Training function in pynnp

I want to use the pynnp with the training function, whereas there are only like mode, prediction, structures functions. I am wondering if you have written the training function with python type. If so, could you send me the pyx file.

Many thanks.

Cabana version of n2p2

We have modified a portion of the n2p2 code to work with our library, Cabana, and proxy application, CabanaMD ((https://github.com/ECP-copa/CabanaMD). Cabana (https://github.com/ECP-copa/Cabana) is a particle library built on Kokkos (https://github.com/kokkos/kokkos/) for performance portability

@singraber has suggested we move it to this repository and I completely agree

Here is my initial plan:

  • Complete existing work for better interface to the n2p2 kernels that require Cabana data structures (ECP-copa/CabanaMD#37)
  • Move code to this repository, within src/libnnpif-cabana initially (see below)
  • Create child classes (e.g. ModeCabana) and override functions as necessary (there are currently implementations for Mode, Element, CutoffFunction)
  • Simplify existing setup code by calling base methods and copying to Kokkos/Cabana data structures
  • Add optional Kokkos/Cabana dependencies
  • Add documentation on building and running with Kokkos/Cabana
  • Remove from current repository (master and OnNode branch)

Thank you,

Add CabanaMD in CI tests

A basic test of CabanaMD+n2p2 should be in the CI tests as soon as a release tag is available. Maybe restrict tests to SERIAL Kokkos device.

Different results from different epochs

Hi Andreas,
I've facing a problem with using the trained NNP for the ML MD simulations. I get different results in the MD simulations when I use different epochs that have very similar force and energy RMSEs. For example, in the following case, epochs 28 and 30 predict different mass densities in the MD simulations.
I need to know what and where is the source of this issue. Does it show that the fitting procedure is not converged properly and probably more epoch is needed? If so, how can I make sure that enough numbers of epochs are used?
In this example, I used 0.006 for the short_force_fraction. Can't it be due to this.
Note that the data set is constructed through several AIMD simulations at 8 different temperatures. I appropriate your help.

epoch RMSEpa_Etrain_pu RMSEpa_Etest_pu RMSE_Ftrain_pu RMSE_Ftest_pu RMSE_Etrain_pu RMSE_Etest_pu
0 3.68089707E-03 3.68151650E-03 3.59133943E-02 3.57132410E-02 2.20853824E-01 2.20890990E-01
1 7.52728841E-05 7.53545746E-05 4.70025592E-03 4.69005246E-03 4.51637304E-03 4.52127448E-03
2 5.88296966E-05 5.83460717E-05 4.43031439E-03 4.41829441E-03 3.52978180E-03 3.50076430E-03
3 4.15278857E-05 4.25868378E-05 4.31353267E-03 4.30069945E-03 2.49167314E-03 2.55521027E-03
4 3.46008856E-05 3.52571984E-05 4.28745565E-03 4.27184553E-03 2.07605314E-03 2.11543190E-03
5 3.65203293E-05 3.69307190E-05 4.28136598E-03 4.26524519E-03 2.19121976E-03 2.21584314E-03
6 3.10717952E-05 3.17880035E-05 4.26292456E-03 4.24489046E-03 1.86430771E-03 1.90728021E-03
7 2.88128049E-05 2.95575016E-05 4.27352932E-03 4.25524627E-03 1.72876829E-03 1.77345010E-03
8 2.85200475E-05 2.91802980E-05 4.26418055E-03 4.24542472E-03 1.71120285E-03 1.75081788E-03
9 3.09585962E-05 3.17343691E-05 4.26567502E-03 4.24609761E-03 1.85751577E-03 1.90406215E-03
10 2.85033317E-05 2.92720727E-05 4.27303803E-03 4.25317515E-03 1.71019990E-03 1.75632436E-03
11 3.00620617E-05 3.06763090E-05 4.26079157E-03 4.24176376E-03 1.80372370E-03 1.84057854E-03
12 2.95305319E-05 3.00977848E-05 4.25870712E-03 4.23950932E-03 1.77183192E-03 1.80586709E-03
13 2.84858645E-05 2.91128325E-05 4.26058927E-03 4.24188254E-03 1.70915187E-03 1.74676995E-03
14 2.87682309E-05 2.93136446E-05 4.27371320E-03 4.25604482E-03 1.72609385E-03 1.75881868E-03
15 2.82961184E-05 2.88206081E-05 4.26244979E-03 4.24451240E-03 1.69776710E-03 1.72923649E-03
16 3.84394897E-05 3.86483941E-05 4.26675450E-03 4.24832075E-03 2.30636938E-03 2.31890365E-03
17 2.93523727E-05 2.96756732E-05 4.26840025E-03 4.24889049E-03 1.76114236E-03 1.78054039E-03
18 2.71961406E-05 2.76404737E-05 4.26227084E-03 4.24309386E-03 1.63176844E-03 1.65842842E-03
19 3.24900849E-05 3.28368894E-05 4.25682390E-03 4.23786426E-03 1.94940509E-03 1.97021336E-03
20 2.84659028E-05 2.86453038E-05 4.27959344E-03 4.26016810E-03 1.70795417E-03 1.71871823E-03
21 2.75537644E-05 2.82404578E-05 4.25843586E-03 4.23903460E-03 1.65322587E-03 1.69442747E-03
22 2.94481195E-05 2.99895730E-05 4.26189698E-03 4.24209250E-03 1.76688717E-03 1.79937438E-03
23 3.05071253E-05 3.09408362E-05 4.25319316E-03 4.23364649E-03 1.83042752E-03 1.85645017E-03
24 2.83537714E-05 2.86469758E-05 4.26034088E-03 4.24039826E-03 1.70122628E-03 1.71881855E-03
25 2.66472039E-05 2.71158073E-05 4.25740052E-03 4.23840281E-03 1.59883223E-03 1.62694844E-03
26 3.26086533E-05 3.30212435E-05 4.26373495E-03 4.24495621E-03 1.95651920E-03 1.98127461E-03
27 2.97659954E-05 3.01094481E-05 4.26098456E-03 4.24175193E-03 1.78595972E-03 1.80656688E-03
28 2.61664264E-05 2.65340505E-05 4.26240041E-03 4.24326213E-03 1.56998558E-03 1.59204303E-03
29 3.05201863E-05 3.08942275E-05 4.25136483E-03 4.23223061E-03 1.83121118E-03 1.85365365E-03
30 2.99563143E-05 3.03292610E-05 4.25421462E-03 4.23467312E-03 1.79737886E-03 1.81975566E-03

Many thanks.
Mostafa

Free atom reference energies in Lammps interface

Hi.
I've got a question regarding the "input.nn" file in the lammps interface. In the water example, the free atom reference energies are commented. Why don't we need them for the lammps simulations?
I've found out this leads to predicting wrong potential energies in the simulations. I got the correct energies by removing # from the corresponding lines. Thanks.

Error (?) in documentation of lammps interface usage

Hi,
not sure if this came with the newest lammps version (as of January 4th), but something I noticed:

Double line definition of pair_style nnp is not corrected in documentation
In pair_style doc, the suggested usage of the nnp package as a potential is listed like this:

pair_style nnp showew yes showewsum 100 maxew 1000 resetew yes cflength 1.8897261328 cfenergy 0.0367493254
pair_style nnp dir "./" showewsum 10000
pair_coeff * * 6.01 

But when copying this exactly into a lammps configuration file, the keywords of the first line are overwritten (i.e. set to default), when the second line is read. This e.g. leads to conversion factors with are 1.0.
By defining it in one line, it works:

pair_style nnp showew yes showewsum 100 maxew 1000 resetew yes cflength 1.8897261328 cfenergy 0.0367493254 dir "./" showewsum 10000
pair_coeff * * 6.01 

Not sure if something in lammps changed or if I need to do something extra, but just compiling lammps including the nnp package has this behaviour.

To Reproduce
Steps to reproduce the behavior:

  1. n2p2 v1.0.0, lammps patch_4Jan2019
  2. gnu compiler suite, n2p2: make libnnpif-shared, copy user package to lammps, lammps: make yes-user-nnp && make mpi

Expected behavior
No overwriting of previously defined values of keywords

Thanks!
Markus

Use build matrix in CI tests

Currently only the default compilation flags are used for tests, there should be a build matrix for certain combinations of

NNP_NO_SF_GROUPS
NNP_NO_SF_CACHE
NNP_NO_ASYM_POLY
NNP_NO_TIME
NNP_NO_NEIGH_CHECK
NNP_FULL_SFD_MEMORY
NNP_NO_MPI

Problem with different atomic neural network architectures in NNP

Hello, I have a problem using different atomic neural network architectures for the individual elements in my NNP. When I am trying to run a MD simulation using this NNP, n2p2 seems to build the same atomic neural network architectures for all elements. There is no error message but of course the NNP constructed by n2p2 is unable to describe the given structure since the weights belong to a different architecture.

Here is a small example:
n2p2_architecture_problem.zip

Linking error while making LAMMPS with USER-NNP

Hi Andreas,

I am trying to make a LAMMPS with USER-NNP, but getting a compilation error. I have the previous version of NNP (v1.0.0) which is working just fine on the same machine. but with the recent version, I confront this error.

Steps that I perform are as follow:

  • I used the most updated version of the lammps and n2p2
  • on nnp src directory I use: $make COMP=intel all (also tried with gnu compiler but getting another error)
  • make a link to nnp in lammps lib directory
  • on lammps src directory I use: $make yes-user-nnp && make serial

OS: ubuntu 18.04, icc 18.0.2
part of log file and the error I confront when I compiled the lammps:

/usr/bin/ld: ../../lib/nnp/lib/libnnpif.a(InterfaceLammps.o): relocation R_X86_64_32 against _ZN17_INTERNAL3d953dc2St8__ioinitE' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../lib/nnp/lib/libnnp.a(Structure.o): relocation R_X86_64_32 against _ZN17_INTERNALa5f037e3St8__ioinitE' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ../../lib/nnp/lib/libnnp.a(Atom.o): relocation R_X86_64_32 against .rodata.str1.32' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../lib/nnp/lib/libnnp.a(Log.o): relocation R_X86_64_32 against _ZN17_INTERNAL5d0a61afSt8__ioinitE' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ../../lib/nnp/lib/libnnp.a(ElementMap.o): relocation R_X86_64_32 against symbol _ZN3nnp10ElementMap13knownElementsB5cxx11E' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../lib/nnp/lib/libnnp.a(Mode.o): relocation R_X86_64_32 against .rodata.str1.4' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ../../lib/nnp/lib/libnnp.a(utility.o): relocation R_X86_64_32S against symbol _ZTTNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE@@GLIBCXX_3.4.21' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../lib/nnp/lib/libnnp.a(NeuralNetwork.o): relocation R_X86_64_32 against .rodata.str1.4' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ../../lib/nnp/lib/libnnp.a(Element.o): relocation R_X86_64_32 against _ZN17_INTERNAL96d6fd14St8__ioinitE' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../lib/nnp/lib/libnnp.a(SymmetryFunctionAngularNarrow.o): relocation R_X86_64_32 against symbol _ZTIN3nnp29SymmetryFunctionAngularNarrowE' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ../../lib/nnp/lib/libnnp.a(SymmetryFunctionStatistics.o): relocation R_X86_64_32 against _ZN17_INTERNAL6dc4d014St19piecewise_constructE' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../lib/nnp/lib/libnnp.a(SymmetryFunctionGroupAngularNarrow.o): relocation R_X86_64_32 against symbol _ZTIN3nnp34SymmetryFunctionGroupAngularNarrowE' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ../../lib/nnp/lib/libnnp.a(SymmetryFunctionGroup.o): relocation R_X86_64_32 against symbol _ZN3nnp21SymmetryFunctionGroup11printFormatB5cxx11E' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../lib/nnp/lib/libnnp.a(CutoffFunction.o): relocation R_X86_64_32S against symbol _ZNK3nnp14CutoffFunction5fHARDEd' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ../../lib/nnp/lib/libnnp.a(Settings.o): relocation R_X86_64_32 against symbol _ZN3nnp8Settings13knownKeywordsB5cxx11E' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../lib/nnp/lib/libnnp.a(SymmetryFunctionWeightedRadial.o): relocation R_X86_64_32 against symbol _ZTIN3nnp30SymmetryFunctionWeightedRadialE' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ../../lib/nnp/lib/libnnp.a(SymmetryFunctionRadial.o): relocation R_X86_64_32 against symbol _ZTIN3nnp22SymmetryFunctionRadialE' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../lib/nnp/lib/libnnp.a(SymmetryFunctionGroupWeightedRadial.o): relocation R_X86_64_32 against symbol _ZTIN3nnp35SymmetryFunctionGroupWeightedRadialE' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ../../lib/nnp/lib/libnnp.a(SymmetryFunctionWeightedAngular.o): relocation R_X86_64_32 against symbol _ZTIN3nnp31SymmetryFunctionWeightedAngularE' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../lib/nnp/lib/libnnp.a(SymmetryFunctionAngularWide.o): relocation R_X86_64_32 against symbol _ZTIN3nnp27SymmetryFunctionAngularWideE' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ../../lib/nnp/lib/libnnp.a(SymmetryFunctionGroupWeightedAngular.o): relocation R_X86_64_32 against symbol _ZTIN3nnp36SymmetryFunctionGroupWeightedAngularE' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../lib/nnp/lib/libnnp.a(SymmetryFunctionGroupAngularWide.o): relocation R_X86_64_32 against symbol _ZTIN3nnp32SymmetryFunctionGroupAngularWideE' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: ../../lib/nnp/lib/libnnp.a(SymmetryFunctionGroupRadial.o): relocation R_X86_64_32 against symbol _ZTIN3nnp27SymmetryFunctionGroupRadialE' can not be used when making a PIE object; recompile with -fPIC /usr/bin/ld: ../../lib/nnp/lib/libnnp.a(SymmetryFunction.o): relocation R_X86_64_32 against .rodata.str1.4' can not be used when making a PIE object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Makefile:89: recipe for target '../lmp_serial' failed
make[1]: *** [../lmp_serial] Error 1
make[1]: Leaving directory '/home/hossein/lammps/src/Obj_serial'
Makefile:190: recipe for target 'serial' failed
make: *** [serial] Error 2

pynnp: python3 error

Describe the bug
Regarding "pynnp": I am running the given verbose example. the command "m.loadSettingsFile(input.nn)" is throwing TypeError. I looked around and it seems it is related to how Python3 deals with 'str' / 'byte' input...

Any pointers on how to fix this so that "input.nn" is loaded?
I am using the latest version of n2p2 and python-3.7.3

To Reproduce: Below is the code..
import pynnp
cd ~/Projects/n2p2-master/examples/pynnp/prediction

Initialize NNP setup (symmetry functions only).

m = pynnp.Mode()
m.initialize()
m.loadSettingsFile("input.nn")


TypeError Traceback (most recent call last)
in
----> 1 m.loadSettingsFile("input.nn")

pynnp.pyx in pynnp.Mode.loadSettingsFile()

~/Projects/n2p2-master/lib/pynnp.cpython-37m-x86_64-linux-gnu.so in string.from_py.__pyx_convert_string_from_py_std__in_string()

TypeError: expected bytes, str found

Does libnnptrain require MKL?

Hi,

We are trying to compile n2p2 on Ubuntu 16.04. libnnp and libnnpif compiled successfully. But while trying to compile libnnptrain, we get the following error:

mpic++ -O3 -march=native -std=c++11 -fopenmp -Wno-long-long -g -pedantic-errors -Wall -Wextra -I./ -I../../include/ -I/usr/include/gsl/ -I/usr/include/eigen3/ -DEIGEN_DONT_PARALLELIZE -DEIGEN_USE_BLAS -o ../../build/static/Training.o -c Training.cpp
In file included from /usr/include/eigen3/Eigen/Core:74:0,
from KalmanFilter.h:22,
from KalmanFilter.cpp:17:
/usr/include/eigen3/Eigen/src/Core/util/MKL_support.h:57:21: fatal error: mkl.h: No such file or directory
compilation terminated.
makefile:109: recipe for target '../../build/static/KalmanFilter.o' failed
make[1]: *** [../../build/static/KalmanFilter.o] Error 1
make[1]: *** Waiting for unfinished jobs....
In file included from /usr/include/eigen3/Eigen/Core:74:0,
from KalmanFilter.h:22,
from Training.cpp:19:
/usr/include/eigen3/Eigen/src/Core/util/MKL_support.h:57:21: fatal error: mkl.h: No such file or directory
compilation terminated.
makefile:109: recipe for target '../../build/static/Training.o' failed
make[1]: *** [../../build/static/Training.o] Error 1
make[1]: Leaving directory '/media/data_drive/Dharam/n2p2-master/src/libnnptrain'
makefile:242: recipe for target 'libnnptrain' failed
make: *** [libnnptrain] Error 2

Is MKL required for compiling libnnptrain? Could you please help us resolve this issue?

Thank you!!

Potential energy per atom

Hi Andreas,

I'm trying to understand the potential energy predicted by NN during the training process. For the test data set, it prints out the NNP potential energy per atom as well as the reference ones. My system has 95 atoms and the total potential energy computed by DFT is around -806.455 Ha. So, I expect to have the potential energy of -8.489 Ha per atom. However, it does not seem so (see the following file). In addition, there is a lot of positive energy there, which I do not understand.

testpoints.000025.out.txt

Error in n2p2 compilation

Hi Everybody,

I'm trying to compile n2p2 package in my home directory on our HPC cluster. The most of the components have been compiled successfully. However, for the nnp-comp2, nnp-dataset, nnp-norm, nnp-scaling, and nnp-train components, I have faced an error which is apparently related to the GSL libraries. I am using GSL 2.5, eigen 3.3.2, and openmpi and gcc 4.0.1. It would be greatly appropriated if someone can help me to fix this issue. Many thanks.

Units

Hi,
I did not found in the documentation any information about the units used in the package. Can you tell me which units are used for distances, energies and forces, or point me to the page where it is mentioned in the documentation?
Best
Johannes

Extrapolation problems

Hi Andreas,
I am trying to find a way to remove extrapolations from my NNP. It's been suggested that the extrapolating structures must be determined and added to the data set in order to remove the extrapolation warnings. I think I just need to write a script to extract those structures, compute the energy and forces and redo the training. I am sure your have faced this many times. I wonder if you have or know such a script. That would help me to save a lot of time.

Many thanks.

Creating NNP from scratch

Hi.
I've found out it's possible to create NNP from scratch using internal modules of the n2p2 package. I am going to try this for a small data set (100 data points of water) and use the trained NNP in the lammps simulations.
What I think would be required is computing symmetry function values for the data set using "nnp-scaling" module and then training the NNP by "nnp-train" module. But, I am not entirely sure this procedure is correct. I would be greatly thankful if the n2p2 developer team can help me. Thanks.

Understanding the "short_force_error_threshold" keyword

Hi Andreas,

I'm trying to understand the role of the "short_force_error_threshold" (or "short_energy_error_threshold") keyword. As I realized from the manual, when, for instance, a value of 0.1 is specified, a threshold of 0.1*force RMSE is set and if the error is above this threshold then the training forces candidates are updated/selected randomly for the weight update. This means, the smaller value is selected for the keyword, the more frequent the forces will be used for the weight update. If I've understood it correctly, I need to know what the error is. Is it the mean absolute error (MAE) of forces?
Thanks.

Mostafa

Wrapping coordinates in n2p2

Hi Andreas,
I am using CP2K for doing AIMD under PBC and data set construction. As you probably know, CP2K does not wrap the coordinates into the primary box, but works with the absolute coordinates. Now I want to know for creating the data set and the NNP training (under PBC), do I need to wrap the coordinates into the box already or n2p2 will do that automatically and I can safely use the absolute and unwrapped coordinates? Many thanks.

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.