Unverified Commit 83f5c331 authored by Steve Plimpton's avatar Steve Plimpton Committed by GitHub
Browse files

Merge pull request #886 from lammps/snap-quadratic

updates to quadratic form of SNAP potential
parents d5ec7629 b5b70b42
Loading
Loading
Loading
Loading
+13 −8
Original line number Diff line number Diff line
@@ -161,9 +161,9 @@ function.

The keyword {bzeroflag} determines whether or not {B0}, the bispectrum
components of an atom with no neighbors, are subtracted from
the calculated bispectrum components. This optional keyword is only
available for compute {sna/atom}, as {snad/atom} and {snav/atom}
are unaffected by the removal of constant terms.
the calculated bispectrum components. This optional keyword 
normally only affects compute {sna/atom}. However, when
{quadraticflag} is on, it also affects {snad/atom} and {snav/atom}.

The keyword {quadraticflag} determines whether or not the
quadratic analogs to the bispectrum quantities are generated.
@@ -230,13 +230,18 @@ are 30, 90, and 180, respectively. With {quadratic} value=1,
the numbers of columns are 930, 2790, and 5580, respectively.

If the {quadratic} keyword value is set to 1, then additional
columns are appended to each per-atom array, corresponding to
columns are generated, corresponding to
the products of all distinct pairs of  bispectrum components. If the
number of bispectrum components is {K}, then the number of distinct pairs
is  {K}({K}+1)/2. These are output in subblocks of  {K}({K}+1)/2 columns, using the same
ordering of sub-blocks as was used for the bispectrum
components. Within each sub-block, the ordering is upper-triangular,
(1,1),(1,2)...(1,{K}),(2,1)...({K}-1,{K}-1),({K}-1,{K}),({K},{K})
is  {K}({K}+1)/2.
For compute {sna/atom} these columns are appended to existing {K} columns.
The ordering of quadratic terms is upper-triangular,
(1,1),(1,2)...(1,{K}),(2,1)...({K}-1,{K}-1),({K}-1,{K}),({K},{K}).
For computes {snad/atom} and {snav/atom} each set of {K}({K}+1)/2
additional columns is inserted directly after each of sub-block
of linear terms i.e. linear and quadratic terms are contiguous.
So the nesting order from inside to outside is bispectrum component,
linear then quadratic, vector/tensor component, type.

These values can be accessed by any command that uses per-atom values
from a compute as input.  See "Section
+127 −0
Original line number Diff line number Diff line
LAMMPS (20 Apr 2018)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90)
  using 1 OpenMP thread(s) per MPI task
# Demonstrate SNAP Ta potential

# Initialize simulation

variable nsteps index 100
variable nrep equal 4
variable a equal 3.160
units		metal

# generate the box and atom positions using a BCC lattice

variable nx equal ${nrep}
variable nx equal 4
variable ny equal ${nrep}
variable ny equal 4
variable nz equal ${nrep}
variable nz equal 4

boundary	p p p

lattice         bcc $a
lattice         bcc 3.16
Lattice spacing in x,y,z = 3.16 3.16 3.16
region		box block 0 ${nx} 0 ${ny} 0 ${nz}
region		box block 0 4 0 ${ny} 0 ${nz}
region		box block 0 4 0 4 0 ${nz}
region		box block 0 4 0 4 0 4
create_box	1 box
Created orthogonal box = (0 0 0) to (12.64 12.64 12.64)
  1 by 1 by 1 MPI processor grid
create_atoms	1 box
Created 128 atoms
  Time spent = 0.000223637 secs

mass 1 183.84

# choose potential

include Mo_Chen_PRM2017.snap

