Liquid Si - MLFF: Difference between revisions

From VASP Wiki
Line 166: Line 166:
*Run the calculation and look at the total energy in the {{TAG|OUTCAR}} file (or {{TAG|OSZICAR}}). AFter that switch back to the original directory. That energy will be used for the {{TAG|ML_FF_EATOM}} tag. If multiple atom types are present in the structure than this step has to be repeated for each atom type separately and the reference energies are provided as a list after the {{TAG|ML_FF_EATOM}} tag, where the ordering of the energies corresponds to the ordering of the elements in the {{TAG|POTCAR}} file.
*Run the calculation and look at the total energy in the {{TAG|OUTCAR}} file (or {{TAG|OSZICAR}}). AFter that switch back to the original directory. That energy will be used for the {{TAG|ML_FF_EATOM}} tag. If multiple atom types are present in the structure than this step has to be repeated for each atom type separately and the reference energies are provided as a list after the {{TAG|ML_FF_EATOM}} tag, where the ordering of the energies corresponds to the ordering of the elements in the {{TAG|POTCAR}} file.


=== Machine learning force field ===
=== Creating the liquid structure ===
 
We will start this example from a perfect super cell of crystalline silicon (fcc diamond structure) containing 64 atoms. The temperature is set to 2000 K so that when an MD is run the melting should occur relatively fast. We will do the melting with on-the-fly learning. This will greatly accelerate the melting since after some time most of the ab initio calculations are skipped and the very fast force fields take over. This calculation will be executed for 10000 steps with a step size of 3 fs.


== Download ==
== Download ==

Revision as of 18:50, 23 July 2019

Task

Generating a machine learning force field for liquid Si.

Input

