• No se han encontrado resultados

Selección, formación y desarrollo profesional (EC7) (LA1) (LA2) (LA10)

In document Responsabilidad social corporativa (página 69-76)

Principales logros Líneas de actuación

7.3 Selección, formación y desarrollo profesional (EC7) (LA1) (LA2) (LA10)

In order to make a novel basis function type properly accessible to the full range of quantum-chemical methods a daunting amount of integral routines and computational procedures need to be implemented. For assessing the usefulness of a new discretisation method it is, however, important to be able to quickly investigate its performance with respect to as many problems as possible. Undoubtedly a very important application of computational chemistry is structure prediction, i.e. geometry optimisation. For per- forming such calculations, the implementation of appropriate integral derivatives inside the integral library is required. Since doing so can become as difficult as implementing the integrals required for the SCF scheme itself, one would much rather skip this step and concentrate only on what is required for the SCF at first.

In this example we will demonstrate how the flexible design of molsturm enables us to incorporate readily available building blocks of python such that a decent gradient-free geometry-optimisation scheme results. This effectively works around the lack of nuclear derivatives on the side of the integral library and allows to perform simple structure optimisations even without nuclear gradients — neither analytical nor numerical.

The script shown in figure 7.5 performs a geometry optimisation of a water based on Powell’s gradient-free optimisation algorithm [255, 256] as implemented in the scipy library [240, 245]. The optimal structure is found in a two-step procedure. First, a cheap STO-3G [4] basis set is used to obtain a reasonable guess. Then, the final geometry is found by minimising to a lower convergence threshold in the more costly def2-SV(P) [251] basis.

Similar to the CCD example the time required to code the script was rather little, about 30 minutes. Nevertheless the script is able to converge in a couple of minutes to the equilibrium geometry shown in figure 7.6. A novel basis function type, for which one just implemented the SCF integrals in gint, can be used with the script of figure 7.5 by only altering the parameters in lines 36 and 41. This makes the script very suitable for giving such basis functions a try in the context of geometry optimisation.

7.3. EXAMPLES 167 1 import numpy as np 2 import scipy . o p t i m i z e 3 import m o l s t u r m 4 5

6 def o p t i m i z e _ h 2 o ( rHO_guess , angHO_guess , conv_tol ,

7 ** params ) :

8 # F u n c t i o n which c o m p u t e s the c a r t e s i a n g e o m e t r y

9 # from r and theta .

10 def g e o m e t r y (r , theta ) :

11 rad = theta / 180 * np . pi

12 pos = ( r * np . cos ( rad ) , r * np . sin ( rad ) , 0)

13 return m o l s t u r m . System ([" O ", " H ", " H "] , 14 [(0 , 0 , 0) , (r , 0 , 0) , pos ]) 15 16 def o b j e c t i v e _ f u n c t i o n ( args ) : 17 system = g e o m e t r y (* args ) 18 ret = m o l s t u r m . h a r t r e e _ f o c k ( 19 system , c o n v _ t o l = c o n v _ t o l /100 , ** params , 20 ) 21 return ret [" e n e r g y _ g r o u n d _ s t a t e "] 22 23 guess = ( rHO_guess , a n g H O _ g u e s s ) 24 res = scipy . o p t i m i z e . m i n i m i z e (

25 o b j e c t i v e _ f u n c t i o n , guess , tol = conv_tol ,

26 method =" Powell "

27 )

28 return res . x [0] , res . x [1]

29

30 def main () :

31 r = 2.0 # O - H radius guess ( in au )

32 theta = 120 # H -O - H angle guess

33

34 # First a crude o p t i m i s a t i o n with sto -3 g

35 r , theta = o p t i m i z e _ h 2 o (r , theta , c o n v _ t o l =5 e -4 ,

36 b a s i s _ t y p e =" g a u s s i a n ",

37 b a s i s _ s e t _ n a m e =" sto -3 g ")

38

39 # Then a more fine o p t i m i s a t i o n with def2 - sv ( p )

40 r , theta = o p t i m i z e _ h 2 o (r , theta , c o n v _ t o l =1 e -5 ,

41 b a s i s _ t y p e =" g a u s s i a n ",

42 b a s i s _ s e t _ n a m e =" def2 - sv ( p ) ")

43 print(" o p t i m a l H - O bond length ( au ) : ", r )

44 print(" o p t i m a l H -O - H bond angle : ", theta )

45

46 if _ _ n a m e _ _ == " _ _ m a i n _ _ ":

47 main ()

Figure 7.5: Example python script for performing a gradient-free optimisation using Powell’s method [255, 256] and molsturm.

168 CHAPTER 7. THE MOLSTURM METHOD-DEVELOPMENT FRAMEWORK

Figure 7.6: Density plot of the final optimised H2O Hartree-Fock geometry with a

O−H bond length of 0.95046 Å and a H−O−H bond angle of 106.35. A geometry

optimisation in ORCA [130] employing the same basis set agrees with this result within

the convergence tolerance of 10−5.

In document Responsabilidad social corporativa (página 69-76)