# DATE: 2017-09-18 CONTRIBUTOR: Chi Chen <chc273@eng.ucsd.edu> CITATION: C. Chen, Z. Deng, R. Tran, H. Tang, I.-H. Chu, S. P. Ong, "Accurate force field for molybdenum by machine learning large materials data" Physical Review Materials 1, 04 3603 (2017)
# Generated by Materials Virtual Lab
# Definition of SNAP potential.
pair_style snap
pair_coeff * * Mo_Chen_PRM2017.snapcoeff Mo Mo_Chen_PRM2017.snapparam Mo
Reading potential file Mo_Chen_PRM2017.snapcoeff with DATE: 2017-09-18
SNAP Element = Mo, Radius 0.5, Weight 1 
Reading potential file Mo_Chen_PRM2017.snapparam with DATE: 2017-09-18
SNAP keyword rcutfac 4.615858 
SNAP keyword twojmax 6 


# Setup output

thermo		10
thermo_modify norm yes

# Set up NVE run

timestep 0.5e-3
neighbor 1.0 bin
neigh_modify once no every 1 delay 0 check yes

# Run MD

velocity all create 300.0 4928459
fix 1 all nve
run             ${nsteps}
run             100
Neighbor list info ...
  update every 1 steps, delay 0 steps, check yes
  max neighbors/atom: 2000, page size: 100000
  master list distance cutoff = 5.61586
  ghost atom cutoff = 5.61586
  binsize = 2.80793, bins = 5 5 5
  1 neighbor lists, perpetual/occasional/extra = 1 0 0
  (1) pair snap, perpetual
      attributes: full, newton on
      pair build: full/bin/atomonly
      stencil: full/bin/3d
      bin: standard
Per MPI rank memory allocation (min/avg/max) = 3.507 | 3.507 | 3.507 Mbytes
Step Temp E_pair E_mol TotEng Press 
       0          300   -22.405975            0     -22.3675    2575.7657 
      10    294.77555   -22.405305            0     -22.3675    2756.6894 
      20    279.53011    -22.40335            0     -22.3675    3285.8272 
      30    255.52174    -22.40027            0     -22.3675    4122.8933 
      40     224.7299   -22.396321            0   -22.367499    5204.3499 
      50    189.67529   -22.391825            0   -22.367499    6449.1308 
      60    153.18862   -22.387145            0   -22.367499     7765.911 
      70    118.14998   -22.382652            0   -22.367499    9061.1616 
      80    87.224916   -22.378685            0   -22.367499     10247.68 
      90    62.623892    -22.37553            0   -22.367498    11250.067 
     100      45.9103   -22.373386            0   -22.367498    12011.726 
Loop time of 3.3917 on 1 procs for 100 steps with 128 atoms

Performance: 1.274 ns/day, 18.843 hours/ns, 29.484 timesteps/s
99.7% CPU use with 1 MPI tasks x 1 OpenMP threads

MPI task timing breakdown:
Section |  min time  |  avg time  |  max time  |%varavg| %total
---------------------------------------------------------------
Pair    | 3.3906     | 3.3906     | 3.3906     |   0.0 | 99.97
Neigh   | 0          | 0          | 0          |   0.0 |  0.00
Comm    | 0.00039721 | 0.00039721 | 0.00039721 |   0.0 |  0.01
Output  | 0.00023007 | 0.00023007 | 0.00023007 |   0.0 |  0.01
Modify  | 0.00021887 | 0.00021887 | 0.00021887 |   0.0 |  0.01
Other   |            | 0.0002868  |            |       |  0.01

Nlocal:    128 ave 128 max 128 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Nghost:    727 ave 727 max 727 min
Histogram: 1 0 0 0 0 0 0 0 0 0
Neighs:    0 ave 0 max 0 min
Histogram: 1 0 0 0 0 0 0 0 0 0
FullNghs:  7424 ave 7424 max 7424 min
Histogram: 1 0 0 0 0 0 0 0 0 0

Total # of neighbors = 7424
Ave neighs/atom = 58
Neighbor list builds = 0
Dangerous builds = 0

Total wall time: 0:00:03
+127 −0
Original line number Diff line number Diff line
LAMMPS (20 Apr 2018)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90)
  using 1 OpenMP thread(s) per MPI task
# Demonstrate SNAP Ta potential

# Initialize simulation

variable nsteps index 100
variable nrep equal 4
variable a equal 3.160
units		metal

# generate the box and atom positions using a BCC lattice

