Documentation

This documentation is outdated and valid for 1.x versions. The documentation of the 2.x branch is on a to-do list...

Table of contents


Compilation

The source code tarball contains five files of not-a-piece-of-art programming,

krun_def.f90  : parameters etc.
comp_prof.f90 : subroutines for plotting completeness-profiles
                of one-particle basis sets (cf. D.P. Chong, Can.
                J. Chem 1995).
bas_opt.f90   : routines for basis-set parameter optimisation 
                (primitives) with respect to basis set completeness 
		(instead of e.g. SCF energy)
cont_opt.f90  : routines for (completeness-)optimisation of contraction 
                coefficients of a given primitive set
parser.f90    : the interface 

There should be a makefile in the package, check compiler, compiler flags as well as the LAPACK library path and type

make ser
. It will compile with (to my knowledge) any Fortran 90/95 compiler, and almost as harsh optimization as possible may be enabled. Just insert those to "Makefile".

(In Makefile, architechture-spesific tuning is meant to include in line "ARCH", the performance optimization in "FAST" and the rest in "EXTRA" - these, however, are all just bundled together in the compliation and you may as well just put all the flags in any of these).
Tips:

If you have a multi-processor machine, you may try to have an auto-parallelized version by

make par
or an OpenMP-parallelized version by typing
make omp
. The latter is recommended. If you want to debug the software, a compilation with
make deb
will provide the flags for debugger.
make clean
removes object files. You need to add the compliler-spesific OpenMP and autoparallelisation flags to Makefile. However, no performace gain has been observed when these are tried in a single-core processor with threads (such as Pentium IV with OMP_NUM_THREADS variable set to e.g. 2).

Plotting the completeness profiles

Providing that nothing screws up in the compilation, you should see a parser, something like this:

manninen@vegan:~/projektit/kruununhaka/softa/1.1> ./krunaser.exe
=============================================
       KRUUNUNHAKA basis set tool kit
=============================================
 Helsinki molecular quantum mechanics group
 pekka.manninen@helsinki.fi
---------------------------------------------
---------------------------------------------
      Main menu
---------------------------------------------
  1   Completeness-profile plotting
  2   Completeness-optimized basis set
      generation
  q   Quit
---------------------------------------------
>

You can examine your basis sets completeness [1]:

> 1
---------------------------------------------
      Completeness-profile plotting menu
---------------------------------------------
  1   Read in a basis set file
  2   Adjust scanning range
  3   View the basis set
  4   Calculate the completeness-profile
  q   Quit
---------------------------------------------
(filename not set) in [ 0.100E-04, 0.100E+06]

let's plot the completeness-profile of cc-pVTZ basis set of fluorine within the exponent area [10-4,104]

[The program reads and writes basis sets in the form used by Dalton and Dirac basis set libraries; e.g. for fluorine we have

$ S-TYPE FUNCTIONS
   10    4    0
  19500.0000000  0.00050700 -0.00011700  0.00000000  0.00000000
   2923.0000000  0.00392300 -0.00091200  0.00000000  0.00000000
    664.5000000  0.02020000 -0.00471700  0.00000000  0.00000000
    187.5000000  0.07901000 -0.01908600  0.00000000  0.00000000
     60.6200000  0.23043900 -0.05965500  0.00000000  0.00000000
     21.4200000  0.43287200 -0.14001000  0.00000000  0.00000000
      7.9500000  0.34996400 -0.17678200  0.00000000  0.00000000
      2.2570000  0.04323300  0.17162500  1.00000000  0.00000000
      0.8815000 -0.00789200  0.60504300  0.00000000  0.00000000
      0.3041000  0.00238400  0.36951200  0.00000000  1.00000000
$ P-TYPE FUNCTIONS
    5    3    0
     43.8800000  0.01666500  0.00000000  0.00000000
      9.9260000  0.10447200  0.00000000  0.00000000
      2.9300000  0.31726000  0.00000000  0.00000000
      0.9132000  0.48734300  1.00000000  0.00000000
      0.2672000  0.33460400  0.00000000  1.00000000
$ D-TYPE FUNCTIONS
    2    2    0
      3.1070000  1.00000000  0.00000000
      0.8550000  0.00000000  1.00000000
$ F-TYPE FUNCTIONS
    1    1    0
      1.9170000  1.00000000
where the lines beginning with "$" are essential, not just only comments. The first integer is the number of primitives, the second the number of contracted functions and the meaning of the third one unknown to me :-) In the first column are the exponents and the other columns contain the contraction coefficients.]

