CompPhysVienna / n2p2

n2p2 - A Neural Network Potential Package
https://compphysvienna.github.io/n2p2/
GNU General Public License v3.0
217 stars 82 forks source link

Problems using RuNNer potential in Lammps MD #150

Open Matheus-Novoa opened 2 years ago

Matheus-Novoa commented 2 years ago

I'm facing problems using a potential built from RuNNer in a lammps MD. The n2p2 interface isn't recognizing the RuNNer commands in input.nn file.

WARNING: Unknown keyword "bond_threshold" at line 27. WARNING: Unknown keyword "calculate_forces " at line 182. WARNING: Unknown keyword "check_forces" at line 183. WARNING: Unknown keyword "energy_threshold" at line 26. WARNING: Unknown keyword "fitting_unit" at line 143. WARNING: Unknown keyword "force_update_scaling" at line 155. WARNING: Unknown keyword "mix_all_points" at line 140. WARNING: Unknown keyword "nn_type_short" at line 17. WARNING: Unknown keyword "optmode_short_energy" at line 148. WARNING: Unknown keyword "optmode_short_force" at line 149. WARNING: Unknown keyword "points_in_memory" at line 139. WARNING: Unknown keyword "random_number_type" at line 22. WARNING: Unknown keyword "runner_mode" at line 18. WARNING: Unknown keyword "short_force_group" at line 158. WARNING: Unknown keyword "use_noisematrix " at line 167. WARNING: Unknown keyword "use_short_nn" at line 31. WARNING: 16 problems detected (0 critical).

Should I comment out these keywords lines?

input.nn.txt log.lammps.txt

Thanks in advance

philippmisof commented 2 years ago

Basically you can remove all of the without any issues (except if nn_type_short is not set to 1, see below). More than half of the warnings are related to parameters used for training, so this obviously does not affect using the finished potential.

Used in prediction mode in RuNNer but not in n2p2:

  1. bond_threshold
  2. calculate_forces
  3. check_forces (even in RuNNer it's only for debugging)
  4. nn_type_short if it has the value 1. (RuNNer has mode 1 and 2, but n2p2 only implemented 1)
  5. points_in_memory
  6. runner_mode
  7. use_short_nn

Only used for training in RuNNer:

  1. energy_threshold
  2. force_update_scaling
  3. fitting_unit (but be sure that the conversion factors in the n2p2 interface correspond to the chosen unit system in the training with RuNNer)
  4. mix_all_points
  5. optmode_short_energy
  6. optmode_short_force
  7. random_number_type
  8. short_force_group
  9. use_noisematrix

For further details about those keywords have a look at the documentation of RuNNer.

Matheus-Novoa commented 2 years ago

OK, i commented out that lines in input.nn file, but i still having problems. Seems that the problem is the "elements" command:

terminate called after throwing an instance of 'std::runtime_error' " unknown. ERROR: Element "

input.nn.txt output.txt ss_cnt.in.txt

philippmisof commented 2 years ago

My guess is that the default mapping of elements in LAMMPS and in n2p2 is not the right choice. This can be changed by using the emap parameter in the pair_style command in your LAMMPS configuration file. An explanation can be found here: https://compphysvienna.github.io/n2p2/interfaces/pair_nnp.html#description. In general I would always recommend specifying the element mapping explicitly since it reduces the number of possible errors.