variable nx equal ${nrep}
variable nx equal 4
variable ny equal ${nrep}
variable ny equal 4
variable nz equal ${nrep}
variable nz equal 4

boundary	p p p

lattice         bcc $a
lattice         bcc 3.16
Lattice spacing in x,y,z = 3.16 3.16 3.16
region		box block 0 ${nx} 0 ${ny} 0 ${nz}
region		box block 0 4 0 ${ny} 0 ${nz}
region		box block 0 4 0 4 0 ${nz}
region		box block 0 4 0 4 0 4
create_box	1 box
Created orthogonal box = (0 0 0) to (12.64 12.64 12.64)
  1 by 2 by 2 MPI processor grid
create_atoms	1 box
Created 128 atoms
  Time spent = 0.000277281 secs

mass 1 183.84

# choose potential

include Mo_Chen_PRM2017.snap

# DATE: 2017-09-18 CONTRIBUTOR: Chi Chen <chc273@eng.ucsd.edu> CITATION: C. Chen, Z. Deng, R. Tran, H. Tang, I.-H. Chu, S. P. Ong, "Accurate force field for molybdenum by machine learning large materials data" Physical Review Materials 1, 04 3603 (2017)
# Generated by Materials Virtual Lab
# Definition of SNAP potential.
pair_style snap
pair_coeff * * Mo_Chen_PRM2017.snapcoeff Mo Mo_Chen_PRM2017.snapparam Mo
Reading potential file Mo_Chen_PRM2017.snapcoeff with DATE: 2017-09-18
SNAP Element = Mo, Radius 0.5, Weight 1 
Reading potential file Mo_Chen_PRM2017.snapparam with DATE: 2017-09-18
SNAP keyword rcutfac 4.615858 
SNAP keyword twojmax 6 


# Setup output

thermo		10
thermo_modify norm yes

# Set up NVE run

timestep 0.5e-3
neighbor 1.0 bin
neigh_modify once no every 1 delay 0 check yes

# Run MD

velocity all create 300.0 4928459
fix 1 all nve
run             ${nsteps}
run             100
Neighbor list info ...
  update every 1 steps, delay 0 steps, check yes
  max neighbors/atom: 2000, page size: 100000
  master list distance cutoff = 5.61586
  ghost atom cutoff = 5.61586
  binsize = 2.80793, bins = 5 5 5
  1 neighbor lists, perpetual/occasional/extra = 1 0 0
  (1) pair snap, perpetual
      attributes: full, newton on
      pair build: full/bin/atomonly
      stencil: full/bin/3d
      bin: standard
Per MPI rank memory allocation (min/avg/max) = 3.486 | 3.486 | 3.486 Mbytes
Step Temp E_pair E_mol TotEng Press 
       0          300   -22.405975            0     -22.3675    2575.7657 
      10    294.63153   -22.405286            0     -22.3675    2753.4662 
      20    278.98535    -22.40328            0     -22.3675     3272.416 
      30    254.38916   -22.400125            0     -22.3675    4091.8933 
      40    222.91191   -22.396088            0   -22.367499    5148.5505 
      50    187.16984   -22.391504            0   -22.367499    6362.2454 
      60    150.08253   -22.386747            0   -22.367499    7643.2732 
      70    114.60307   -22.382197            0   -22.367499    8900.2448 
      80    83.449257   -22.378201            0   -22.367499    10047.619 
      90    58.862643   -22.375048            0   -22.367498    11012.233 
     100     42.41931   -22.372939            0   -22.367498    11740.641 
Loop time of 1.91636 on 4 procs for 100 steps with 128 atoms

Performance: 2.254 ns/day, 10.646 hours/ns, 52.182 timesteps/s
97.9% CPU use with 4 MPI tasks x 1 OpenMP threads