POSCAR

  • In this example we start from a 64 atom super cell of diamond-fcc Si (the same as in this example: Liquid Si - Standard MD:
Si cubic diamond 2x2x2 super cell of conventional cell
     5.43090000000000
    2.00000000   0.00000000   0.00000000
    0.00000000   2.00000000   0.00000000
    0.00000000   0.00000000   2.00000000
   Si
   64
Direct
   0.00000000   0.00000000   0.00000000
   0.50000000   0.00000000   0.00000000
   0.00000000   0.50000000   0.00000000
   0.50000000   0.50000000   0.00000000
   0.00000000   0.00000000   0.50000000
   0.50000000   0.00000000   0.50000000
   0.00000000   0.50000000   0.50000000
   0.50000000   0.50000000   0.50000000
   0.37500000   0.12500000   0.37500000
   0.87500000   0.12500000   0.37500000
   0.37500000   0.62500000   0.37500000
   0.87500000   0.62500000   0.37500000
   0.37500000   0.12500000   0.87500000
   0.87500000   0.12500000   0.87500000
   0.37500000   0.62500000   0.87500000
   0.87500000   0.62500000   0.87500000
   0.00000000   0.25000000   0.25000000
   0.50000000   0.25000000   0.25000000
   0.00000000   0.75000000   0.25000000
   0.50000000   0.75000000   0.25000000
   0.00000000   0.25000000   0.75000000
   0.50000000   0.25000000   0.75000000
   0.00000000   0.75000000   0.75000000
   0.50000000   0.75000000   0.75000000
   0.37500000   0.37500000   0.12500000
   0.87500000   0.37500000   0.12500000
   0.37500000   0.87500000   0.12500000
   0.87500000   0.87500000   0.12500000
   0.37500000   0.37500000   0.62500000
   0.87500000   0.37500000   0.62500000
   0.37500000   0.87500000   0.62500000
   0.87500000   0.87500000   0.62500000
   0.25000000   0.00000000   0.25000000
   0.75000000   0.00000000   0.25000000
   0.25000000   0.50000000   0.25000000
   0.75000000   0.50000000   0.25000000
   0.25000000   0.00000000   0.75000000
   0.75000000   0.00000000   0.75000000 
   0.25000000   0.50000000   0.75000000
   0.75000000   0.50000000   0.75000000
   0.12500000   0.12500000   0.12500000
   0.62500000   0.12500000   0.12500000
   0.12500000   0.62500000   0.12500000
   0.62500000   0.62500000   0.12500000
   0.12500000   0.12500000   0.62500000
   0.62500000   0.12500000   0.62500000
   0.12500000   0.62500000   0.62500000
   0.62500000   0.62500000   0.62500000
   0.25000000   0.25000000   0.00000000
   0.75000000   0.25000000   0.00000000
   0.25000000   0.75000000   0.00000000
   0.75000000   0.75000000   0.00000000
   0.25000000   0.25000000   0.50000000
   0.75000000   0.25000000   0.50000000
   0.25000000   0.75000000   0.50000000
   0.75000000   0.75000000   0.50000000
   0.12500000   0.37500000   0.37500000
   0.62500000   0.37500000   0.37500000
   0.12500000   0.87500000   0.37500000
   0.62500000   0.87500000   0.37500000
   0.12500000   0.37500000   0.87500000
   0.62500000   0.37500000   0.87500000
   0.12500000   0.87500000   0.87500000
   0.62500000   0.87500000   0.87500000

KPOINTS

  • We will start with a single k point in this example:
K-Points
 0
Gamma
 1  1  1
 0  0  0

INCAR

#Basic parameters
ISMEAR = 0
SIGMA = 0.1
LREAL = Auto
PREC = FAST
ALGO = FAST
ISYM = -1
NELM = 100
EDIFF = 1E-4
LWAVE = .FALSE.
LCHARG = .FALSE.

#Parallelization of ab initio calculations
NCORE = 2

#MD
IBRION = 0
MDALGO = 2
ISIF = 2
SMASS = 1.0
TEBEG = 2000
NSW = 10000
POTIM = 3.0

#Machine learning paramters
ML_FF_LMLFF = .TRUE.
ML_FF_ISTART = 0
ML_FF_NWRITE = 2
ML_FF_EATOM = -.70128086E+00
  • The user should be familiar at this step how to run a basic molecular dynamics calculations. If not please go through the example here: Liquid Si - Standard MD.
  • Machine learning is switched on by setting the following tag: ML_FF_LMLFF=.TRUE..
  • By setting the tag ML_FF_ISTART to zero learning from scratch is selected.
  • The flag ML_FF_NWRITE=2 selects a more verbose output where the error on energies, forces and stress are output to the ML_LOGFILE file. This setting is very handy to check the accuracy of the force field.
  • The tag ML_FF_EATOM=-.70128086E+00 sets the atomic reference energy for each species. How to obtain that energy is explained below.

Calculation

Reference energy

Before the force field for liquid Si can be calculated, the atomic energy of a single Si atom in a large enough box has to be calculated. For that the following steps have to be done:

  • Create a new directory Si_ATOM by typing mkdir Si_ATOM and go to that directory cd Si_ATOM.
  • Create an INCAR file with the following parameters:
#Basic parameters
ISMEAR = 0
SIGMA = 0.1
LREAL = Auto
PREC = FAST
ALGO = FAST
ISYM = 0
NELM = 100
EDIFF = 1E-4
LWAVE = .FALSE.
LCHARG = .FALSE.
ISPIN = 2
  • Create a POSCAR file with a single atom in a large enough box (the box should be orthorombic to have enough degrees of freedom for electronic relaxation):
Si atom
     1.00090000000000
    12.00000000   0.00000000   0.00000000
     0.00000000  12.01000000   0.00000000
     0.00000000   0.00000000  12.02000000
   Si
   1
Direct
   0.00000000   0.00000000   0.00000000
  • Create a KPOINTS file with a single k point (or copy the one delivered with this example):
test
0 0 0
Gamma
 1 1 1
 0 0 0
  • Copy the POTCAR from the previous directory to this directory (cp ../POTCAR).
  • Run the calculation and look at the total energy in the OUTCAR file (or OSZICAR). AFter that switch back to the original directory. That energy will be used for the ML_FF_EATOM tag. If multiple atom types are present in the structure than this step has to be repeated for each atom type separately and the reference energies are provided as a list after the ML_FF_EATOM tag, where the ordering of the energies corresponds to the ordering of the elements in the POTCAR file.

Creating the liquid structure

We will start this example from a perfect super cell of crystalline silicon (fcc diamond structure) containing 64 atoms. The temperature is set to 2000 K so that when an MD is run the melting should occur relatively fast. We will do the melting with on-the-fly learning. This will greatly accelerate the melting since after some time most of the ab initio calculations are skipped and the very fast force fields take over. This calculation will be executed for 10000 steps with a step size of 3 fs.

Download