Libraries Description
General Information
The libraries contain routines which are independent of the rest of the package, e.g. they do not use the include linking the main programs. They thus have a special status and are kept together in the $MCTDH_DIR/source/lib directory.
When changing a library routine, try to avoid changing an interface. This could lead to unforeseen problems in a program.
The following libraries are employed by the MCTDH program:
- lapack: Contains all the LAPACK routines that MCTDH uses. This is the reference implementation from NETLIB.
- blas: Contains all the BLAS routines that MCTDH uses. Again, this is the reference implementation from NETLIB.
- la: Contains all other linear algebra calculations, such as matrix multiplication or determination of eigenvalues.
- ode: Contains all integrators, e.g. Bulirsch-Stoer and Lanczos.
- num: Contains all numerical operations (e.g. FFT, special functions, random generators, ...).
- sys: Contains routines concerning the machine and the operating system and the input of data.
Compiling the Library
The libraries are automatically compiled as required when a program is compiled. It is also possible to compile the libraries separately using the general compile script. Typing
compile libwill compile all the library archives. A single archive can also be compiled, e.g.
compile libnumwill compile the NUM library.
One useful feature of the compilation procedure is that it is possible to generate debug code for a program with optimised libraries, e.g.
compile -d quanticscompiles a debug version (quanticsd) of the QUANTICS program with optimised libraries. This is useful as the library routines need a large percentage of the computer time, and this speeds up the process of debugging. To compile a program with debug information also for the library, use the -D option.
For more details on the $MCTDH_DIR/bin/compile script, see Compiling the programs.
Contents of the Library LAPACK
This is not the complete LAPACK library, but only those selected routines from NETLIB's reference implementation which are needed by MCTDH.
- dbdsdc.f
- dbdsqr.f
- dgebak.f
- dgebal.f
- dgebd2.f
- dgebrd.f
- dgeev.f
- dgehd2.f
- dgehrd.f
- dgelq2.f
- dgelqf.f
- dgels.f
- dgeqr2.f
- dgeqrf.f
- dgesdd.f
- dgesvd.f
- dgetf2.f
- dgetrf.f
- dgetri.f
- dhseqr.f
- disnan.f
- dlabad.f
- dlabrd.f
- dlacpy.f
- dladiv.f
- dlae2.f
- dlaed6.f
- dlaev2.f
- dlaexc.f
- dlahqr.f
- dlahr2.f
- dlaisnan.f
- dlaln2.f
- dlamch.f
- dlamrg.f
- dlange.f
- dlanst.f
- dlansy.f
- dlanv2.f
- dlapy2.f
- dlapy3.f
- dlaqr0.f
- dlaqr1.f
- dlaqr2.f
- dlaqr3.f
- dlaqr4.f
- dlaqr5.f
- dlarfb.f
- dlarf.f
- dlarfg.f
- dlarft.f
- dlarfx.f
- dlartg.f
- dlas2.f
- dlascl.f
- dlasd0.f
- dlasd1.f
- dlasd2.f
- dlasd3.f
- dlasd4.f
- dlasd5.f
- dlasd6.f
- dlasd7.f
- dlasd8.f
- dlasda.f
- dlasdq.f
- dlasdt.f
- dlaset.f
- dlasq1.f
- dlasq2.f
- dlasq3.f
- dlasq4.f
- dlasq5.f
- dlasq6.f
- dlasr.f
- dlasrt.f
- dlassq.f
- dlasv2.f
- dlaswp.f
- dlasy2.f
- dlatrd.f
- dorg2l.f
- dorg2r.f
- dorgbr.f
- dorghr.f
- dorgl2.f
- dorglq.f
- dorgql.f
- dorgqr.f
- dorgtr.f
- dorm2r.f
- dormbr.f
- dormhr.f
- dorml2.f
- dormlq.f
- dormqr.f
- dpbtf2.f
- dpbtrf.f
- dpbtrs.f
- dposv.f
- dpotf2.f
- dpotrf.f
- dpotrs.f
- dsteqr.f
- dsterf.f
- dstev.f
- dsyev.f
- dsytd2.f
- dsytrd.f
- dtrevc.f
- dtrexc.f
- dtrti2.f
- dtrtri.f
- dtrtrs.f
- dzsum1.f
- ieeeck.f
- iladlc.f
- iladlr.f
- ilaenv.f
- ilazlc.f
- ilazlr.f
- iparmq.f
- izmax1.f
- LICENSE
- lsame.f
- README
- xerbla.f
- zbdsqr.f
- zdrscl.f
- zgbtf2.f
- zgbtrf.f
- zgbtrs.f
- zgebak.f
- zgebal.f
- zgebd2.f
- zgebrd.f
- zgeev.f
- zgehd2.f
- zgehrd.f
- zgelq2.f
- zgelqf.f
- zgeqr2.f
- zgeqrf.f
- zgesvd.f
- zgesv.f
- zgetf2.f
- zgetrf.f
- zgetri.f
- zgetrs.f
- zheev.f
- zhesv.f
- zhetd2.f
- zhetf2.f
- zhetrd.f
- zhetrf.f
- zhetrs2.f
- zhetrs.f
- zhseqr.f
- zlabrd.f
- zlacgv.f
- zlacn2.f
- zlacpy.f
- zladiv.f
- zlahef.f
- zlahqr.f
- zlahr2.f
- zlahrd.f
- zlange.f
- zlanhe.f
- zlanhs.f
- zlaqhe.f
- zlaqr0.f
- zlaqr1.f
- zlaqr2.f
- zlaqr3.f
- zlaqr4.f
- zlaqr5.f
- zlarfb.f
- zlarf.f
- zlarfg.f
- zlarft.f
- zlarfx.f
- zlartg.f
- zlascl.f
- zlaset.f
- zlasr.f
- zlassq.f
- zlaswp.f
- zlatrd.f
- zlatrs.f
- zlauu2.f
- zlauum.f
- zpocon.f
- zpoequ.f
- zporfs.f
- zposv.f
- zposvx.f
- zpotf2.f
- zpotrf.f
- zpotri.f
- zpotrs.f
- zrot.f
- zsteqr.f
- zsyconv.f
- zsysv.f
- ztrevc.f
- ztrexc.f
- ztrti2.f
- ztrtri.f
- zung2l.f
- zung2r.f
- zungbr.f
- zunghr.f
- zungl2.f
- zunglq.f
- zungql.f
- zungqr.f
- zungtr.f
- zunm2r.f
- zunmbr.f
- zunmhr.f
- zunml2.f
- zunmlq.f
- zunmqr.f
Contents of the Library BLAS
Like above, this is not the complete BLAS library, but only those selected routines from NETLIB's reference implementation which are needed by MCTDH.
- daxpy.f
- dcabs1.f
- dcopy.f
- ddot.f
- dgemm.f
- dgemv.f
- dger.f
- dnrm2.f
- drot.f
- dscal.f
- dswap.f
- dsymm.f
- dsymv.f
- dsyr2.f
- dsyr2k.f
- dsyr.f
- dsyrk.f
- dtbsv.f
- dtrmm.f
- dtrmv.f
- dtrsm.f
- dtrsv.f
- dzasum.f
- dznrm2.f
- idamax.f
- izamax.f
- LICENSE
- zaxpy.f
- zcopy.f
- zdotc.f
- zdotu.f
- zdrot.f
- zdscal.f
- zgemm.f
- zgemv.f
- zgerc.f
- zgeru.f
- zhemm.f
- zhemv.f
- zher2.f
- zher2k.f
- zher.f
- zherk.f
- zscal.f
- zswap.f
- ztbsv.f
- ztrmm.f
- ztrmv.f
- ztrsm.f
- ztrsv.f
Contents of the Library LA
The library la
contains routines for linear algebra
calculations. The code is contained in various files:
- eigchess.f: Routine to obtain eigenvalues and -vectors of a complex upper Hessenberg matrix.
- eigcs.f: Routine to obtain eigenvalues and -vectors of a complex symmetric matrix.
- lanczos.f: Lanczos diagonalisation routine.
- svd.f: Routines for performing a singular value decomposition.
- svdz.f: Routines for performing a singular value decomposition of complex symmetric matrices.
- lineq_cg.f: Conjugate Gradient interative algorithm to solve systems of linear equation.
- mmlib.f: Matrix*Matrix routines.
- mtlib.f: Matrix*Tensor routines.
- op1lib.f: Routines operating on one object.
- op2lib.f: Routines operating on two objects of the same type.
- rmlib.f: Routines to form "density" matrices.
- schmidtortho.f: Routines for orthogonalising orbitals.
- ttlib.f: Routines involving multiplication of two tensors of third order.
- xvlib.f: Routines involving scalars and vectors.
- d1tens.f: Additional subroutines for matrices and tensors.
- d2tens.f: Additional subroutines for matrices and tensors.
- lalib.f: Other routines.
Contents of the Library ODE
The library ode
contains various integrators for
ordinary differential equations. The following files and routines
exist:
- abmlib.f: Adams-Bashforth-Moulton predictor-corrector integrator.
- bslib.f: Bulirsch-Stoer extrapolation method.
- sodlib.f: Second order differencing scheme.
- sillib.f: Short iterative Lanczos algorithm.
- csillib.f: Lanczos-Arnoldi (complex Lanczos) integrator.
- odedp5.f: Runge-Kutta integrator of order 5.
- oded85.f: Runge-Kutta integrator of order 8.
- odeuti.f: Various utility routines for the Runge-Kutta integrators.
Contents of the Library NUM
The library num
contains routines for various
numerical operations. The following files and routines exist:
- cmdvr.f: Calculates Hamiltonian matrix in Colbert/Miller DVR basis. (see J. Chem. Phys. 96, 1982 (1992) for more details) Kinetic energy elements are that of Eqs. A6 of Appendix A.
- fft.f: Calculates the FFT-transform of a complex tensor of third order in the middle index. No normalisation is done.
- legendre.f: Legendre and associated Legendre functions, spherical harmonics.
- numeric.f: Various numerical routines.
- splinenm.f: Routines to compute cubic-splines for an array of data and to evaluate the spline.
randommod.f90: Routines dealing with pseudo-random numbers. Current implementation uses random generators provided by the fortran library.
Different compilers implement different random number generators, including different number of seeds. Expect differences with different compilers.In order to create some abstraction from the random generator implementation, the library provides wrapper functions that should be used in the code:
randuniform()
for uniform random numbers; andrandgaussian
for normal distributed random numbers. If a different random number is chosen in the future, the use of this functions should allow for a change with minimum pain. A seamless treatment of seeds is not yet implemented.Other specific random generators are included in the library.
sobseq
generates a Sobol sequence of random numbers. This sequence has the property of being smoothly distributed in the interval from 0 to 1, and convenient for Monte Carlo integration schemes. The very simple random generatordrandom
is included because it is used in some parts ofVCHam
, but its use should be deprecated.
Contents of the Library SYS
The library sys
contains routines concerning the
machine and the operating system. The following files and routines
exist:
- einglib.f: Contains routines to control the input of data.
- keyunits.f: Contains routines for converting units.
- myflush.f: Contains a self-written routine for enforcing a file buffer to be written to disk.
- myflush_lib.f: Calls the flush routine provided by some compilers.
- myflush_no.f: Contains a routine that ignores the flush-command.
- showtime.c: Contains routines to determine the system time, host name, etc.
- strutil.f: Contains routines for processing character strings.
- syslib.f: Contains various routines, e. g. for determining the machine precision.
- dvrweights.f: Routine for computing the DVR weights.
- platform.F: Contains various wrappers for platform-dependent routines.
- fileutil.f: Contains utility routines for common file operations.