CamCASP/Interfaces

From CUC3
Revision as of 17:21, 8 December 2011 by import>Am592 (→‎Interface Details)
Jump to navigation Jump to search

CamCASP => Interfaces

This page describes details of interfaces to various SCF codes. Also see details of basis sets given in section Basis functions .

NWChem

Interface

All we've used NWChem with are spherical GTOs. It supplied MO coefficients as standing in front of fully normalized spherical GTOs (like any sensible code should!). But the sign of some of these is different:

d1+ ==> - d1+
f1+ ==> - f1+
f3+ ==> - f3+
g1+ ==> - g1+
g3+ ==> - g3+

User-defined basis sets

Scratch_dir /scratch/alston/CH2-nwchem

start ch2-rhf

Geometry units angstrom

C    0.0      0.0     0.0
H1   0.92884  0.7079 -0.2
H2  -0.82884  0.7079  0.2

End

Basis Spherical Nosegment
 carbon  S
           8236.0000000    0.000542430189
           1235.0000000    0.004196427901
            280.8000000    0.021540914108
             79.2700000    0.083614949614
             25.5900000    0.239871618922
              8.9970000    0.443751820060
              3.3190000    0.353579696469
              0.3643000   -0.009176366076
 carbon  S
           8236.0000000   -0.000196392234
           1235.0000000   -0.001525950274
            280.8000000   -0.007890449028
             79.2700000   -0.031514870532
             25.5900000   -0.096910008320
              8.9970000   -0.220541526288
              3.3190000   -0.296069112937
              0.3643000    1.040503432950
 carbon  S
              0.9059000    1.000000000000
 carbon  S
              0.1285000    1.000000000000
 carbon  P
             18.7100000    0.039426387165
              4.1330000    0.244088984924
              1.2000000    0.815492008943
 carbon  D
              1.0970000    1.000000000000
 carbon  F
              0.7610000    1.000000000000
 hydrogen  S
             33.8700000    0.025494863235
              5.0950000    0.190362765893
              1.1590000    0.852162022245
 hydrogen  S
              0.3258000    1.000000000000
 hydrogen  P
              1.4070000    1.000000000000
End

Title "CH2  RHF/aTZ"


task scf

The EMSL Basis portal supplies basis sets with the atom symbol in place of a name. So perhaps we can use the symbol instead. We will need a converter to convert our GAMESS(US) formatted basis sets to NWChem format.

GAMESS(US)

Interface Details

GAMESS(US) uses Spherical GTOs in a slightly different way from other codes. The MO coefficients of its spherical GTOs are not supplied as standing in front of the components of the spherical GTOs, but rather they stand in front of the Cartesian components. To make this concrete, rather than supply 5 sets of 5 MO coefficients for a spherical d-function (each set of 5 would correspond to an MO), GAMESS(US) will supply 5 sets of 6 coefficients. Each of these 6 would stand in front of Cartesian GTOs. This is OK, but the normalization of these Cartesian GTOs is rather awkward. I have worked out the transformation matrices from these Cartesian GTOs to an equivalent spherical set.

Here are some comments from subroutine trans3 which is contained in subroutine transform_mos in module molecular_orbitals:

    !(1) GAMESS(US) writes out coefficients of MOs of spherical GTOs not as they
    !stand infront of the components of spherical GTOs (which would be logical),
    !but as they stand in front of Cartesian GTOs. So we get 6 coefficients for
    !a d-function, 7 for an f, etc. 
    ! 
    !(2) The order of the Cartesian functions is the
    !same as that in CamCASP. See module basis_trans_mats. This is not
    !surprising as we use the GAMINT interal module for our integrals. This
    !module is the same as that used by GAMESS(US) - apart from modifications
    !made by Wojtek. 
    !
    !We can take care of points (1) and (2) by defining the transformation
    !matrices as the Cartesian to spherical transformation matrices.
    !This choice was made above by the call to 
    !  subroutine init_basis_trans_mats(2)
    !
    !(3) But the normalization of the Cartesian GTOs does not seem to be anything
    !I have encountered before. The following factors need to be included in the
    !transformation matrices:
    !  (3a) All coefficients in front of x^i y^j z^k get
    !  multiplied by sqrt[(2i-1)!!(2j-1)!!(2k-1)!!]
    !  (3a) All coefficients in front of x^i y^j z^k get
    !  multiplied by sqrt[(2i-1)!!(2j-1)!!(2k-1)!!]
    !  (3b) The term x^i in (3a) gets multiplied by
    !       1    i=0
    !       1    i=1
    !       2/3  i=2
    !       2/5  i=3
    !       8/35 i=4
    !  With similar multipliers for y^j and z^k.
    !  I.e., xxy gets a multiplier of  (2/3)*1 = 2/3
    !  and   xxx gets a multiplied of (2/5)
    !  and   xxyy gets (2/3)*(2/3) = 4/9

And here's how this is implemented (part of subroutine trans3 follows):

use basis_trans_mats, only : BT0, BT1, BT2, BT3, BT4
...
    real(dp), dimension(0:4) :: gmsfac = (/                           &
        1.0_dp, 1.0_dp, 2.0_dp/3.0_dp, 2.0_dp/5.0_dp, 8.0_dp/35.0_dp  &
                                          /)
