Coder Social home page Coder Social logo

pyiron-workshop / potentials-workshop-2021 Goto Github PK

View Code? Open in Web Editor NEW
4.0 8.0 1.0 43.66 MB

Workshop - workflows for atomistic simulation (10-12 March 2021)

Home Page: https://pyiron.org/potentials-workshop-2021/

License: BSD 3-Clause "New" or "Revised" License

Jupyter Notebook 99.15% Shell 0.02% Python 0.83%
pyiron workshop lammps

potentials-workshop-2021's Introduction

Potentials Workshop

The workshop - workflows for atomistic simulation (10 - 12 March 2021) is organized by the Interdisciplinary Centre for Advanced Materials Simulation (ICAMS) and the Max-Planck-Institut für Eisenforschung (MPIE) in collaboration with the Technische Universität Darmstadt and the Georg-August-Universität Göttingen.

Cloud environment

During the workshop we use the pyiron workshop infrastructure - workshop.pyiron.org.

Preview

Alternatively you can use Binder

Local installation

Besides the cloud infrastructure used during the workshop, the same notebooks can also be executed on any Linux workstation. To setup the conda environment for the workshop, the environment file is loaded:

conda env update --file binder/environment.yml

Following the installation of the conda environment, NGLview for jupyter lab is configured:

jupyter nbextension install nglview --py --sys-prefix
jupyter nbextension enable nglview --py --sys-prefix
jupyter labextension install @jupyter-widgets/jupyterlab-manager --no-build
jupyter labextension install nglview-js-widgets
jupyter labextension install @jupyterlab/toc

Content of the Workshop

Day 1

The scope of the first day is to become familiar with pyiron. We start with LAMMPS as molecular dynamics code to calculate moelcular dynamics trajectories, followed by the introduction of the pyiron tables object, S/PHI/nX as opensource DFT code and Master jobs like the Murnaghan job to calculate the energy volume curve, the calculation of elastic constants and finally the calculation of free energies with phonopy.

Day 2

The scope of the second day is to learn about the fitting of interatomic potentials, with a primary focus on atomicrex, the atomic cluster expansion and the neuronal network potentials.

Day 3

Finally on the third day we calculate the material properties defined on the first day with the interatomic potentials fitted on the second day and validate those with the results of other interatomic potentials available at atomistictools.org.

potentials-workshop-2021's People

Contributors

jan-janssen avatar leimeroth avatar mrshrbld avatar pmrv avatar sudarsan-surendralal avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

srmnitc

potentials-workshop-2021's Issues

Coordinating lammps potential name

We should make sure that all three fitting classes have the same way of getting the final lammps potential. I added a lammps_potential property to the RuNNer class, I took the name from @yury-lysogorskiy. @Leimeroth do you have a method like this already in AtomicRex?

Any other suggestions for the name or method vs. property?

Feedback ex_02_creating_structure_databases

In cell 13:

for job_name in ["lammps_job_vac", "lammps_job_surf"]:
    job_md = pr.load(job_name)
    pos = job_md["output/generic/positions"]
    traj_length = len(pos)
    stride = 10
    for i in range(0, traj_length, stride):
        container.include_job(job_md, iteration_step=i)

I guess it would be easier to use iterjobs() here rather than a manual list of job_names and then loading them.

Atomicrex workflow broken

@Leimeroth Currently the atomicrex workflow gives the following issue.

---------------------------------------------------------------------------
212
Exception encountered at "In [4]":
213
---------------------------------------------------------------------------
214
StdinNotImplementedError                  Traceback (most recent call last)
215
<ipython-input-4-5a80c2a3b254> in <module>
216
      1 pr = Project("WorkshopPotential")
217
----> 2 pr.remove_jobs()
218

219
/usr/share/miniconda/envs/test/lib/python3.7/site-packages/pyiron_base/project/generic.py in remove_jobs(self, recursive)
220
    997                 confirmed = input(
221
    998                     "Are you sure you want to delete all jobs from "
222
--> 999                     + f"'{self.base_name}'? y/(n)"
223
   1000                     ).lower()
224
   1001             else:
225

226
/usr/share/miniconda/envs/test/lib/python3.7/site-packages/ipykernel/kernelbase.py in raw_input(self, prompt)
227
    844         if not self._allow_stdin:
228
    845             raise StdinNotImplementedError(
229
--> 846                 "raw_input was called, but this frontend does not support input requests."
230
    847             )