MPI task timing breakdown:
Section |  min time  |  avg time  |  max time  |%varavg| %total
---------------------------------------------------------------
Pair    | 1.8147     | 1.8411     | 1.8875     |   2.1 | 96.07
Neigh   | 0          | 0          | 0          |   0.0 |  0.00
Comm    | 0.022276   | 0.069629   | 0.095057   |  10.7 |  3.63
Output  | 0.00032496 | 0.00065821 | 0.0016179  |   0.0 |  0.03
Modify  | 0.00019503 | 0.00020915 | 0.00023341 |   0.0 |  0.01
Other   |            | 0.00481    |            |       |  0.25

Nlocal:    32 ave 32 max 32 min
Histogram: 4 0 0 0 0 0 0 0 0 0
Nghost:    431 ave 431 max 431 min
Histogram: 4 0 0 0 0 0 0 0 0 0
Neighs:    0 ave 0 max 0 min
Histogram: 4 0 0 0 0 0 0 0 0 0
FullNghs:  1856 ave 1856 max 1856 min
Histogram: 4 0 0 0 0 0 0 0 0 0

Total # of neighbors = 7424
Ave neighs/atom = 58
Neighbor list builds = 0
Dangerous builds = 0

Total wall time: 0:00:01
+32 −19
Original line number Diff line number Diff line
LAMMPS (5 Oct 2016)
LAMMPS (20 Apr 2018)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90)
  using 1 OpenMP thread(s) per MPI task
# Demonstrate SNAP Ta potential

# Initialize simulation
@@ -31,12 +33,13 @@ Created orthogonal box = (0 0 0) to (13.264 13.264 13.264)
  1 by 1 by 1 MPI processor grid
create_atoms	1 box
Created 128 atoms
  Time spent = 0.000328064 secs

mass 1 180.88

# choose potential

include Ta06A_pot.snap
include Ta06A.snap
# DATE: 2014-09-05 CONTRIBUTOR: Aidan Thompson athomps@sandia.gov CITATION: Thompson, Swiler, Trott, Foiles and Tucker, arxiv.org, 1409.3880 (2014)

# Definition of SNAP potential Ta_Cand06A
@@ -48,10 +51,9 @@ variable zblz equal 73

# Specify hybrid with SNAP, ZBL

pair_style hybrid/overlay snap zbl ${zblcutinner} ${zblcutouter}
pair_style hybrid/overlay snap zbl 4 ${zblcutouter}
pair_style hybrid/overlay snap zbl 4 4.8

pair_style hybrid/overlay zbl ${zblcutinner} ${zblcutouter} snap
pair_style hybrid/overlay zbl 4 ${zblcutouter} snap
pair_style hybrid/overlay zbl 4 4.8 snap
pair_coeff 1 1 zbl ${zblz} ${zblz}
pair_coeff 1 1 zbl 73 ${zblz}
pair_coeff 1 1 zbl 73 73
@@ -61,10 +63,11 @@ SNAP Element = Ta, Radius 0.5, Weight 1
Reading potential file Ta06A.snapparam with DATE: 2014-09-05
SNAP keyword rcutfac 4.67637 
SNAP keyword twojmax 6 
SNAP keyword gamma 1 
SNAP keyword rfac0 0.99363 
SNAP keyword rmin0 0 
SNAP keyword diagonalstyle 3 
SNAP keyword bzeroflag 0 
SNAP keyword quadraticflag 0 


# Setup output
@@ -85,13 +88,23 @@ fix 1 all nve
run             ${nsteps}
run             100
Neighbor list info ...
  2 neighbor list requests
  update every 1 steps, delay 0 steps, check yes
  max neighbors/atom: 2000, page size: 100000
  master list distance cutoff = 5.8
  ghost atom cutoff = 5.8
  binsize = 2.9 -> bins = 5 5 5
Memory usage per processor = 2.92823 Mbytes
  binsize = 2.9, bins = 5 5 5
  2 neighbor lists, perpetual/occasional/extra = 2 0 0
  (1) pair zbl, perpetual, half/full from (2)
      attributes: half, newton on
      pair build: halffull/newton
      stencil: none
      bin: none
  (2) pair snap, perpetual
      attributes: full, newton on
      pair build: full/bin/atomonly
      stencil: full/bin/3d
      bin: standard
