Difference between revisions of "CamCASP/Programming/1"

From CUC3
Jump to navigation Jump to search
import>Am592
import>Am592
Line 2: Line 2:
   
 
== 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.
  +
  +
First, some 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} C_{lm;ijk}
  +
\sqrt{
  +
\frac{(2i-1)!!(2j-1)!!(2k-1)!!}{(2l-1)!!}
  +
}
  +
\times \left( \frac{2\alpha}{\pi}\right)^{3/4} \sqrt{(4\alpha)^l}
  +
\times G^G_{ijk}(r,\alpha,A)
  +
</math>
  +
  +
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'''
  +
# 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_denorm_contractions'''. 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.
  +
  +
# 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.

Revision as of 17:32, 3 November 2008

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.

First, some 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} C_{lm;ijk}

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

</math>

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_denorm_contractions. 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.