ADP potential fitting

Dear all,

Recently, I fitted a ADP potential by using a large DFT dataset. The energy of all structures consistent very well with the DFT value (average loss: 0.006 eV/structure).

After compiling this potential into lammps, I used this potential to do simulation. It can predict the Fe lattice constant well. However, the relaxing simulation is not good. The pressure along all three directions slowly become large which corresponds to box expansion and then simulation is broken.

Please have a look on the input file and log.lammps.
Thanks.

echo                    both
processors              1 1 1
package                 gpu 1 neigh no
newton                  off
units                   metal
atom_style              atomic
boundary                p p p
timestep                0.001
neighbor                2.0 bin
neigh_modify            every 5 delay 5 check yes

variable                temperature equal 300
variable                datafile string fe_st.dat
#variable                datafile string fe.dat

#------------chose potential and minimize energy--------
read_data		${datafile}
pair_style		pinn_adp
pair_coeff		* * fe_adp_potential_238_129e458.pinn Fe

mass			1 55.845

minimize		1.0e-6 1.0e-6 1000 10000
min_style		cg
#-----------------------relaxing------------------------
reset_timestep		0
thermo			1

velocity		all create ${temperature} 4928459
fix			1 all npt temp ${temperature} ${temperature} $(100.0*dt) x 0 0 1 y 0 0 1 z 0 0 1

thermo_style		custom step temp pe ke lx ly lz press vol pxx pyy pzz 
dump			1 all custom 100 relaxing*.FILE id type x y z
dump_modify 		1 first yes
dump_modify		1 sort id

run			1000
No protocol specified
LAMMPS (29 Sep 2021)
processors              1 1 1
package                 gpu 1 neigh no
newton                  off
units                   metal
atom_style              atomic
boundary                p p p
timestep                0.001
neighbor                2.0 bin
neigh_modify            every 5 delay 5 check yes

variable                temperature equal 300
variable                datafile string fe_st.dat
#variable                datafile string fe.dat

#------------chose potential and minimize energy--------
read_data		${datafile}
read_data		fe_st.dat
Reading data file ...
  orthogonal box = (0.0000000 0.0000000 0.0000000) to (184.00000 85.659000 112.50000)
  1 by 1 by 1 MPI processor grid
  reading atoms ...
  152880 atoms
  read_data CPU = 0.099 seconds
pair_style		pinn_adp
pair_coeff		* * fe_adp_potential_238_129e458.pinn Fe
MPI_checking.....
number of potentials.......: 0 1

mass			1 55.845

minimize		1.0e-6 1.0e-6 1000 10000

CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE

Your simulation uses code contributions which should be cited:
- GPU package (short-range, long-range and three-body potentials):
The log file lists these citations in BibTeX format.

CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE-CITE

WARNING: Using 'neigh_modify every 1 delay 0 check yes' setting during minimization (../min.cpp:188)
gpu.cpp.....init 152880 152880 0

--------------------------------------------------------------------------
- Using acceleration for pinn_adp/gpu:
-  with 1 proc(s) per device.
-  Horizontal vector operations: ENABLED
-  Shared memory system: No
--------------------------------------------------------------------------
Device 0: NVIDIA RTX A5000, 64 CUs, 4.6/24 GB, 1.7 GHZ (Mixed Precision)
--------------------------------------------------------------------------

Initializing Device and compiling on process 0...Done.
Initializing Device 0 on core 0...Done.

Neighbor list info ...
  update every 1 steps, delay 0 steps, check yes
  max neighbors/atom: 2000, page size: 100000
  master list distance cutoff = 7.055
  ghost atom cutoff = 7.055
  binsize = 3.5275, bins = 53 25 32
  1 neighbor lists, perpetual/occasional/extra = 1 0 0
  (1) pair pinn_adp/gpu, perpetual
      attributes: full, newton off
      pair build: full/bin/atomonly
      stencil: full/bin/3d
      bin: standard
Setting up cg style minimization ...
  Unit style    : metal
  Current step  : 0