Per MPI rank memory allocation (min/avg/max) = 4.138 | 4.138 | 4.138 Mbytes
Step Temp E_pair E_mol TotEng Press 
       0          300    -11.85157            0   -11.813095    2717.1661 
      10    295.96579   -11.851053            0   -11.813095    2696.1559 
@@ -104,20 +117,20 @@ Step Temp E_pair E_mol TotEng Press
      80    124.04276   -11.829003            0   -11.813094     1537.703 
      90     97.37622   -11.825582            0   -11.813094    1734.9662 
     100    75.007873   -11.822714            0   -11.813094    1930.8005 
Loop time of 3.43062 on 1 procs for 100 steps with 128 atoms
Loop time of 2.53266 on 1 procs for 100 steps with 128 atoms

Performance: 1.259 ns/day, 19.059 hours/ns, 29.149 timesteps/s
99.9% CPU use with 1 MPI tasks x no OpenMP threads
Performance: 1.706 ns/day, 14.070 hours/ns, 39.484 timesteps/s
99.5% CPU use with 1 MPI tasks x 1 OpenMP threads

MPI task timing breakdown:
Section |  min time  |  avg time  |  max time  |%varavg| %total
---------------------------------------------------------------
Pair    | 3.4295     | 3.4295     | 3.4295     |   0.0 | 99.97
Pair    | 2.5313     | 2.5313     | 2.5313     |   0.0 | 99.95
Neigh   | 0          | 0          | 0          |   0.0 |  0.00
Comm    | 0.00043988 | 0.00043988 | 0.00043988 |   0.0 |  0.01
Output  | 0.00010014 | 0.00010014 | 0.00010014 |   0.0 |  0.00
Modify  | 0.00024533 | 0.00024533 | 0.00024533 |   0.0 |  0.01
Other   |            | 0.0002978  |            |       |  0.01
Comm    | 0.00051379 | 0.00051379 | 0.00051379 |   0.0 |  0.02
Output  | 0.00023317 | 0.00023317 | 0.00023317 |   0.0 |  0.01
Modify  | 0.00023675 | 0.00023675 | 0.00023675 |   0.0 |  0.01
Other   |            | 0.0003583  |            |       |  0.01

Nlocal:    128 ave 128 max 128 min
Histogram: 1 0 0 0 0 0 0 0 0 0
@@ -133,4 +146,4 @@ Ave neighs/atom = 58
Neighbor list builds = 0
Dangerous builds = 0

Total wall time: 0:00:03
Total wall time: 0:00:02
+32 −19
Original line number Diff line number Diff line
LAMMPS (5 Oct 2016)
LAMMPS (20 Apr 2018)
OMP_NUM_THREADS environment is not set. Defaulting to 1 thread. (../comm.cpp:90)
  using 1 OpenMP thread(s) per MPI task
# Demonstrate SNAP Ta potential

# Initialize simulation
@@ -31,12 +33,13 @@ Created orthogonal box = (0 0 0) to (13.264 13.264 13.264)
  1 by 2 by 2 MPI processor grid
create_atoms	1 box
Created 128 atoms
  Time spent = 0.000288486 secs

mass 1 180.88

# choose potential

include Ta06A_pot.snap
include Ta06A.snap
# DATE: 2014-09-05 CONTRIBUTOR: Aidan Thompson athomps@sandia.gov CITATION: Thompson, Swiler, Trott, Foiles and Tucker, arxiv.org, 1409.3880 (2014)

# Definition of SNAP potential Ta_Cand06A
@@ -48,10 +51,9 @@ variable zblz equal 73

# Specify hybrid with SNAP, ZBL

pair_style hybrid/overlay snap zbl ${zblcutinner} ${zblcutouter}
pair_style hybrid/overlay snap zbl 4 ${zblcutouter}
pair_style hybrid/overlay snap zbl 4 4.8

