WikiEnglish

Version 8 (Paul Fleurat-Lessard, 04/08/2011 18:06)

1 1 Emmanuel Quemener
h1. Porting Path under Open Source
2 1 Emmanuel Quemener
3 1 Emmanuel Quemener
Following elements came from official page project of CBP  [[http://www.cbp.ens-lyon.fr/tiki-index.php?page=CarteOpenSource&bl=y]]
4 1 Emmanuel Quemener
5 3 Paul Fleurat-Lessard
*Keywords:* Reaction path construction and optimization, Mechanism determination, "chemical" coordinates.
6 1 Emmanuel Quemener
7 1 Emmanuel Quemener
h2. Introduction
8 1 Emmanuel Quemener
9 3 Paul Fleurat-Lessard
Computational chemistry has now become a standard tool to evaluate energy (and free energy) differences along a reaction path. However, when dealing with chemical reactions, one often relies on ab initio programs. This leads in turn to simulation costs much higher than for classical force fields. As a consequence, one must look for ways to i) generate initial path as close as possible to the unknown actual path, and ii) efficient ways to optimize this path.
10 3 Paul Fleurat-Lessard
Many methods already exist for the optimization of reaction path such as the Nudged Elastic Band (NEB) method and the String method. In both approaches, the reaction path is discretized as an ensemble of intermediate structures (called images) describing the transformation of the reactants into the products. The originality of our approach is to use different sets of coordinates to describe the system. This is implemented in this program.
11 3 Paul Fleurat-Lessard
12 1 Emmanuel Quemener
h2. Downloading OpenPath software
13 1 Emmanuel Quemener
14 8 Paul Fleurat-Lessard
Following link to download OpenPath archive source : http://forge.cbp.ens-lyon.fr/redmine/attachments/download/26/openpath_1.42.tgz
15 1 Emmanuel Quemener
16 1 Emmanuel Quemener
The @path@ folder contains, in the repository, all sources of software.
17 1 Emmanuel Quemener
18 1 Emmanuel Quemener
A @subversion@ client can also be used to download the sources.
19 1 Emmanuel Quemener
20 1 Emmanuel Quemener
<pre>
21 1 Emmanuel Quemener
svn checkout http://forge.cbp.ens-lyon.fr/svn/openpath
22 1 Emmanuel Quemener
</pre>
23 1 Emmanuel Quemener
24 1 Emmanuel Quemener
h2. Compilation
25 1 Emmanuel Quemener
26 4 Paul Fleurat-Lessard
h3. On the Open Source architecture
27 1 Emmanuel Quemener
28 1 Emmanuel Quemener
<pre>
29 1 Emmanuel Quemener
# Change path to openpath
30 1 Emmanuel Quemener
cd openpath/src
31 1 Emmanuel Quemener
# Launch compilation
32 1 Emmanuel Quemener
make
33 1 Emmanuel Quemener
</pre>
34 1 Emmanuel Quemener
35 3 Paul Fleurat-Lessard
The default compiler is @gfortran@. This can be changed by editing the @Makefile@.
36 2 Paul Fleurat-Lessard
The compilation starts and shows something like this:
37 1 Emmanuel Quemener
<pre>
38 1 Emmanuel Quemener
...
39 1 Emmanuel Quemener
Path.exe has been created.
40 1 Emmanuel Quemener
gfortran -g  -Wall -fbounds-check -o ../utils/xyz2scan ../utils/Xyz2Scan.f
41 1 Emmanuel Quemener
gfortran -g  -Wall -fbounds-check -o ../utils/xyz2path ../utils/Xyz2Path.f
42 1 Emmanuel Quemener
43 1 Emmanuel Quemener
Utilities have been created.
44 1 Emmanuel Quemener
Make sure that they are in your PATH environment
45 1 Emmanuel Quemener
rm m_mrgrnk.mod
46 1 Emmanuel Quemener
</pre>
47 3 Paul Fleurat-Lessard
48 3 Paul Fleurat-Lessard
As of February 2011, @gfortran@ will print warning messages about unused variables. These warnings do not impede the compilation and execution of the program.
49 1 Emmanuel Quemener
50 1 Emmanuel Quemener
h2. Execution
51 1 Emmanuel Quemener
52 1 Emmanuel Quemener
h3. Alone, to retrieve online documentation
53 1 Emmanuel Quemener
54 1 Emmanuel Quemener
Launch the command : 
55 1 Emmanuel Quemener
<pre>
56 1 Emmanuel Quemener
# In compilation folder
57 1 Emmanuel Quemener
./Path.exe -help
58 1 Emmanuel Quemener
</pre>
59 1 Emmanuel Quemener
60 1 Emmanuel Quemener
Output prints _shell_ :
61 1 Emmanuel Quemener
<pre>
62 1 Emmanuel Quemener
 Path mini-help