231
    848         return self._input_request(str(prompt),
232

233
StdinNotImplementedError: raw_input was called, but this frontend does not support input requests.

This was working before so please compare to the previous version.

Workflow-RuNNer.ipynb needs update

in the Workflow-RuNNer.ipynb, from day2, the following tries to unpack the dataset from some tar archieve file:

data_pr = Project("../../datasets")
if len(data_pr.job_table()) == 0:
    data_pr.unpack("Cu_training_archive")

But we have already imported these data on the start of the docker container, and there is no Cu_training_archive in the datasets directory. I believe it should be replaced by the following:

data_pr = Project("../../datasets")
#if len(data_pr.job_table()) == 0:
#    data_pr.unpack("Cu_training_archive")

@jan-janssen , and @mrshrbld, am I right?

Ideas for structuring the workshop

Some ideas for the workshop from our weekly developer meeting. Please feel free to modify/add to this in this discussion

Day 1

  • Introduction to pyiron (simple calculations)
  • Workflow for Free energy calculations
  • Show how to construct structure data for fitting

Day 2

  • Running the various potential fitting codes

Day 3

  • Looping over the generated potentials from day 2 to calculate free energies from the workflows shown in day 1

Feedback ex_01_introduction_to_pyiron

In cell 44:

num_pot = 3
pot_finder = pr.inspect_emperical_potentials()
pot_list = pot_finder.find("Cu").Name.to_list()[:num_pot]
pot_list

On mybinder this returns:

['Cu-ace', 'Cu-atomicrex-df1-0-13', 'Cu-atomicrex-df1-68-22']

Which are the potentials for day 3 and I guess we should not use them for the testing on day 1.

RuNNer potentials fail for surface calculations

When using the RuNNer code for the validation tests, LAMMPS crashes with the following message:

2021-03-08 10:06:22,758 - pyiron_log - WARNING - Job aborted
2021-03-08 10:06:22,762 - pyiron_log - WARNING - LAMMPS (10 Feb 2021)
Reading data file ...
  orthogonal box = (0.0000000 0.0000000 0.0000000) to (20.418051 17.682551 26.587360)
  1 by 1 by 1 MPI processor grid
  reading atoms ...
  512 atoms
  read_data CPU = 0.004 seconds
WARNING: Using 'neigh_modify every 1 delay 0 check yes' setting during minimization (src/min.cpp:188)

*******************************************************************************

WELCOME TO n²p², A SOFTWARE PACKAGE FOR NEURAL NETWORK POTENTIALS!
------------------------------------------------------------------

n²p² version      : 553e609
------------------------------------------------------------
Git branch        : HEAD
Git revision      : 553e6097553afe442843cc45bce5c974b1ec2f92
Compile date/time : Feb 15 2021 12:43:18
------------------------------------------------------------

Please cite the following papers when publishing results obtained with n²p²:
-------------------------------------------------------------------------------
 * General citation for n²p² and the LAMMPS interface:

 Singraber, A.; Behler, J.; Dellago, C.
 Library-Based LAMMPS Implementation of High-Dimensional
 Neural Network Potentials.
 J. Chem. Theory Comput. 2019 15 (3), 1827–1840.
 https://doi.org/10.1021/acs.jctc.8b00770
-------------------------------------------------------------------------------
 * Additionally, if you use the NNP training features of n²p²:

 Singraber, A.; Morawietz, T.; Behler, J.; Dellago, C.
 Parallel Multistream Training of High-Dimensional Neural
 Network Potentials.
 J. Chem. Theory Comput. 2019, 15 (5), 3075–3092.
 https://doi.org/10.1021/acs.jctc.8b01092
-------------------------------------------------------------------------------
 * Additionally, if polynomial symmetry functions are used:

 Bircher, M. P.; Singraber, A.; Dellago, C.
 Improved Description of Atomic Environments Using Low-Cost
 Polynomial Functions with Compact Support.
 arXiv:2010.14414 [cond-mat, physics:physics] 2020.
 https://arxiv.org/abs/2010.14414
*******************************************************************************

*** SETUP: SETTINGS FILE ******************************************************

Settings file name: ./input.nn
Read 95 lines.
WARNING: Unknown keyword "calculate_forces" at line 94.
WARNING: Unknown keyword "calculate_stress" at line 95.
WARNING: Unknown keyword "fitting_unit" at line 67.
WARNING: Unknown keyword "force_update_scaling" at line 83.
WARNING: Unknown keyword "mix_all_points" at line 79.
WARNING: Unknown keyword "nn_type_short" at line 24.
WARNING: Unknown keyword "random_number_type" at line 29.
WARNING: Unknown keyword "runner_mode" at line 25.
WARNING: Unknown keyword "use_short_nn" at line 34.
WARNING: 9 problems detected (0 critical).
Found 43 lines with keywords.
This settings file defines a short-range only NNP.
*******************************************************************************

*** SETUP: NORMALIZATION ******************************************************

Data set normalization is not used.
*******************************************************************************

*** SETUP: ELEMENT MAP ********************************************************

Number of element strings found: 1
Element  0: Cu ( 29)
*******************************************************************************

*** SETUP: ELEMENTS ***********************************************************

Number of elements is consistent: 1
Atomic energy offsets per element:
Element  0:   0.00000000E+00
Energy offsets are automatically subtracted from reference energies.
*******************************************************************************

*** SETUP: CUTOFF FUNCTIONS ***************************************************

Parameter alpha for inner cutoff: 0.000000
Inner cutoff = Symmetry function cutoff * alpha
Equal cutoff function type for all symmetry functions:
CutoffFunction::CT_COS (1)
x := (r - rc * alpha) / (rc - rc * alpha)
f(x) = 1/2 * (cos(pi*x) + 1)
*******************************************************************************

*** SETUP: SYMMETRY FUNCTIONS *************************************************

Abbreviations:
--------------
ind .... Symmetry function index.
ec ..... Central atom element.
tp ..... Symmetry function type.
sbtp ... Symmetry function subtype (e.g. cutoff type).
e1 ..... Neighbor 1 element.
e2 ..... Neighbor 2 element.
eta .... Gaussian width eta.
rs/rl... Shift distance of Gaussian or left cutoff radius for polynomial.
angl.... Left cutoff angle for polynomial.
angr.... Right cutoff angle for polynomial.
la ..... Angle prefactor lambda.
zeta ... Angle term exponent zeta.
rc ..... Cutoff radius / right cutoff radius for polynomial.
a ...... Free parameter alpha (e.g. cutoff alpha).
ln ..... Line number in settings file.

Short range atomic symmetry functions element Cu :
-------------------------------------------------------------------------------------------------
 ind ec tp sbtp e1 e2       eta      rs/rl         rc   angl   angr la zeta    a    ln
-------------------------------------------------------------------------------------------------
   1 Cu  2  ct1 Cu    0.000E+00  0.000E+00  1.200E+01                       0.00    48
   2 Cu  2  ct1 Cu    6.000E-03  0.000E+00  1.200E+01                       0.00    49
   3 Cu  2  ct1 Cu    1.600E-02  0.000E+00  1.200E+01                       0.00    50
   4 Cu  2  ct1 Cu    4.000E-02  0.000E+00  1.200E+01                       0.00    51
   5 Cu  2  ct1 Cu    1.090E-01  0.000E+00  1.200E+01                       0.00    52
   6 Cu  3  ct1 Cu Cu 0.000E+00  0.000E+00  1.200E+01               -1  1.0 0.00    58
   7 Cu  3  ct1 Cu Cu 0.000E+00  0.000E+00  1.200E+01                1  1.0 0.00    54
   8 Cu  3  ct1 Cu Cu 0.000E+00  0.000E+00  1.200E+01               -1  2.0 0.00    59
   9 Cu  3  ct1 Cu Cu 0.000E+00  0.000E+00  1.200E+01                1  2.0 0.00    55
  10 Cu  3  ct1 Cu Cu 0.000E+00  0.000E+00  1.200E+01               -1  4.0 0.00    60
  11 Cu  3  ct1 Cu Cu 0.000E+00  0.000E+00  1.200E+01                1  4.0 0.00    56
  12 Cu  3  ct1 Cu Cu 0.000E+00  0.000E+00  1.200E+01               -1 16.0 0.00    61
  13 Cu  3  ct1 Cu Cu 0.000E+00  0.000E+00  1.200E+01                1 16.0 0.00    57
-------------------------------------------------------------------------------------------------
Minimum cutoff radius for element Cu: 12.000000
Maximum cutoff radius (global)      : 12.000000
*******************************************************************************

*** SETUP: SYMMETRY FUNCTION MEMORY *******************************************

Symmetry function derivatives memory table for element Cu :
-------------------------------------------------------------------------------
Relevant symmetry functions for neighbors with element:
- Cu:   13 of   13 (100.0 %)
-------------------------------------------------------------------------------
*******************************************************************************

*** SETUP: SYMMETRY FUNCTION CACHE ********************************************

Element Cu: in total 2 caches, used 13.00 times on average.
*******************************************************************************

*** SETUP: SYMMETRY FUNCTION GROUPS *******************************************

Abbreviations:
--------------
ind .... Symmetry function index.
ec ..... Central atom element.
tp ..... Symmetry function type.
sbtp ... Symmetry function subtype (e.g. cutoff type).
e1 ..... Neighbor 1 element.
e2 ..... Neighbor 2 element.
eta .... Gaussian width eta.
rs/rl... Shift distance of Gaussian or left cutoff radius for polynomial.
angl.... Left cutoff angle for polynomial.
angr.... Right cutoff angle for polynomial.
la ..... Angle prefactor lambda.
zeta ... Angle term exponent zeta.
rc ..... Cutoff radius / right cutoff radius for polynomial.
a ...... Free parameter alpha (e.g. cutoff alpha).
ln ..... Line number in settings file.
mi ..... Member index.
sfi .... Symmetry function index.
e ...... Recalculate exponential term.

Short range atomic symmetry function groups element Cu :
----------------------------------------------------------------------------------------------------------
 ind ec tp sbtp e1 e2       eta      rs/rl         rc   angl   angr la zeta    a    ln   mi  sfi e
----------------------------------------------------------------------------------------------------------
   1 Cu  2  ct1 Cu            *          *  1.200E+01                       0.00     *    *    *  
   -  -  -    -  -    0.000E+00  0.000E+00          -                          -    48    1    1  
   -  -  -    -  -    6.000E-03  0.000E+00          -                          -    49    2    2  
   -  -  -    -  -    1.600E-02  0.000E+00          -                          -    50    3    3  
   -  -  -    -  -    4.000E-02  0.000E+00          -                          -    51    4    4  
   -  -  -    -  -    1.090E-01  0.000E+00          -                          -    52    5    5  
   2 Cu  3  ct1 Cu Cu         *          *  1.200E+01                *    * 0.00     *    *    * *
   -  -  -    -  -  - 0.000E+00  0.000E+00          -               -1  1.0    -    58    1    6 1
   -  -  -    -  -  - 0.000E+00  0.000E+00          -                1  1.0    -    54    2    7 0
   -  -  -    -  -  - 0.000E+00  0.000E+00          -               -1  2.0    -    59    3    8 0
   -  -  -    -  -  - 0.000E+00  0.000E+00          -                1  2.0    -    55    4    9 0
   -  -  -    -  -  - 0.000E+00  0.000E+00          -               -1  4.0    -    60    5   10 0
   -  -  -    -  -  - 0.000E+00  0.000E+00          -                1  4.0    -    56    6   11 0
   -  -  -    -  -  - 0.000E+00  0.000E+00          -               -1 16.0    -    61    7   12 0
   -  -  -    -  -  - 0.000E+00  0.000E+00          -                1 16.0    -    57    8   13 0
----------------------------------------------------------------------------------------------------------
*******************************************************************************

*** SETUP: NEURAL NETWORKS ****************************************************

Normalize neurons (all elements): 0
-------------------------------------------------------------------------------
Atomic short range NN for element Cu :
Number of weights    :    435
Number of biases     :     31
Number of connections:    466
Architecture       13   15   15    1
-------------------------------------------------------------------------------
   1   G   t   t   l
   2   G   t   t    
   3   G   t   t    
   4   G   t   t    
   5   G   t   t    
   6   G   t   t    
   7   G   t   t    
   8   G   t   t    
   9   G   t   t    
  10   G   t   t    
  11   G   t   t    
  12   G   t   t    
  13   G   t   t    
  14       t   t    
  15       t   t    
-------------------------------------------------------------------------------
*******************************************************************************

*** SETUP: SYMMETRY FUNCTION SCALING ******************************************

Equal scaling type for all symmetry functions:
Scaling type::ST_SCALECENTER (3)
Gs = Smin + (Smax - Smin) * (G - Gmean) / (Gmax - Gmin)
WARNING: Keyword "scale_min_short" not found.
         Default value for Smin = 0.0.
WARNING: Keyword "scale_max_short" not found.
         Default value for Smax = 1.0.
Smin = 0.000000
Smax = 1.000000
Symmetry function scaling statistics from file: ./scaling.data
-------------------------------------------------------------------------------

Abbreviations:
--------------
ind ..... Symmetry function index.
min ..... Minimum symmetry function value.
max ..... Maximum symmetry function value.
mean .... Mean symmetry function value.
sigma ... Standard deviation of symmetry function values.
sf ...... Scaling factor for derivatives.
Smin .... Desired minimum scaled symmetry function value.
Smax .... Desired maximum scaled symmetry function value.
t ....... Scaling type.

Scaling data for symmetry functions element Cu :
-------------------------------------------------------------------------------
 ind       min       max      mean     sigma        sf  Smin  Smax t
-------------------------------------------------------------------------------
   1  1.43E+01  1.96E+01  1.66E+01  0.00E+00  1.87E-01  0.00  1.00 3
   2  1.08E+01  1.49E+01  1.26E+01  0.00E+00  2.41E-01  0.00  1.00 3
   3  7.07E+00  9.94E+00  8.33E+00  0.00E+00  3.48E-01  0.00  1.00 3
   4  3.06E+00  4.51E+00  3.70E+00  0.00E+00  6.89E-01  0.00  1.00 3
   5  4.43E-01  8.41E-01  6.11E-01  0.00E+00  2.52E+00  0.00  1.00 3
   6  1.14E+01  2.33E+01  1.61E+01  0.00E+00  8.36E-02  0.00  1.00 3
   7  3.09E+01  6.26E+01  4.35E+01  0.00E+00  3.15E-02  0.00  1.00 3
   8  4.75E+00  1.02E+01  6.89E+00  0.00E+00  1.83E-01  0.00  1.00 3
   9  2.43E+01  4.95E+01  3.43E+01  0.00E+00  3.97E-02  0.00  1.00 3
  10  1.69E+00  3.91E+00  2.56E+00  0.00E+00  4.50E-01  0.00  1.00 3
  11  1.65E+01  3.43E+01  2.36E+01  0.00E+00  5.63E-02  0.00  1.00 3
  12  2.53E-01  8.21E-01  4.60E-01  0.00E+00  1.76E+00  0.00  1.00 3
  13  4.07E+00  9.69E+00  6.25E+00  0.00E+00  1.78E-01  0.00  1.00 3
-------------------------------------------------------------------------------
*******************************************************************************

*** SETUP: SYMMETRY FUNCTION STATISTICS ***************************************

Equal symmetry function statistics for all elements.
Collect min/max/mean/sigma                        : 0
Collect extrapolation warnings                    : 1
Write extrapolation warnings immediately to stderr: 0
Halt on any extrapolation warning                 : 0
*******************************************************************************

*** SETUP: NEURAL NETWORK WEIGHTS *********************************************

Short  NN weight file name format: ./weights.%03d.data
Setting short  NN weights for element Cu from file: ./weights.029.data
*******************************************************************************

*** SETUP: LAMMPS INTERFACE ***************************************************

Individual extrapolation warnings will not be shown.
Extrapolation warning summary will not be shown.
The simulation will be stopped when 100 extrapolation warnings are exceeded.
Extrapolation warnings are accumulated over all time steps.
-------------------------------------------------------------------------------
CAUTION: If the LAMMPS unit system differs from the one used
         during NN training, appropriate conversion factors
         must be provided (see keywords cflength and cfenergy).

Length unit conversion factor:   1.8897261327999999E+00
Energy unit conversion factor:   3.6749325399999998E-02

Checking consistency of cutoff radii (in LAMMPS units):
LAMMPS Cutoff (via pair_coeff)  :   1.200E+01
Maximum symmetry function cutoff:   6.350E+00
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
WARNING: Potential length units mismatch!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-------------------------------------------------------------------------------
Element mapping string from LAMMPS to n2p2: "1:Cu"

CAUTION: Please ensure that this mapping between LAMMPS
         atom types and NNP elements is consistent:

---------------------------
LAMMPS type  |  NNP element
---------------------------
          1 <-> Cu ( 29)
---------------------------

NNP setup for LAMMPS completed.
*******************************************************************************
Neighbor list info ...
  update every 1 steps, delay 0 steps, check yes
  max neighbors/atom: 2000, page size: 100000
  master list distance cutoff = 14
  ghost atom cutoff = 14
  binsize = 7, bins = 3 3 4
  1 neighbor lists, perpetual/occasional/extra = 1 0 0
  (1) pair nnp, perpetual
      attributes: full, newton on
      pair build: full/bin/atomonly
      stencil: full/bin/3d
      bin: standard
Setting up cg style minimization ...
  Unit style    : metal
  Current step  : 0
ERROR on proc 0: Too many extrapolation warnings (src/USER-NNP/pair_nnp.cpp:404)

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.