calculate_short_time(ms)....3.789248
calculate_energy(ms)....191.176697
calculate_force(ms)....25.057728
Per MPI rank memory allocation (min/avg/max) = 141.5 | 141.5 | 141.5 Mbytes
Step Temp E_pair E_mol TotEng Press 
compute_pressure.240..667145.772261 46836.455189 2741554.265216
       0            0 -6.8454996e+08            0 -6.8454996e+08    1040785.5 
calculate_short_time(ms)....0.879328
calculate_energy(ms)....177.698822
calculate_force(ms)....24.698977
calculate_short_time(ms)....0.895232
calculate_energy(ms)....175.935486
calculate_force(ms)....26.050400
calculate_short_time(ms)....0.888000
calculate_energy(ms)....178.088959
calculate_force(ms)....23.495136
calculate_short_time(ms)....0.889504
calculate_energy(ms)....173.526016
calculate_force(ms)....24.618080
calculate_short_time(ms)....0.884512
calculate_energy(ms)....177.272827
calculate_force(ms)....24.691839
calculate_short_time(ms)....0.885600
calculate_energy(ms)....177.223679
calculate_force(ms)....22.481888
calculate_short_time(ms)....0.888384
calculate_energy(ms)....174.655487
calculate_force(ms)....24.574207
calculate_short_time(ms)....0.888672
calculate_energy(ms)....174.788605
calculate_force(ms)....22.481407
calculate_short_time(ms)....0.884512
calculate_energy(ms)....174.384125
calculate_force(ms)....23.130848
compute_pressure.240..59412.842566 56999.912303 60784.171386 (this is virial force: virial[0], virial[1], virial[2])
       6            0 -6.8487667e+08            0 -6.8487667e+08    53370.582 
Loop time of 1.90279 on 1 procs for 6 steps with 152880 atoms

100.0% CPU use with 1 MPI tasks x no OpenMP threads

Minimization stats:
  Stopping criterion = energy tolerance
  Energy initial, next-to-last, final = 
     -684549956.656995  -684876432.248793   -684876668.74023
  Force two-norm initial, final = 78245.649 71.623334
  Force max component initial, final = 1221.0045 0.99900012
  Final line search alpha, max atom move = 0.037349021 0.037311677
  Iterations, force evaluations = 6 8

MPI task timing breakdown:
Section |  min time  |  avg time  |  max time  |%varavg| %total
---------------------------------------------------------------
Pair    | 1.8635     | 1.8635     | 1.8635     |   0.0 | 97.94
Neigh   | 0          | 0          | 0          |   0.0 |  0.00
Comm    | 0.0025246  | 0.0025246  | 0.0025246  |   0.0 |  0.13
Output  | 0          | 0          | 0          |   0.0 |  0.00
Modify  | 2.7e-06    | 2.7e-06    | 2.7e-06    |   0.0 |  0.00
Other   |            | 0.03673    |            |       |  1.93

Nlocal:        152880.0 ave      152880 max      152880 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost:        60846.0 ave       60846 max       60846 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs:         0.00000 ave           0 max           0 min
Histogram: 1 0 0 0 0 0 0 0 0 0
FullNghs:  2.06897e+07 ave 2.06897e+07 max 2.06897e+07 min
Histogram: 1 0 0 0 0 0 0 0 0 0

Total # of neighbors = 20689740
Ave neighs/atom = 135.33320
Neighbor list builds = 0
Dangerous builds = 0
min_style		cg
#-----------------------relaxing------------------------
reset_timestep		0
thermo			1

velocity		all create ${temperature} 4928459
velocity		all create 300 4928459
fix			1 all npt temp ${temperature} ${temperature} $(100.0*dt) x 0 0 1 y 0 0 1 z 0 0 1
fix			1 all npt temp 300 ${temperature} $(100.0*dt) x 0 0 1 y 0 0 1 z 0 0 1
fix			1 all npt temp 300 300 $(100.0*dt) x 0 0 1 y 0 0 1 z 0 0 1
fix			1 all npt temp 300 300 0.10000000000000000555 x 0 0 1 y 0 0 1 z 0 0 1