63 1 Emmanuel Quemener
 --------------
64 1 Emmanuel Quemener
 
65 1 Emmanuel Quemener
 Use: Path Input_file Output_file
66 1 Emmanuel Quemener
 Input_file starts with a Namelist called path
67 1 Emmanuel Quemener
 
68 1 Emmanuel Quemener
 Compulsory variables are:
69 1 Emmanuel Quemener
 NGeomi: Number of geometries defining the Initial path
70 1 Emmanuel Quemener
 NGeomf: Number of geometries defining the Final path
71 1 Emmanuel Quemener
 Nat   : Number of atoms
72 1 Emmanuel Quemener
 
73 1 Emmanuel Quemener
 Other options
74 1 Emmanuel Quemener
 Input: string that indicates the type of the input geometries.
75 1 Emmanuel Quemener
 Accepted values are: Cart (or Xmol or Xyz) or Vasp
76 1 Emmanuel Quemener
 Prog: string that indicates the program that will be used for energy and gradient calculations.
77 1 Emmanuel Quemener
       Accepted values are: Gaussian, Vasp, Mopac or Ext
78 1 Emmanuel Quemener
       In case of a Gaussian or Mopac calculations, input must be set to Cart.
79 1 Emmanuel Quemener
       One example of a gaussian/mopac input should be added at the end of the
80 1 Emmanuel Quemener
       input file.See example file Test_G03.path or Test_Mopac.path
81 1 Emmanuel Quemener
       In the case of a VASP calculation, if input is set to Cart, then
82 1 Emmanuel Quemener
     the preamble of a VASP calculation should be added at the end of
83 1 Emmanuel Quemener
     the input file. See example file Test_VASP_cart.path
84 1 Emmanuel Quemener
     In the case of a VASP calculation, one should also give value of the 
85 1 Emmanuel Quemener
     Runmode variable
86 1 Emmanuel Quemener
 Runmode: This indicates wether one should use VASP routine to calculate the energy
87 1 Emmanuel Quemener
        and gradient of the whole path or not. If one wants to use VASP,
88 1 Emmanuel Quemener
        Runmode must be set to PARA.
89 1 Emmanuel Quemener
 PathName: Prefix used to save the path. Default is Path
90 1 Emmanuel Quemener
 Poscar: string that will be used as the prefix for the different 
91 1 Emmanuel Quemener
         POSCAR files in a VASP calculations. Usefull only if PathOnly=.TRUE.,
92 1 Emmanuel Quemener
         not used for internal calculations.
93 1 Emmanuel Quemener
  CalcName: Prefix for the files used for the energy and gradient calculations
94 1 Emmanuel Quemener
  ISuffix: Suffix for the input file.
95 1 Emmanuel Quemener
  OSuffix: suffix for the output file.
96 1 Emmanuel Quemener
 IGeomRef: Index of the geometry used to construct the internal coordinates.
97 1 Emmanuel Quemener
       Valid only for Coord=Zmat, Hybrid or Mixed
98 1 Emmanuel Quemener
 Fact: REAL used to define if two atoms are linked.
99 1 Emmanuel Quemener
       If d(A,B)<=fact*(rcov(A)+rcov(B)), then A and B are considered Linked.
100 1 Emmanuel Quemener
 debugFile: Name of the file that indicates which subroutine should print debug info.
101 1 Emmanuel Quemener
 Coord: System of coordinates to use. Possible choices are:
