CamCASP/Programming/1

From CUC3
Revision as of 14:44, 16 April 2009 by import>Am592 (→‎norm_contraction_coeffs)
Jump to navigation Jump to search

CamCASP => Programming => Basis functions

Basis Functions

When interfacing with a program (DALTON, CADPAC, etc.), we need to know the normalization and the order of the symmetry components used for Cartesian and spherical GTOs. Additionally, CamCASP has its own convention for the basis functions. These conventions are described in this article.

Basics

  • Fully normalized Cartesian GTOs

<math> G_{ijk}(r,\alpha,A) = \left( \frac{2\alpha}{\pi}\right)^{3/4}

    \sqrt{
       \frac{(4\alpha)^l}{(2i-1)!!(2j-1)!!(2k-1)!!}
          }
    x_A^i y_A^j z_A^k e^{-\alpha r_A^2}

</math>

where <math>l = i+j+k</math> and <math>r_A = r - A</math>.

  • Fully normalized spherical GTOs

<math> G_{lm}(r,\alpha,A) = \left( \frac{2\alpha}{\pi}\right)^{3/4}

    \sqrt{
       \frac{(4\alpha)^l}{(2l-1)!!}
          }
    S_{lm}(r_A) e^{-\alpha r_A^2}

</math>

where <math>S_{lm}</math> are the real spherical harmonics (see Anthony's book). These can be written in terms of the Cartesian triplets as

<math> S_{lm}(r_A) = \sum_{ijk} C_{lm;ijk} x_A^i y_A^j z_A^k </math>

Therefore, we see that the relation between the two forms of the GTOs is

<math> G_{lm}(r,\alpha,A) = \sum_{ijk} C_{lm;ijk}

 \sqrt{
    \frac{(2i-1)!!(2j-1)!!(2k-1)!!}{(2l-1)!!}
       }
  \times G_{ijk}(r,\alpha,A)

</math>

So, once the <math>C_{lm;ijk}</math> are known, we can easily convert between the two forms. NOTE: the order of the symmetry components within each symmetry (<math>l</math> value) is contained in this matrix.

The only problem is that SCF programs use various normalization and orders of the symmetry components, so the above transformation does not usually hold. Let's have a look at the normalization issue first.

DALTON

DALTON uses Cartesian GTOs of the form

<math> G^D_{ijk}(r,\alpha,A) = \left( \frac{2\alpha}{\pi}\right)^{3/4}

    \sqrt{(4\alpha)^l}
    x_A^i y_A^j z_A^k e^{-\alpha r_A^2}

</math>

But it uses spherical GTOs as defined above. So the transformation between the two is given by

<math> G_{lm}(r,\alpha,A) = \sum_{ijk} C_{lm;ijk}

 \sqrt{
    \frac{1}{(2l-1)!!}
       }
  \times G^D_{ijk}(r,\alpha,A)

</math>

GAMINT

This is the GAMESS(US) integral routine that we use to calculate 2-electron 2 to 4-index coulomb integrals using Cartesian GTOs. This code assumes the Cartesian GTOs are of the form

<math> G^G_{ijk}(r,\alpha,A) =

    \sqrt{
       \frac{(2l-1)!!}{(2i-1)!!(2j-1)!!(2k-1)!!}
          }
    x_A^i y_A^j z_A^k e^{-\alpha r_A^2}

</math>

Therefore the transformation from these to spherical GTOs is given by

<math> G_{lm}(r,\alpha,A) = \sum_{ijk} \frac{C_{lm;ijk}}{\sqrt{(2l-1)!!}}

 \sqrt{(2i-1)!!(2j-1)!!(2k-1)!!}
 \times \left( \frac{2\alpha}{\pi}\right)^{3/4}
    \sqrt{
       \frac{(4\alpha)^l}{(2l-1)!!}
         }
 \times G^G_{ijk}(r,\alpha,A)

</math>

The first term defines the Cartesian to Spherical transformation matrices (we haven't yet discussed the order). These are defined in module basis_trans_mats. The second term is needed to remove the extra (double) factorials included by GAMINT. This is taken into account by subroutines norm_integral1. norm_integral2 and calculate_factorial_factors all in module gamint_frontend. And the last term is included in the contraction coefficients by subroutine norm_denorm_contractions which is also in module gamint_frontend.

And to transform the Cartesian GTOs into the form used by DALTON we need to use the transformation

<math> G^D_{ijk}(r,\alpha,A) = \left( \frac{2\alpha}{\pi}\right)^{3/4}

    \sqrt{
       \frac{(4\alpha)^l}{(2l-1)!!}
         }
    \times \sqrt{(2i-1)!!(2j-1)!!(2k-1)!!}
    \times G^G_{ijk}(r,\alpha,A)

</math>

Remember, we haven't talked about the order of the symmetry components yet. These are different in DALTON and GAMINT. More on this later.


GAUSSINT

This integral code is from the geminal program Robert Bukowski was co-author of. It is slow, but useful as it can calculate a number of integrals. GAUSSINT uses Cartesian GTOs that are completely unnormalized. So all you need to do is include the required normalization factor and you are set. Also, you have to supply the order of the symmetry components to GAUSSINT. More on this later.


CamCASP

This is the important one. CamCASP uses GAMINT to calculate the integrals (GAUSSINT doesn't matter as it is flexible). We have an internal and external normalization and ordering: The SCF code determines the external choice. This is fixed. All molecular orbital coefficients are obtained from the SCF code, and these will assume GTOs of a certain symmetry, normalization and symmetry order. We could transform these MOs into an internal order, but this is still not possible as we use some integrals (those needed for the LRDFT calculations) from the SCF (DALTON or CADPAC) code and that means we must have the MOs consistent with these integrals. That leaves us to choose the internal order.

CamCASP uses density-fitting everywhere. Consequently, the only basis functions used internally (at least, at present) are the auxiliary basis functions. The internal order/normalization applies to these basis functions.

CamCASP internal basis functions

  1. Cartesian GTOs

Fully normalized with the GAMINT ordering. This is the natural choice. Since GAMINT calculates integrals assuming Cartesian GTOs that are not fully normalized, we must perform the transformation:

<math> G^C_{ijk}(r,\alpha,A) = \left( \frac{2\alpha}{\pi}\right)^{3/4}

    \sqrt{
       \frac{(4\alpha)^l}{(2l-1)!!}
         }
    \times G^G_{ijk}(r,\alpha,A)

</math>

Rather than multiply each integral by such a factor, the multplicative factor, which is a constant for each component in a symmetry, is absorbed in the contraction coefficients of the auxiliary basis set (a similar thing is done for the main basis set). This is done using subroutine norm_contraction_coeffs. This subroutine also normalized the contraction blocks. See the notes in the code for details. Contrary to its name, the contraction blocks cannot be denormalized. Obviously!

When integrals are calculated using GAUSSINT, we need to tell GAUSSINT the order of the symmetry components (GAMINT ordering) and set the correct normalization (fully normalized). The order is set by subroutine may_symm_to_powers using order=0 which is the default. The normalization is calculated using subroutine norm_gamint. See examples in integrals.f90 for usage.

  1. Spherical GTOs

Fully normalized spherical GTOs in the DALTON order. This too is quite natural as we have the GAMINT-DALTON transformation matrices in the code. This transformation has been described in the GAMINT section above.


Subroutines

Normalization is handled by a few subroutines:

Subroutine norm_contraction_coeffs

This subroutine is called as soon as the basis is read (in the molecule_parser in molecule_operations.F90). It does two things:

  • Include the normalization for the spherical GTOs in the contraction coefficients.
  • Normalize the contraction blocks.

Inclusion of normalization of spherical GTOs

Include the normalization coefficients of spherical GTOs in the contraction coefficients by defining the new contraction coefficients of each symmetry <math>l</math> to be

<math> C'_l = \left( \frac{2\alpha}{\pi}\right)^{3/4}

    \sqrt{
       \frac{(4\alpha)^l}{(2l-1)!!}
         }
    \times C_l

</math>

What this means now is that any integrals using spherical GTOs will need to be calculated using spherical GTOs defined as

<math> G_{lm}(r,\alpha,A) = S_{lm}(r_A) e^{-\alpha r_A^2}. </math>

It's a little more tricky with Cartesian GTOs because different codes seem to use different normalizations for these.

Normalization of the contraction blocks

If we have a basis function defined as a contraction: <math> Q = \sum_m C_m p_m </math> where <math>p_m</math> is a primitive GTO and <math>C_m</math> are the contraction coefficients, and the norm of this contraction is <math>k = <Q|Q></math>, then defined the contraction coefficients of the normalized contraction blocks as <math>

 C'_m = C_m / \sqrt(k).

</math>