thermo_style		custom step temp pe ke lx ly lz press vol pxx pyy pzz
dump			1 all custom 100 relaxing*.FILE id type x y z
dump_modify 		1 first yes
dump_modify		1 sort id

run			1000
gpu.cpp.....init 152880 152880 0


---------------------------------------------------------------------
      Device Time Info (average): 
---------------------------------------------------------------------
Data Transfer:   0.0231 s.
Neighbor copy:   0.0371 s.
Neighbor unpack: 0.0000 s.
Force calc:      2.0096 s.
Device Overhead: 0.0004 s.
Average split:   1.0000.
Lanes / atom:    4.
Vector width:    32.
Max Mem / Proc:  131.56 MB.
CPU Cast/Pack:   0.0159 s.
CPU Driver_Time: 0.0001 s.
CPU Idle_Time:   0.0073 s.
---------------------------------------------------------------------


--------------------------------------------------------------------------
- Using acceleration for pinn_adp/gpu:
-  with 1 proc(s) per device.
-  Horizontal vector operations: ENABLED
-  Shared memory system: No
--------------------------------------------------------------------------
Device 0: NVIDIA RTX A5000, 64 CUs, 4.4/24 GB, 1.7 GHZ (Mixed Precision)
--------------------------------------------------------------------------

Initializing Device and compiling on process 0...Done.
Initializing Device 0 on core 0...Done.

Setting up Verlet run ...
  Unit style    : metal
  Current step  : 0
  Time step     : 0.001
calculate_short_time(ms)....1.313824
calculate_energy(ms)....175.074310
calculate_force(ms)....24.644833
Per MPI rank memory allocation (min/avg/max) = 151.8 | 151.8 | 151.8 Mbytes
Step Temp PotEng KinEng Lx Ly Lz Press Volume Pxx Pyy Pzz 
compute_pressure.240..59412.840600 56999.909925 60784.169052
       0          300 -6.8487667e+08    5928.3485          184       85.659        112.5    56941.742    1773141.3    57256.698    55079.669    58488.858 
calculate_short_time(ms)....0.874848
calculate_energy(ms)....175.364090
calculate_force(ms)....23.180767
compute_pressure.240..59436.765517 57019.910836 60817.667433 (this is virial force virial[0], virial[1], virial[2])
       1     299.7462 -6.8487666e+08    5923.3332    184.00148    85.659661    112.50092    56960.678    1773183.7    57273.947    55093.265    58514.821 
calculate_short_time(ms)....0.882336
calculate_energy(ms)....175.773697
calculate_force(ms)....23.698048
compute_pressure.240..59512.870298 57085.184950 60904.438647
       2    298.99206 -6.8487662e+08    5908.4305     184.0059    85.661643    112.50369    57016.325      1773311    57329.719    55138.834    58580.421 
calculate_short_time(ms)....0.883616
calculate_energy(ms)....174.519333
calculate_force(ms)....25.145023
compute_pressure.240..59640.796088 57195.419074 61043.846280
       3    297.74331 -6.8487656e+08    5883.7537    184.01328    85.664947    112.50829    57108.339    1773523.1    57423.736    55216.144    58685.136 
calculate_short_time(ms)....0.885696
calculate_energy(ms)....174.332932
calculate_force(ms)....25.336128
compute_pressure.240..59819.671386 57349.925523 61234.748116 (this is virial force virial[0], virial[1], virial[2])
       4     296.0095 -6.8487648e+08    5849.4917    184.02361    85.669571    112.51475    57235.995    1773820.1    57555.294    55324.665    58828.027 
calculate_short_time(ms)....0.883072
calculate_energy(ms)....176.412674
calculate_force(ms)....25.343296
compute_pressure.240..60048.257426 57547.767049 61475.581241
       5    293.80397 -6.8487638e+08    5805.9078    184.03687     85.67551    112.52304    57398.303    1774201.7    57723.396    55463.686    59007.827 
calculate_short_time(ms)....0.880320
calculate_energy(ms)....175.244293
calculate_force(ms)....25.318945
compute_pressure.240..60325.057670 57787.795979 61764.428872
       6    291.14369 -6.8487625e+08    5753.3375    184.05304    85.682749    112.53314    57594.074    1774666.8    57926.864    55632.356    59223.002 