102 1 Emmanuel Quemener
        - CART (or Xyz): works in cartesian
103 1 Emmanuel Quemener
        - Zmat: works in internal coordinates (Zmat)
104 1 Emmanuel Quemener
        - Mixed: frozen atoms, as well as atoms defined by the 
105 1 Emmanuel Quemener
        'cart' array(see below) are describe in CARTESIAN, whereas the
106 1 Emmanuel Quemener
        others are described in Zmat
107 1 Emmanuel Quemener
        - Baker: use of Baker coordinates, also called delocalized internal coordinates
108 1 Emmanuel Quemener
        - Hybrid: geometries are described in zmat, but the gradient are used in cartesian
109 1 Emmanuel Quemener
 Step_method: method to compute the step for optimizing a geometry; choices are:
110 1 Emmanuel Quemener
        - RFO: Rational function optimization
111 1 Emmanuel Quemener
        - GDIIS: Geometry optimization using direct inversion in the iterative supspace
112 1 Emmanuel Quemener
  HesUpd: method to update the hessian. By default, it is Murtagh-Sargent
113 1 Emmanuel Quemener
       Except for geometry optimization where it is BFGS.
114 1 Emmanuel Quemener
 MaxCyc: maximum number of iterations for the path optimization
115 1 Emmanuel Quemener
 Smax: Maximum length of a step during path optimization
116 1 Emmanuel Quemener
 SThresh: Step Threshold to consider that the path is stationary
117 1 Emmanuel Quemener
 GThresh: Gradient Threshold to consider that the path is stationary, only orthogonal part is taken
118 1 Emmanuel Quemener
 FTan: We moving the path, this gives the proportion of the displacement tangent to the path
119 1 Emmanuel Quemener
       that is kept. FTan=1. corresponds to the full displacement, 
120 1 Emmanuel Quemener
       whereas FTan=0. gives a displacement orthogonal to the path.
121 1 Emmanuel Quemener
 IReparam: The path is not reparameterised at each iteration. This gives the frequency of reparameterization.
122 1 Emmanuel Quemener
 ISpline: By default, a linear interpolation is used to generate the path.
123 1 Emmanuel Quemener
          This option indicates the first step where spline interpolation is used.
124 1 Emmanuel Quemener
 
125 1 Emmanuel Quemener
 Arrays:
126 1 Emmanuel Quemener
 Rcov: Array containing the covalent radii of the first 80 elements.
127 1 Emmanuel Quemener
       You can modify it using, rcov(6)=0.8.
128 1 Emmanuel Quemener
 Mass: Array containing the atomic mass of the first 80 elements.
129 1 Emmanuel Quemener
 AtTypes: Name of the different atoms used in a VASP calculations.
130 1 Emmanuel Quemener
 If not given, Path will read the POTCAR file.
131 1 Emmanuel Quemener
 
132 1 Emmanuel Quemener
 Flags:
133 1 Emmanuel Quemener
 MW:  Flag. True if one wants to work in Mass Weighted coordinates. Default=.TRUE.
134 1 Emmanuel Quemener
 Renum: Flag. True if one wants to reoder the atoms in the initial order. default is .TRUE. most of the time.
135 1 Emmanuel Quemener
 OptProd: True if one wants to optimize the geometry of the products.
136 1 Emmanuel Quemener
 OptReac: True if one wants to optimize the geometry of the reactants.
137 1 Emmanuel Quemener
 PathOnly:TRUE if one wants to generate the initial path, and stops.
138 1 Emmanuel Quemener
 Hinv: if True, then Hessian inversed is used.
139 1 Emmanuel Quemener
 IniHup: if True, then Hessian inverse is extrapolated using the initial path calculations.
140 1 Emmanuel Quemener
 HupNeighbour: if True, then Hessian inverse is extrapolated using the neighbouring points of the path.
141 1 Emmanuel Quemener
 FFrozen: True if one wants to freeze the positions of some atoms.
142 1 Emmanuel Quemener
          If True, a &frozenlist namelist containing the list of frozen atoms must be given.
