M04A Conjugate Gradient Method in MD++

From Micro and Nano Mechanics Group
Jump to navigation Jump to search

Manual 04A for MD++
Conjugate Gradient Method in MD++

Keonwook Kang and Wei Cai

Mar 19 , 2009



Conjugate Gradient Method

The conjugate gradient (CG) method was initially proposed as an iterative method to solve a large linear system, such as .[1] Later, Fletcher and Reeves[2] adopted it to solve nonlinear optimization problems. In MD++, the CG method is used to find a (local) minimum structure by minimizing a given (usu. nonlinear) potential energy function.

Algorithmically, the structure of the CG method is composed of two nested loops. The outer loop tries different search directions, which are A-orthogoanl to each other for a linear system A. The inner loop aims to find the optimal step length which minimizes the object function along a given search direction. When certain conditions are met, the program exits out of the loops and stops.

.

where and are the step length and the search direction at k-th iteration, respectively, and k is the index of the outer loop.


Implementation of the CG method in MD++

For more information, see supplementary document: Vacancy formation energy by MD++ .



We can run this script file by typing

$ bin/fs gpp scripts/movacancy.script

First, MD++ creates a 5×5×5 perfect cubic crystal of Mo with edges along <100> directions. Then it fixes atom 0 by

   input = [ 1         # number of atoms to be fixed
             0 ]       # index of an atom to be fixed
   fixatoms_by_ID

and then removs this atom by the command removefixedatoms. The first number in the input array specifies the number of atoms to be removed. For example, if you would like to remove two atoms, say 3 and 8, you can do so by

input = [ 2            #  number of atoms to be fixed
          3 8 ]        #  index of atoms to be fixed
fixatoms_by_ID         #  fix a set of atoms by their index
removefixedatoms       # remove fixed atoms


Comparision of the CG method in MD++ and LAMMPS

Table 1. Relaxation of 3[100]x3[010]x3[001] Si structure with a defect. Potential file : MEAM Siz w/ r_c = 6 (A). CG PR+ condition etol = 1e-6 ftol =1e-8
E_perf (eV) E_defect (eV) E_rlx (eV) d_max Iter. No. No. of Calls CPU time
MD++ (zxcgr) -1.00008000022397e+03 -9.00066105589930e+02 -9.04000245870123e+02 13 46
MD++ (PR+) 0.1 -9.03999391688090e+02 13 46
0.01 -9.04000164920736e+02 46 52
0.001 -9.03987772936424e+02 424 424
LAMMPS (Serial Run) -1.00008000022397e+03 -9.00066105589930e+02 0.1 -9.03999391688090e+02 13 46 0.30734
0.01 -9.04000164920732e+02 46 52 0.34946
0.001 -9.03987772936424e+02 424 424 2.7843



in the Appendix.


Fig.2: (a) In a real crystal, the atom that leaves the interior, thus creating

Notes

  1. M. R. Hestenes and E. Stiefel, "Methods of conjugate gradients for solving linear systems", Journal of Research of the National Bureau of Standards, 49(1952) pp.409-436
  2. R. Fletcher and C. M. Reeves, "Function minimization by conjugate gradients", Computer Journal, 7(1964) pp.149-154