calculate_short_time(ms)....0.887744
calculate_energy(ms)....175.844345
calculate_force(ms)....25.360607
compute_pressure.240..60648.349991 58068.711874 62099.103656 (this is virial force virial[0], virial[1], virial[2])
       7    288.04916 -6.848761e+08     5692.186    184.07206    85.691257    112.54502    57821.991    1775213.8    58164.379     55829.75    59471.844 
calculate_short_time(ms)....0.881664
calculate_energy(ms)....174.546951
calculate_force(ms)....26.773504
compute_pressure.240..61016.220097 58389.111431 62477.189794 (this is virial force virial[0], virial[1], virial[2])
       8     284.5442 -6.8487594e+08    5622.9239     184.0938    85.700986    112.55861    58080.652    1775839.4     58434.52     56054.92    59752.516 
calculate_short_time(ms)....0.890880
calculate_energy(ms)....176.638977
calculate_force(ms)....24.069281
compute_pressure.240..61426.632293 58747.525094 62896.137120 (this is virial force virial[0], virial[1], virial[2])
       9    280.65573 -6.8487575e+08    5546.0832    184.11811    85.711861     112.5738    58368.645    1776539.1    58735.842    56306.942     60063.15 
calculate_short_time(ms)....0.884352
calculate_energy(ms)....176.113663
calculate_force(ms)....23.096001
compute_pressure.240..61877.477595 59142.451625 63353.289754 (this is virial force virial[0], virial[1], virial[2])
      10    276.41349 -6.8487554e+08    5462.2518    184.14476    85.723777    112.59045    58684.588    1777306.1    59066.928    56584.957     60401.88 
calculate_short_time(ms)....0.880608
calculate_energy(ms)....175.706116
calculate_force(ms)....25.518623
compute_pressure.240..62366.609438 59572.398607 63845.974918
      11     271.8497 -6.8487532e+08    5372.0658    184.17343    85.736598    112.60838    59027.184    1778131.7    59426.427    56888.202    60766.924 
calculate_short_time(ms)....0.883776
calculate_energy(ms)....179.087418
calculate_force(ms)....23.293407
compute_pressure.240..62891.843253 60035.897103 64371.563842 (this is virial force virial[0], virial[1], virial[2])
      12     266.9986 -6.8487509e+08    5276.2026    184.20378    85.750159    112.62734    59395.236    1779005.5    59813.047    57216.027    61156.634 
calculate_short_time(ms)....0.892256
calculate_energy(ms)....178.168839
calculate_force(ms)....23.276960
compute_pressure.240..63450.969258 60531.458912 64927.400541 (this is virial force virial[0], virial[1], virial[2])
      13    261.89608 -6.8487483e+08    5175.3708    184.23536    85.764272    112.64709    59787.598    1779915.4    60225.549    57567.836     61569.41 
calculate_short_time(ms)....0.884352
calculate_energy(ms)....177.204224
calculate_force(ms)....25.515425
compute_pressure.240..64041.732423 61057.541253 65510.864567 (this is virial force virial[0], virial[1], virial[2])
      14    256.57909 -6.8487457e+08    5070.3008    184.26775    85.778737    112.66733    60203.156    1780848.6    60662.708    57943.031     62003.73 
calculate_short_time(ms)....0.899808
calculate_energy(ms)....177.029114
calculate_force(ms)....25.580511
compute_pressure.240..64661.744895 61612.526710 66119.306234 (this is virial force virial[0], virial[1], virial[2])
      15    251.08516 -6.8487429e+08    4961.7344    184.30051     85.79336     112.6878    60640.734    1781792.5    61123.193    58340.957    62458.053 
calculate_short_time(ms)....0.896576
calculate_energy(ms)....175.642624
calculate_force(ms)....25.399937
compute_pressure.240..65308.488695 62194.591806 66749.990205 (this is virial force virial[0], virial[1], virial[2])
      16    245.45188 -6.8487401e+08    4850.4143    184.33324    85.807965    112.70826    61099.001    1782735.9    61605.529    58760.751    62930.722 