143 1 Emmanuel Quemener
           If VASP is used, and frozen is not given
144 1 Emmanuel Quemener
  here, the program will use the F flags of the input geometry
145 1 Emmanuel Quemener
 FCart:  True if one wants to describe some atoms using cartesian coordinates. 
146 1 Emmanuel Quemener
         *** Only used in 'mixed' calculations. ***
147 1 Emmanuel Quemener
       If True, a &cartlist namelist containing the list of cart atoms must be given.
148 1 Emmanuel Quemener
       By default, only frozen atoms are described in cartesian coordinates.
149 1 Emmanuel Quemener
 
150 1 Emmanuel Quemener
 DynMaxStep: if TRUE, the maximum allowed step is updated at each step, for each geometry.
151 1 Emmanuel Quemener
         If energy goes up, Smax=Smax*0.8, if not Smax=Smax*1.2. 
152 1 Emmanuel Quemener
        It is ensured that the dynamical Smax is within [0.5*SMax_0,2*Smax_0]
153 1 Emmanuel Quemener
 Autocart: True if you want to let the program choosing the cartesian atoms.
154 1 Emmanuel Quemener
 VMD: TRUE if you want to use VMD to look at the Path. Used only for VASP for now
155 1 Emmanuel Quemener
 WriteVASP: TRUE if you want to print the images coordinates in POSCAR files.
156 1 Emmanuel Quemener
 See also the POSCAR option. This can be used only if prog or input=VASP.
157 1 Emmanuel Quemener
</pre> 
158 1 Emmanuel Quemener
159 1 Emmanuel Quemener
h3. Execution of a complete example Test_HCN_zmat_test
160 1 Emmanuel Quemener
161 1 Emmanuel Quemener
<pre>
162 1 Emmanuel Quemener
# Change folder
163 1 Emmanuel Quemener
cd ../examples/Test/Zmat
164 1 Emmanuel Quemener
# Launch path on HCN_zmat.path with HCN_zmat.out
165 1 Emmanuel Quemener
../../../src/Path.exe HCN_zmat.path HCN_zmat.out
166 1 Emmanuel Quemener
</pre>
167 1 Emmanuel Quemener
168 1 Emmanuel Quemener
Output prints @Test_HCN_zmat_test.out@ (available in @Files@) starts and ends with following lines :
169 1 Emmanuel Quemener
<pre>
170 1 Emmanuel Quemener
 Path v4.1793 (c) PFL/PD 2007-2010
171 1 Emmanuel Quemener
 Input has been set to the default: XYZ                             
172 1 Emmanuel Quemener
 Working in MW coordinates
173 1 Emmanuel Quemener
 Prog=TEST
174 1 Emmanuel Quemener
 EGrad.f90, L73, IOpt=           0
175 1 Emmanuel Quemener
 EGrad.f90, L73, IOpt=           0
176 1 Emmanuel Quemener
 EGrad.f90, L73, IOpt=           0
177 1 Emmanuel Quemener
 EGrad.f90, L73, IOpt=           0
178 1 Emmanuel Quemener
 EGrad.f90, L73, IOpt=           0
179 1 Emmanuel Quemener
 EGrad.f90, L73, IOpt=           0
180 1 Emmanuel Quemener
 EGrad.f90, L73, IOpt=           0
181 1 Emmanuel Quemener
 EGrad.f90, L73, IOpt=           0
182 1 Emmanuel Quemener
 EGrad.f90, L73, IOpt=           0
183 1 Emmanuel Quemener
 EGrad.f90, L73, IOpt=           0
184 1 Emmanuel Quemener
 GeomTmp=
185 1 Emmanuel Quemener
  1.053  1.113  2.832
186 1 Emmanuel Quemener
 GeomCart=
187 1 Emmanuel Quemener
  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000  0.000
188 1 Emmanuel Quemener
--- snip snip ---
189 1 Emmanuel Quemener
 Extrapol_int u,xgeom(NGeomI),s,dist,s-dist   11.000000000000000        11.000000000000000        1.3530023123052950        1.3530023123053081      -1.31006316905768472E-014
190 1 Emmanuel Quemener
</pre>