> 1
Filename?
> F_cc-pVTZ

...

> 2
Lower limit of the scanning area?
> 1.d-4
Upper limit of the scanning area?
> 1.d+4

---------------------------------------------
      Completeness-profile plotting menu
---------------------------------------------
  1   Read in a basis set file
  2   Adjust scanning range
  3   View the basis set
  4   Calculate the completeness-profile
  q   Quit
---------------------------------------------
F_cc-pVTZ in [ 0.100E-03, 0.100E+05]

And now the profile:

> 4
File, where the profile will be written to?
>  prof_cc-pVTZ_F
s-space completeness 0.41276
p-space completeness 0.27701
d-space completeness 0.18055
f-space completeness 0.09327
The completeness-profile has been written into a file prof_cc-pVTZ_F

The numbers reflect the completeness ([0,1]) of the basis set in the previously entered exponent range.

When back in a normal Unix shell, you may illustrate the profile using gnuplot; e.g. the following gnuplot script could perhaps do:

set term postscript eps enhanced mono "Times-Roman" 18
set output "F_cc-pVTZ.eps"
set autoscale
set size 0.75,0.5
set yrange [0.0:1.05]
set ylabel "Y({/Symbol a})"
set xlabel "Log({/Symbol a})"
set style data lines
plot "prof_cc-pVTZ_F" u 1:2 lw 2 lt 1 title "{/Italic s}", \
     "prof_cc-pVTZ_F" u 1:3 lw 2 lt 2 title "{/Italic p}", \
     "prof_cc-pVTZ_F" u 1:4 lw 2 lt 3 title "{/Italic d}", \
     "prof_cc-pVTZ_F" u 1:5 lw 2 lt 4 title "{/Italic f}"

In the end, you should obtain an image something like this:
[Completeness profile]

Completeness-optimized basis sets

Assume that we would like to generate a basis set that covers an exponent interval within a pre-determined allowed deviance from it [2].

> 2
--------------------------------------------
      Completeness-optimization menu
--------------------------------------------
  1   Adjust parameters
  2   Create a completeness-optimized set
      of S-type functions
      within [ 0.100E-01, 0.100E+03]
  3   Contract an existing exponent set
  q   Quit
--------------------------------------------

> 1
Angular momentum type (s, p, d,...)?
> s
Lower limit of the exponent area?
> 1.D-2
Upper limit of the exponent area?
> 1.d+4
--------------------------------------------
      Completeness-optimization menu
--------------------------------------------
  1   Adjust parameters
  2   Create a completeness-optimized set
      of S-type functions
      within [ 0.100E-01, 0.100E+05]
  3   Contract an existing exponent set
  q   Quit
--------------------------------------------

>

Is a situation from which we start to optimize a set of s-type primitives that constitute a complete basis set within an exponent range of [10-2,104].

> 2
File, where the optimized set will be written to?
> test_S
Number of functions as the first guess?
> 4
Optimizing a set of  4 functions.
This may take time.

           Iteration            Tau

                   1  0.2128270E+00
                   2  0.2113963E+00
                   3  0.2113043E+00
                   4  0.2113043E+00

Deviance tau=    0.211 was obtained with
  4 functions, yielding exponents
        1633.9400604
          53.6343391
           1.7400222
           0.0571168

  1   Add more functions
  2   Reduce the number of functions
  q   Quit

If we are not happy with the obtained deviance (see Ref. [2] for discussion on its meaning and effects) we may add more primitives and restart the optimization. Alternatively, if we got a too good set for our purposes, we should of course remove functions to obtain optimally compact sets.

Note: If you aim at very high-quality basis sets, the program probably tries to remove some of your functions to avoid linear dependencies. If you insist of keeping them, you may reduce the parameter "lin_dep_thr" in krun_def.90 file to be tighter.