calculate_short_time(ms)....0.889376
calculate_energy(ms)....177.623108
calculate_force(ms)....23.269793
compute_pressure.240..65979.207836 62801.717934 67400.092525 (this is virial force virial[0], virial[1], virial[2])
      17    239.71642 -6.8487371e+08    4737.0749    184.36563    85.822412    112.72851    61576.401    1783669.7    62107.966    59201.312    63419.925 
calculate_short_time(ms)....0.893280
calculate_energy(ms)....175.901703
calculate_force(ms)....23.888384
compute_pressure.240..66670.952277 63431.635166 68066.641180 (this is virial force virial[0], virial[1], virial[2])
      18    233.91507 -6.8487341e+08    4622.4336    184.39747    85.836605     112.7484    62071.107    1784587.6    62628.486    59661.226    63923.608 
calculate_short_time(ms)....0.897216
calculate_energy(ms)....176.110596
calculate_force(ms)....25.369921
ERROR: Non-numeric pressure - simulation unstable (../fix_nh.cpp:1069)
Last command: run			1000
Cuda driver error 4 in call at file 'geryon/nvd_timer.h' in line 98.
Cuda driver error 4 in call at file 'geryon/nvd_timer.h' in line 99.
Cuda driver error 4 in call at file 'geryon/nvd_timer.h' in line 98.
Cuda driver error 4 in call at file 'geryon/nvd_timer.h' in line 99.
Cuda driver error 4 in call at file 'geryon/nvd_timer.h' in line 98.
Cuda driver error 4 in call at file 'geryon/nvd_timer.h' in line 99.
--------------------------------------------------------------------------
Primary job  terminated normally, but 1 process returned
a non-zero exit code. Per user-direction, the job has been aborted.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
mpirun detected that one or more processes exited with non-zero status, thus causing
the job to be terminated. The first process to do so was:

  Process name: [[7971,1],0]
  Exit code:    1

Kind regards,
Meng Zhang

There is no question here. What do you expect the forum to do with your post?

Also there is no pair style pinn_adp or pinn_adp/gpu in LAMMPS so doesn’t really refer to the ADP pair style and potential, but to whatever pinn_adp stands for. From the context it seems like it is some machine learning based potential. For feedback on training those and what would be successful and where there are weaknesses, you would have to contact the authors of the add-on software and their training tool. It doesn’t seem to be an issue of LAMMPS proper in the first place and thus your post is mostly off-topic to begin with.

Dear Prof. Axel Kohlmeyer,

Thanks for your replying.
I see. Sorry for put the topic into wrong area.

This is the machine learning potential. Do you know the standard conditions for fitting potential (low loss of energy and force?), which can make sure the potential work well in lammps?

Kind regards,

Since this is currently a very active area of research, there should be plenty of discussions on this subject in the published literature (and much more to come). LAMMPS already has six different ML packages included, plus the ML-IAP package which is a bit like a meta-package, where you can “synthesize” your own ML model from different components, including some imported through python (e.g. from PyTorch). There are more that are distributed separately, most well known is probably “DeepMD/DeepPot” and a bunch more that are not made publicly available. There will have to be a corresponding amount of publications discussing the implementation and advantages over their competitors and how the training and tuning was done.

As I already mentioned, the first set of people to discuss with are the ones that implemented the specific model that you are using.

Dear Prof. Axel Kohlmeyer,

Okay, I see.
Thanks a lots for provding the informaiton. I will check the lammps manual.

Kind regards,

I am confused. In which way did I recommend the LAMMPS manual? On the contrary.
I don’t think there is anything in the LAMMPS manual that will inform you about training an ML potential. That is outside the scope of LAMMPS which mostly has information about how to apply ML potentials. It has a few tools included that can be used for ML potential training, but the discussion of that process is available in the documentation of those tools.

… and - again - discuss with the people that have programmed the tools you use and check out the (many) publications on creating and improving ML potentials.

1 Like

Dear Prof. Axel Kohlmeyer,

Okay, I understand that. Thanks.

Kind regards,