...
    select case(l)
    case(0)
      transmat(1:ncomp_trans,1:ncomp) = (BT0)
    case(1)
      transmat(1:ncomp_trans,1:ncomp) = (BT1)
    case(2)
      transmat(1:ncomp_trans,1:ncomp) = (BT2)
    case(3)
      transmat(1:ncomp_trans,1:ncomp) = (BT3)
    case(4)
      transmat(1:ncomp_trans,1:ncomp) = (BT4)
    case default
      print *,'INTERNAL ERROR in ',trim(this_routine)
      print *,'Illegal value of l received is ',l
      info = -1
      return
    end select
    !
    !Get Cartesian symmetry components (force GAMINT ordering):
    call map_symm_to_powers(l,i,j,k,order=par_order_symm_comp)
    do m = 1, ncomp
      fac = dfactorial(2*i(m)-1)*dfactorial(2*j(m)-1)*dfactorial(2*k(m)-1)
      fac = sqrt(fac)*gmsfac(i(m))*gmsfac(j(m))*gmsfac(k(m))
      ! transmat(i,m) = t(i,m) fac(m)
      transmat(1:ncomp_trans,m) = transmat(1:ncomp_trans,m) * fac
    enddo
    !

The effect of this subroutine is best seen with an example. Consider a basis of a single Spherical d-function. GAMESS(US) will supply MO coefficients as

       MO1    MO2    MO3   MO4  MO5
xx    C(1,1) C(2,1) C(1,3) ...  ... 
yy    C(2,1) C(2,2) ...    ...  ...
zz    ...
xy    ...
xz    ...
yz    ...                      C(6,5)

Ie., we get a 6 x 5 matrix C of MO coefficient. There are only 5 MOs, but 6 coefficients for each. What we need to do is determine a transformation matrix that transforms each of the sets of 6 coefficients into a set containing only 5, which would then stand in front of the fully normalized spherical GTOs used by CamCASP. To do this we use subroutine trans3 to define the matrix in the following manner.

First define the usual sort of Cartesian to Spherical transformation matrix



The interface code in $CAMCASP/interfaces/gamessus/ is based on the gamsintf.F code from SAPT2006, but has been heavily modified. It's infinitely better!

Examples

User-defined basis sets with ghost-functions

 $CONTRL SCFTYP=RHF RUNTYP=ENERGY COORD=UNIQUE
         UNITS=BOHR NPRINT=-5 NOSYM=1 INTTYP=HONDO
         ISPHER=1 ITOL=26 ICUT=24 $END
 $SYSTEM MEMORY=220000 $END
 $GUESS  GUESS=HCORE $END
 $DATA
Ar in ArHF 86 functions, acpVDZ basis: monomer A, DCBS
C1
Ar        18.0    0.0         0.0      5.0
     S  7 1.0
     1  6928373.0   0.000002
     2  1037230.0   0.000015
     3  236034.70   0.000078
     4  66858.440   0.000329
     5  21813.690   0.001197
     6  7875.9300   0.003898
     7  3072.2630   0.011563
     S 10 1.0
     1  1274.5120   0.031361
     2  555.99500   0.076762
     3  252.80110   0.163303
     4  118.90690   0.280177
     5  57.450650   0.333084
     6  28.090080   0.208711
     7  13.097940   0.040730
     8  6.5044220  -0.000735
     9  3.2532260   0.001640
    10  1.6151790  -0.000616
...
...
     D  1 1.0
     1  0.840       1.0
     D  1 1.0
     1  0.174       1.0
     F  1 1.0
     1  0.23        1.0

H          0.0    0.0         1.645511268   0.0
     S 10 1.0
     1  6909.251    0.00001
     2  1034.623    0.00006
     3  235.4512    0.00033
     4  66.68922    0.00138
     5  21.75548    0.00500
     6  7.853013    0.01608
     7  3.062057    0.04618
     8  1.269367    0.11624
     9  0.553063    0.24107
    10  0.250866    0.35925
     S  1 1.0
     1  0.117111    1.0
     S  1 1.0
     1  0.054654    1.0
     P  1 1.0
     1  0.392       1.0
     P  1 1.0
     1  0.142       1.0
     D  1 1.0
     1  0.226       1.0

F          0.0    0.0       -0.087288732   0.0
     S  6 1.0
     1  72075.71    0.000060
     2  20416.83    0.000251
     3  6661.458    0.000916
     4  2405.188    0.002987
     5  938.2595    0.008882
     6  389.2710    0.024232
...
...
     D  2 1.0
     1  2.9532      0.18353
     2  0.9186      0.51058
     D  2 1.0
     1  0.2668      0.69925
     2  0.0775      0.42926
     F  1 1.0
     1  0.275       1.0

 $END
 $SCF NCONV=9 $END
 $INTGRL NOPK=1 NINTMX=2048 $END
 $MOROKM MOROKM=.FALSE. $END

The '1.0's in the angular momenta lines does not seem to be needed.