pair_style hybrid/overlay zbl ${zblcutinner} ${zblcutouter} snap
pair_style hybrid/overlay zbl 4 ${zblcutouter} snap
pair_style hybrid/overlay zbl 4 4.8 snap
pair_coeff 1 1 zbl ${zblz} ${zblz}
pair_coeff 1 1 zbl 73 ${zblz}
pair_coeff 1 1 zbl 73 73
@@ -61,10 +63,11 @@ SNAP Element = Ta, Radius 0.5, Weight 1
Reading potential file Ta06A.snapparam with DATE: 2014-09-05
SNAP keyword rcutfac 4.67637 
SNAP keyword twojmax 6 
SNAP keyword gamma 1 
SNAP keyword rfac0 0.99363 
SNAP keyword rmin0 0 
SNAP keyword diagonalstyle 3 
SNAP keyword bzeroflag 0 
SNAP keyword quadraticflag 0 


# Setup output
@@ -85,13 +88,23 @@ fix 1 all nve
run             ${nsteps}
run             100
Neighbor list info ...
  2 neighbor list requests
  update every 1 steps, delay 0 steps, check yes
  max neighbors/atom: 2000, page size: 100000
  master list distance cutoff = 5.8
  ghost atom cutoff = 5.8
  binsize = 2.9 -> bins = 5 5 5
Memory usage per processor = 2.91109 Mbytes
  binsize = 2.9, bins = 5 5 5
  2 neighbor lists, perpetual/occasional/extra = 2 0 0
  (1) pair zbl, perpetual, half/full from (2)
      attributes: half, newton on
      pair build: halffull/newton
      stencil: none
      bin: none
  (2) pair snap, perpetual
      attributes: full, newton on
      pair build: full/bin/atomonly
      stencil: full/bin/3d
      bin: standard
Per MPI rank memory allocation (min/avg/max) = 4.118 | 4.118 | 4.118 Mbytes
Step Temp E_pair E_mol TotEng Press 
       0          300    -11.85157            0   -11.813095    2717.1661 
      10     295.8664    -11.85104            0   -11.813095     2702.935 
@@ -104,20 +117,20 @@ Step Temp E_pair E_mol TotEng Press
      80    121.80051   -11.828715            0   -11.813094    1627.6911 
      90    95.262635   -11.825311            0   -11.813094    1812.9327 
     100    73.194645   -11.822481            0   -11.813094    1995.2199 
Loop time of 0.89193 on 4 procs for 100 steps with 128 atoms
Loop time of 1.3621 on 4 procs for 100 steps with 128 atoms

Performance: 4.843 ns/day, 4.955 hours/ns, 112.116 timesteps/s
99.9% CPU use with 4 MPI tasks x no OpenMP threads
Performance: 3.172 ns/day, 7.567 hours/ns, 73.416 timesteps/s
98.7% CPU use with 4 MPI tasks x 1 OpenMP threads

MPI task timing breakdown:
Section |  min time  |  avg time  |  max time  |%varavg| %total
---------------------------------------------------------------
Pair    | 0.84444    | 0.86772    | 0.88108    |   1.6 | 97.29
Pair    | 1.2867     | 1.309      | 1.35       |   2.1 | 96.10
Neigh   | 0          | 0          | 0          |   0.0 |  0.00
Comm    | 0.009577   | 0.023049   | 0.046417   |   9.8 |  2.58
Output  | 0.00024009 | 0.00026137 | 0.00027895 |   0.1 |  0.03
Modify  | 8.2493e-05 | 9.352e-05  | 0.00010061 |   0.1 |  0.01
Other   |            | 0.0008071  |            |       |  0.09
Comm    | 0.0096083  | 0.050652   | 0.072999   |  10.9 |  3.72
Output  | 0.00031447 | 0.00060236 | 0.0014303  |   0.0 |  0.04
Modify  | 0.00014234 | 0.00016212 | 0.00018811 |   0.0 |  0.01
Other   |            | 0.001728   |            |       |  0.13

Nlocal:    32 ave 32 max 32 min
Histogram: 4 0 0 0 0 0 0 0 0 0
@@ -133,4 +146,4 @@ Ave neighs/atom = 58
Neighbor list builds = 0
Dangerous builds = 0

Total wall time: 0:00:00
Total wall time: 0:00:01
Loading