libqt: The Quantum-Trio Miscellaneous Library


Files

file  3d_array.cc
 Routines for 3d arrays.
file  blas_intfc.cc
 The PSI3 BLAS interface routines.
file  cc_excited.cc
 Determine if a wavefunction is a CC-excited wavefunction type.
file  cc_wfn.cc
 Check if wavefunction is coupled-cluster type.
file  ci_wfn.cc
 Check if wavefunction is CI-type.
file  david.cc
 In-core Davidson-Liu diagonalization of symm matrices.
file  dirprd_block.cc
 Take a direct product of two matrices.
file  dot_block.cc
 Take dot product of two block matrices.
file  libqt/eri.cc
 Inefficient electron repulsion integral evaluation By Edward Valeev.
file  fill_sym_matrix.cc
 Fill a symmetric matrix from a lower triangle.
file  filter.cc
 Filter out unneeded frozen core/virt integrals.
file  get_frzpi.cc
 Get frozen core/virtuals per irrep.
file  invert.cc
 Invert a small matrix.
file  lapack_intfc.cc
 Interface to LAPACK routines

Rollin A. King and T. Daniel Crawford August 2001 - January 2002.

file  mat_in.cc
 read in a matrix from an input stream (deprecated)
file  mat_print.cc
 Print a matrix to a file in a formatted style.
file  newmm_rking.cc
 Matrix multiplication routine (deprecated).
file  normalize.cc
 Normalize a set of vectors.
file  orient_fragment.cc
 function which places one fragment into the coordinate system of another
file  pople.cc
 Pople's method for solving linear equations.
file  probabil.cc
 Contains some probability functions.
file  qt.h
 Header file for the Quantum Trio Library

David Sherrill 1994.

file  ras_set.cc
 Obtain orbital space and reordering for CI/MCSCF wavefunctions.
file  reorder_qt.cc
 Obtain the QT orbital reordering array between Pitzer and correlated order.
file  rootfind.cc
 Simple root finding methods

(1) Bisection method (2) Newton's method (3) Secant method.

file  schmidt.cc
 Gram-Schmidt orthogonalize a set of vectors.
file  lib/libqt/schmidt_add.cc
 Gram-Schmidt orthogonalize vector and add to set.
file  slaterdset.cc
 Utility functions for importing/exporting sets of Slater determinants from the CI codes

Edward Valeev, June 2002.

file  slaterdset.h
 Header file for SlaterDetSets

Edward Valeev, June 2002.

file  solve_pep.cc
 Solve a 2x2 pseudo-eigenvalue problem.
file  lib/libqt/sort.cc
 Sort eigenvalues and eigenvectors into ascending order.
file  strncpy.cc
 Override strncpy to ensure strings are terminated

By Edward Valeev.

file  timer.cc
 Obtain user and system timings for blocks of code

TIMER.CC: These functions allow one to obtain user and system timings for arbitrary blocks of code. If a code block is called repeatedly during the course of program execution, the timer functions will report the block's cumulative execution time and the number of calls. In addition, one may time multiple code blocks simultaneously, and even ``overlap'' timers. Timing data is written to the file "timer.dat" at the end of timer execution, i.e., when timer_done() is called.

file  v_3.cc
 simple functions for 3-vectors
file  zmat_point.cc
 xyz coordinates for three points and R, theta, and phi, returns the coordinates a fourth point; angles should enter function in degrees

Namespaces

namespace  psi
 Rotate a set of vectors around an arbitrary axis Vectors are rows of input matrix.

Functions

double *** psi::init_3d_array (int p, int q, int r)
void psi::free_3d_array (double ***A, int p, int q)
void psi::C_DAXPY (int length, double a, double *x, int inc_x, double *y, int inc_y)
void psi::C_DCOPY (int length, double *x, int inc_x, double *y, int inc_y)
void psi::C_DSCAL (int length, double alpha, double *vec, int inc)
void psi::C_DROT (int length, double *x, int inc_x, double *y, int inc_y, double costheta, double sintheta)
void psi::C_DGEMM (char transa, char transb, int m, int n, int k, double alpha, double *A, int nca, double *B, int ncb, double beta, double *C, int ncc)
void psi::C_DGEMV (char transa, int m, int n, double alpha, double *A, int nca, double *X, int inc_x, double beta, double *Y, int inc_y)
void psi::C_DSPMV (char uplo, int n, double alpha, double *A, double *X, int inc_x, double beta, double *Y, int inc_y)
double psi::C_DDOT (int n, double *x, int inc_x, double *y, int inc_y)
int psi::cc_excited (char *wfn)
int psi::cc_excited (std::string wfn)
int psi::cc_wfn (char *wfn)
int psi::cc_wfn (std::string wfn)
int psi::ci_wfn (char *wfn)
int psi::ci_wfn (std::string wfn)
int psi::david (double **A, int N, int M, double *eps, double **v, double cutoff, int print)
void psi::dirprd_block (double **A, double **B, int rows, int cols)
double psi::dot_block (double **A, double **B, int rows, int cols, double alpha)
double psi::eri (unsigned int l1, unsigned int m1, unsigned int n1, double alpha1, double A[3], unsigned int l2, unsigned int m2, unsigned int n2, double alpha2, double B[3], unsigned int l3, unsigned int m3, unsigned int n3, double alpha3, double C[3], unsigned int l4, unsigned int m4, unsigned int n4, double alpha4, double D[3], int norm_flag)
double psi::norm_const (unsigned int l1, unsigned int m1, unsigned int n1, double alpha1, double A[3])
void psi::fill_sym_matrix (double **A, int size)
void psi::filter (double *input, double *output, int *ioff, int norbs, int nfzc, int nfzv)
int * psi::get_frzcpi ()
int * psi::get_frzvpi ()
double psi::invert_matrix (double **a, double **y, int N, FILE *outfile)
int psi::C_DGEEV (int n, double **a, int lda, double *wr, double *wi, double **vl, int ldvl, double **vr, int ldvr, double *work, int lwork, int info)
int psi::C_DGESV (int n, int nrhs, double *a, int lda, int *ipiv, double *b, int ldb)
int psi::C_DGETRF (int nrow, int ncol, double *a, int lda, int *ipiv)
int psi::C_DGETRI (int n, double *a, int lda, int *ipiv, double *work, int lwork)
int psi::C_DGESVD (char jobu, char jobvt, int m, int n, double *A, int lda, double *s, double *u, int ldu, double *vt, int ldvt, double *work, int lwork)
int psi::C_DSYEV (char jobz, char uplo, int n, double *A, int lda, double *w, double *work, int lwork)
int psi::mat_in (FILE *fp, double **array, int width, int max_length, int *stat)
int psi::mat_print (double **matrix, int rows, int cols, FILE *outfile)
void psi::normalize (double **A, int rows, int cols)
int psi::pople (double **A, double *x, int dimen, int num_vecs, double tolerance, FILE *outfile, int print_lvl)
double psi::combinations (int n, int k)
double psi::factorial (int n)
int psi::ras_set (int nirreps, int nbfso, int freeze_core, int *orbspi, int *docc, int *socc, int *frdocc, int *fruocc, int **ras_opi, int *order, int ras_type)
int psi::ras_set2 (int nirreps, int nbfso, int delete_fzdocc, int delete_restrdocc, int *orbspi, int *docc, int *socc, int *frdocc, int *fruocc, int *restrdocc, int *restruocc, int **ras_opi, int *order, int ras_type, int hoffmann)
void psi::reorder_qt (int *docc_in, int *socc_in, int *frozen_docc_in, int *frozen_uocc_in, int *order, int *orbs_per_irrep, int nirreps)
void psi::reorder_qt_uhf (int *docc, int *socc, int *frozen_docc, int *frozen_uocc, int *order_alpha, int *order_beta, int *orbspi, int nirreps)
double psi::bisect (double(*function)(double), double low, double high, double tolerance, int maxiter, int printflag)
double psi::newton (double(*F)(double), double(*dF)(double), double x, double tolerance, int maxiter, int printflag)
double psi::secant (double(*F)(double), double x0, double x1, double tolerance, int maxiter, int printflag)
void psi::schmidt (double **A, int rows, int cols, FILE *outfile)
int psi::schmidt_add (double **A, int rows, int cols, double *v)
void psi::stringset_init (StringSet *sset, int size, int nelec, int nfzc, short int *frozen_occ)
void psi::stringset_delete (StringSet *sset)
void psi::stringset_add (StringSet *sset, int index, unsigned char *Occ)
void psi::stringset_reindex (StringSet *sset, short int *mo_map)
void psi::stringset_write (ULI unit, char *prefix, StringSet *sset)
void psi::stringset_read (ULI unit, char *prefix, StringSet **stringset)
void psi::slaterdetset_init (SlaterDetSet *sdset, int size, StringSet *alphastrings, StringSet *betastrings)
void psi::slaterdetset_delete (SlaterDetSet *sdset)
void psi::slaterdetset_delete_full (SlaterDetSet *sdset)
void psi::slaterdetset_add (SlaterDetSet *sdset, int index, int alphastring, int betastring)
void psi::slaterdetset_write (ULI unit, char *prefix, SlaterDetSet *sdset)
void psi::slaterdetset_read (ULI unit, char *prefix, SlaterDetSet **slaterdetset)
void psi::slaterdetvector_init (SlaterDetVector *sdvector, SlaterDetSet *sdset)
void psi::slaterdetvector_delete (SlaterDetVector *sdvector)
void psi::slaterdetvector_delete_full (SlaterDetVector *sdvector)
void psi::slaterdetvector_add (SlaterDetVector *sdvector, int index, double coeff)
void psi::slaterdetvector_set (SlaterDetVector *sdvector, double *coeffs)
void psi::slaterdetvector_write (ULI unit, char *prefix, SlaterDetVector *vector)
void psi::slaterdetset_write_vect (ULI unit, char *prefix, double *coeffs, int size, int vectnum)
void psi::slaterdetvector_read (ULI unit, char *prefix, SlaterDetVector **sdvector)
void psi::slaterdetset_read_vect (ULI unit, char *prefix, double *coeffs, int size, int vectnum)
void psi::solve_2x2_pep (double **H, double S, double *evals, double **evecs)
void psi::sort_vector (double *A, int n)
void psi::timer_init (void)
void psi::timer_done (void)
struct timer * psi::timer_scan (const char *key)
void psi::timer_on (const char *key)
void psi::timer_off (const char *key)

Detailed Description


Function Documentation

double psi::bisect ( double(*)(double)  function,
double  low,
double  high,
double  tolerance,
int  maxiter,
int  printflag 
)

bisect(): Finds the root of a function between two points to within a given tolerance. Iterations are limited to a given maximum, and a print flag specifies whether this function should print the results of each iteration to stdout. Note that the values of the function at the two endpoints of the interval must have _different_ signs for the bisection method to work! This routine checks for this initially.

Parameters:
function = pointer to function we want to examine (must return double)
low = lower bound of interval to search for root
high = upper bound of interval
tolerance = how small is the maximum allowable error
maxiter = maximum number of iterations
printflag = whether or not to print results for each iteration (1 or 0)
Returns: the value of the root

void psi::C_DAXPY ( int  length,
double  a,
double *  x,
int  inc_x,
double *  y,
int  inc_y 
)

C_DAXPY(): This function performs y = a * x + y.

Steps every inc_x in x and every inc_y in y (normally both 1).

Parameters:
length = length of arrays
a = scalar a to multiply vector x
x = vector x
inc_x = how many places to skip to get to next element in x
y = vector y
inc_y = how many places to skip to get to next element in y
Returns:none

void psi::C_DCOPY ( int  length,
double *  x,
int  inc_x,
double *  y,
int  inc_y 
)

C_DCOPY(): This function copies x into y.

Steps every inc_x in x and every inc_y in y (normally both 1).

Parameters:
length = length of array
x = vector x
inc_x = how many places to skip to get to next element in x
y = vector y
inc_y = how many places to skip to get to next element in y
Returns: none

double psi::C_DDOT ( int  n,
double *  x,
int  inc_x,
double *  y,
int  inc_y 
)

C_DDOT(): This function returns the dot product of two vectors, x and y.

Parameters:
length = Number of elements in x and y.
x = A pointer to the beginning of the data in x. Must be of at least length (1+(N-1)*abs(inc_x).
inc_x = how many places to skip to get to next element in x
y = A pointer to the beginning of the data in y.
inc_y = how many places to skip to get to next element in y
Returns: the dot product

Interface written by ST Brown. July 2000

int psi::C_DGEEV ( int  n,
double **  a,
int  lda,
double *  wr,
double *  wi,
double **  vl,
int  ldvl,
double **  vr,
int  ldvr,
double *  work,
int  lwork,
int  info 
)

C_DGEEV()

This function computes the eigenvalues and the left and right right eigenvectors of a real, nonsymmetric matrix A. For symmetric matrices, refer to C_DSYEV().

Parameters:
n = The order of the matrix A. n >= 0.
a = The n-by-n matrix A. As with all other lapack routines, must be allocated by contiguous memory (i.e., block_matrix()).
lda = The leading dimension of matrix A. lda >= max(1,n).
wr = array of length n containing the real parts of computed eigenvalues.
wi = array of length n containing the imaginary parts of computed eigenvalues.
vl = matrix of dimensions ldvl*n. The columns store the left eigenvectors u(j). If the j-th eigenvalues is real, then u(j) = vl(:,j), the j-th column of vl. If the j-th and (j+1)-st eigenvalues form a complex conjugate pair, then u(j) = vl(:,j) + i*vl(:,j+1) and u(j+1) = vl(:,j) - i*vl(:,j+1). Note: this is the Fortran documentation, may need to change cols <-> rows.
ldvl = The leading dimension of matrix vl.
vr = matrix of dimensions ldvr*n. The columns store the right eigenvectors v(j). If the j-th eigenvalues is real, then v(j) = vr(:,j), the j-th column of vr. If the j-th and (j+1)-st eigenvalues form a complex conjugate pair, then v(j) = vr(:,j) + i*vr(:,j+1) and v(j+1) = vr(:,j) - i*vr(:,j+1). Note: this is the Fortran documentation, may need to change cols <-> rows.
ldvr = The leading dimension of matrix vr.
work = Array for scratch computations, of dimension lwork. On successful exit, work[0] returns the optimal value of lwork.
lwork = The dimension of the array work. lwork >= max(1,3*n), and if eigenvectors are required (default for this wrapper at present) then actually lwork >= 4*n. For good performance, lwork must generally be larger. If lwork = -1, then a workspace query is assumed. The routine only calculates the optimal size of the work array, returns this value ans the first entry of the work array, and no error message related to lword is issued by xerbla.
info = On output (returned by C_DGEEV), a status flag. info = 0 for successful exit, if info = -i, the ith argument had an illegal value. If info = i, the QR algorithm failed to compute all the eigenvalues, and no eigenvectors have been computed. Elements i+1:n of wr and wi contain eigenvalues which have converged.

void psi::C_DGEMM ( char  transa,
char  transb,
int  m,
int  n,
int  k,
double  alpha,
double *  A,
int  nca,
double *  B,
int  ncb,
double  beta,
double *  C,
int  ncc 
)

C_DGEMM(): This function calculates C(m,n)=alpha*(opT)A(m,k)*(opT)B(k,n)+ beta*C(m,n)

These arguments mimic their Fortran conterparts; parameters have been reversed (nca, ncb, ncc, A, B, C), to make it correct for C.

Parameters:
transa = On entry, specifies the form of (op)A used in the matrix multiplication: If transa = 'N' or 'n', (op)A = A. If transa = 'T' or 't', (op)A = transp(A). If transa = 'R' or 'r', (op)A = conjugate(A). If transa = 'C' or 'c', (op)A = conjug_transp(A). On exit, transa is unchanged.
transb = On entry, specifies the form of (op)B used in the matrix multiplication: If transb = 'N' or 'n', (op)B = B. If transb = 'T' or 't', (op)B = transp(B). If transb = 'R' or 'r', (op)B = conjugate(B)
m = On entry, the number of rows of the matrix (op)A and of the matrix C; m >= 0. On exit, m is unchanged.
n = On entry, the number of columns of the matrix (op)B and of the matrix C; n >= 0. On exit, n is unchanged.
k = On entry, the number of columns of the matrix (op)A and the number of rows of the matrix (op)B; k >= 0. On exit, k is unchanged.
alpha = On entry, specifies the scalar alpha. On exit, alpha is unchanged.
A = On entry, a two-dimensional array A with dimensions ka by nca. For (op)A = A or conjugate(A), nca >= k and the leading m by k portion of the array A contains the matrix A. For (op)A = transp(A) or conjug_transp(A), nca >= m and the leading k by m part of the array A contains the matrix A. On exit, a is unchanged.
nca = On entry, the second dimension of array A. For (op)A = A or conjugate(A), nca >= MAX(1,k). For (op)A=transp(A) or conjug_transp(A), nca >= MAX(1,m). On exit, nca is unchanged.
B = On entry, a two-dimensional array B with dimensions kb by ncb. For (op)B = B or conjugate(B), kb >= k and the leading k by n portion of the array contains the matrix B. For (op)B = transp(B) or conjug_transp(B), ncb >= k and the leading n by k part of the array contains the matrix B. On exit, B is unchanged.
ncb = On entry, the second dimension of array B. For (op)B = B or <conjugate(B), ncb >= MAX(1,n). For (op)B = transp(B) or conjug_transp(B), ncb >= MAX(1,k). On exit, ncb is unchanged.
beta = On entry, specifies the scalar beta. On exit, beta is unchanged.
C = On entry, a two-dimensional array with the dimension at least m by ncc. On exit, the leading m by n part of array C is overwritten by the matrix alpha*(op)A*(op)B + beta*C.
ncc = On entry, the second dimension of array C; ncc >=MAX(1,n). On exit, ncc is unchanged.
Returns: none

void psi::C_DGEMV ( char  transa,
int  m,
int  n,
double  alpha,
double *  A,
int  nca,
double *  X,
int  inc_x,
double  beta,
double *  Y,
int  inc_y 
)

C_DGEMV(): This function calculates the matrix-vector product.

Y = alpha * A * X + beta * Y

where X and Y are vectors, A is a matrix, and alpha and beta are constants.

Parameters:
transa = Indicates whether the matrix A should be transposed ('t') or left alone ('n').
m = The row dimension of A (regardless of transa).
n = The column dimension of A (regardless of transa).
alpha = The scalar alpha.
A = A pointer to the beginning of the data in A.
nca = The number of columns *actually* in A. This is useful if one only wishes to multiply the first n columns of A times X even though A contains nca columns.
X = A pointer to the beginning of the data in X.
inc_x = The desired stride for X. Useful for skipping sections of data to treat only one column of a complete matrix. Usually 1, though.
beta = The scalar beta.
Y = A pointer to the beginning of the data in Y.
inc_y = The desired stride for Y.
Returns: none

Interface written by TD Crawford and EF Valeev. June 1999

int psi::C_DGESV ( int  n,
int  nrhs,
double *  a,
int  lda,
int *  ipiv,
double *  b,
int  ldb 
)

C_DGESV()

This function solves a system of linear equations A * X = B, where A is an n x n matrix and X and B are n x nrhs matrices.

Parameters:
n = The number of linear equations, i.e., the order of the matrix A. n >= 0.
nrhs = The number of right hand sides, i.e., the number of columns of the matrix B. nrhs >= 0.
A = On entry, the n-by-n coefficient matrix A. On exit, the factors L and U from the factorization A = P*L*U; the unit diagonal elements of L are not stored.
lda = The leading dimension of the array A. lda >= max(1,n).

Parameters:
int ipiv = An integer array of length n. The pivot indices that define the permutation matrix P; row i of the matrix was interchanged with row ipiv(i).
B = On entry, the n-by-nrhs matrix of right hand side matrix B. On exit, if info = 0, the n-by-nrhs solution matrix X.
ldb = The leading dimension of the array B. ldb >= max(1,n).
Returns: int info. info = 0: successful exit. info < 0: if info = -i, the i-th argument had an illegal value. info > 0: if info = i, U(i,i) is exactly zero. The factorization has been completed, but the factor U is exactly singular, so the solution could not be computed.

int psi::C_DGESVD ( char  jobu,
char  jobvt,
int  m,
int  n,
double *  A,
int  lda,
double *  s,
double *  u,
int  ldu,
double *  vt,
int  ldvt,
double *  work,
int  lwork 
)

C_DGESVD() This function computes the singular value decomposition (SVD) of a real mxn matrix A, ** optionally computing the left and/or right singular vectors. The SVD is written

A = U * S * transpose(V)

where S is an mxn matrix which is zero except for its min(m,n) diagonal elements, U is an M-by-M orthogonal matrix, and V is an N-by-N orthogonal matrix. The diagonal elements of SIGMA are the singular values of A; they are real and non-negative, and are returned in descending order. The first min(m,n) columns of U and V are the left and right singular vectors of A.

Note that the routine returns V^t, not V;

These arguments mimic their Fortran counterparts. See the LAPACK manual for additional information.

Parameters:
jobu = 'A' = all m columns of U are returned 'S' = the first min(m,n) columns of U are returned 'O' = the first min(m,n) columns of U are returned in the input matrix A 'N' = no columns of U are returned
jobvt = 'A' = all n rows of VT are returned 'S' = the first min(m,n) rows of VT are returned 'O' = the first min(m,n) rows of VT are returned in the input matrix A 'N' = no rows of VT are returned
Obviously jobu and jobvt cannot both be 'O'.

Parameters:
m = The row dimension of the matrix A.
n = The column dimension of the matrix A.
A = On entry, the mxn matrix A with dimensions m by lda. On exit, if jobu='O' the first min(m,n) columns of A are overwritten with the left singular vectors; if jobvt='O' the first min(m,n) rows of A are overwritten with the right singular vectors; otherwise, the contents of A are destroyed.
lda = The number of columns allocated for A.
s = The singular values of A.
u = The right singular vectors of A, returned as column of the matrix u if jobu='A'. If jobu='N' or 'O', u is not referenced.
ldu = The number of columns allocated for u.
vt = The left singular vectors of A, returned as rows of the matrix VT is jobvt='A'. If jobvt='N' or 'O', vt is not referenced.
ldvt = The number of columns allocated for vt.
work = Workspace array of length lwork.
lwork = The length of the workspace array work, which should be at least as large as max(3*min(m,n)+max(m,n),5*min(m,n)). For good performance, lwork should generally be larger. If lwork=-1, a workspace query is assumed, and the value of work[0] upon return is the optimal size of the work array.
Return value: int info. If info=0, successful exit. If info = -i, the i-th argument had an illegal value. If info > 0, Related to failure in the convergence of the upper bidiagonal matrix B. See the LAPACK manual for additiona information.

Interface written by TDC, July 2001, updated April 2004

int psi::C_DGETRF ( int  nrow,
int  ncol,
double *  a,
int  lda,
int *  ipiv 
)

C_DGETRF(): Compute an LU factorization of a general M-by-N matrix a using partial pivoting with row interchanges.

The factorization has the form A = P * L * U where P is a permutation matrix, L is lower triangular with unit diagonal elements (lower trapezoidal if nrow > ncol), and U is upper triangular (upper trapezoidal if nrow < ncol).

Parameters:
nrow = number of rows
ncol = number of colums
a = matrix to factorize
lda = leading dimension of a, lda >= max(1,ncol)
ipiv = output integer array of the pivot indices; for 1 <= i <= min(nrow, ncol), col i of the matrix was interchanged with col ipiv(i).
Returns: int info. info = 0: successful exit. info < 0: if info=-i, the ith-argument had an illegal vale. info>0: if info=i, U(i,i) is exactly zero. The factorization has been completed, but the factor U is exactly singular, and division by zero will occur if it is used to solve a system of equations.

int psi::C_DGETRI ( int  n,
double *  a,
int  lda,
int *  ipiv,
double *  work,
int  lwork 
)

C_DGETRI(): computes the inverse of a matrix using the LU factorization computed by DGETRF

This method inverts U and then computes inv(A) by solving the system inv(A)*L = inv(U) for inv(A).

Parameters:
n = order of the matrix a. n >= 0.
a = array of dimension (n,lda). On entry, the factors L and U from the factorization A = P*L*U as computed by DGETRF. On exit, if info=0, the inverse of hte original matrix A.
lda = the leading dimension of the array a. lda >= max(1,n).
ipiv = The pivot indices from DGETRF. For 1<=i<=n, row i of the matrix was interchanged with row ipiv(i)
work = workspace of dimension max(1,lwork). On exit, if info=0, then work(0) returns the optimal lwork.
lwork = the dimension of the array work. lwork >= max(1,n). For optimal performance, lwork > n*nb, where nb is the optimal blocksize returned by ilaenv. If lwork=-1, then a workspace query is assumed; the routine only calculates the optimal size of the work array, returns this value as the first entry of the work array, and no error message related to lwork is issued by xerbla.
Returns: int info. info=0: successful exit. info<0: if info=-i, the i-th argument had an illegal value. info>0: if info=i, U(i,i) is exactly zero; the matrix is singular and its inverse could not be computed.

void psi::C_DROT ( int  length,
double *  x,
int  inc_x,
double *  y,
int  inc_y,
double  costheta,
double  sintheta 
)

C_DROT(): Calculates a plane Givens rotation for vectors x, y and angle theta. x = x*cos + y*sin, y = -x*sin + y*cos.

Parameters:
x = vector x
y = vector Y
length = length of x,y
inc_x = how many places to skip to get to the next element of x
inc_y = how many places to skip to get to the next element of y
Returns: none

void psi::C_DSCAL ( int  length,
double  alpha,
double *  vec,
int  inc 
)

C_DSCAL(): This function scales a vector by a real scalar.

Parameters:
length = length of array
alpha = scale factor
vec = vector to scale
inc = how many places to skip to get to next element in vec
Returns: none

void psi::C_DSPMV ( char  uplo,
int  n,
double  alpha,
double *  A,
double *  X,
int  inc_x,
double  beta,
double *  Y,
int  inc_y 
)

C_DSPMV(): This function calculates the matrix-vector product

Y = alpha * A * X + beta * Y

where X and Y are vectors, A is a matrix, and alpha and beta are constants.

Parameters:
uplo = Indicates whether the matrix A is packed in upper ('U' or 'u') or lower ('L' or 'l') triangular form. We reverse what is passed before sending it on to Fortran because of the different Fortran/C conventions
n = The order of the matrix A (number of rows/columns)
alpha = The scalar alpha.
A = A pointer to the beginning of the data in A.
X = A pointer to the beginning of the data in X.
inc_x = The desired stride for X. Useful for skipping sections of data to treat only one column of a complete matrix. Usually 1, though.
beta = The scalar beta.
Y = A pointer to the beginning of the data in Y.
inc_y = The desired stride for Y.
Returns: none

Interface written by CD Sherrill July 2003

int psi::C_DSYEV ( char  jobz,
char  uplo,
int  n,
double *  A,
int  lda,
double *  w,
double *  work,
int  lwork 
)

C_DSYEV(): Computes all eigenvalues and, optionally, eigenvectors of a real symmetric matrix A.

These arguments mimic their Fortran counterparts.

Parameters:
jobz = 'N' or 'n' = compute eigenvalues only; 'V' or 'v' = compute both eigenvalues and eigenvectors.
uplo = 'U' or 'u' = A contains the upper triangular part of the matrix; 'L' or 'l' = A contains the lower triangular part of the matrix.
n = The order of the matrix A.
A = On entry, the two-dimensional array with dimensions n by lda. On exit, if jobz = 'V', the columns of the matrix contain the eigenvectors of A, but if jobz = 'N', the contents of the matrix are destroyed.
lda = The second dimension of A (i.e., the number of columns allocated for A).
w = The computed eigenvalues in ascending order.
work = An array of length lwork. On exit, if the return value is 0, work[0] contains the optimal value of lwork.
lwork = The length of the array work. A useful value of lwork seems to be 3*N.
Returns: 0 = successful exit <0 = the value of the i-th argument to the function was illegal >0 = the algorithm failed to converge.

Interface written by TDC, 10/2002

int psi::cc_excited ( std::string  wfn  ) 

cc_excited(): This function takes a WFN string and returns 1 if the WFN is an excited-state method and 0 if the WFN is a ground-state method.

Parameters:
wfn = wavefunction string
Returns: 1 if an excited state method, else 0

int psi::cc_excited ( char *  wfn  ) 

cc_excited(): This function takes a WFN string and returns 1 if the WFN is an excited-state method and 0 if the WFN is a ground-state method.

Parameters:
*wfn = wavefunction string
Returns: 1 if an excited state method, else 0

int psi::cc_wfn ( std::string  wfn  ) 

cc_wfn(): Checks if the given wavefunction string is a coupled-cluster type and returns 1 if yes and 0 if no.

Note: "coupled-cluster type" means it is handled by PSI like the coupled-cluster codes, not necessarily that it is literally a coupled-cluster wavefunction

Parameters:
wfn = wavefunction string
Returns: 1 if the WFN is a CC method, 0 otherwise

int psi::cc_wfn ( char *  wfn  ) 

cc_wfn(): Checks if the given wavefunction string is a coupled-cluster type and returns 1 if yes and 0 if no.

Note: "coupled-cluster type" means it is handled by PSI like the coupled-cluster codes, not necessarily that it is literally a coupled-cluster wavefunction

Parameters:
*wfn = wavefunction string
Returns: 1 if the WFN is a CC method, 0 otherwise

int psi::ci_wfn ( std::string  wfn  ) 

ci_wfn(): Examine the wavefunction type and return 1 if a CI/MCSCF-type, otherwise 0

Parameters:
wfn = wavefunction string
Returns: 1 if a CI/MCSCF-type wavefunction, otherwise 0

int psi::ci_wfn ( char *  wfn  ) 

ci_wfn(): Examine the wavefunction type and return 1 if a CI/MCSCF-type, otherwise 0

Parameters:
*wfn = wavefunction string
Returns: 1 if a CI/MCSCF-type wavefunction, otherwise 0

double psi::combinations ( int  n,
int  k 
)

combinations() : Calculates the number of ways to choose k objects from n objects, or "n choose k"

Parameters:

Parameters:
n = number of objects in total
k = number of objects taken at a time
Returns: number of combinations of n objects taken k at a time ("n choose k") (returned as a double).

int psi::david ( double **  A,
int  N,
int  M,
double *  eps,
double **  v,
double  cutoff,
int  print 
)

david(): Computes the lowest few eigenvalues and eigenvectors of a symmetric matrix, A, using the Davidson-Liu algorithm.

The matrix must be small enough to fit entirely in core. This algorithm is useful if one is interested in only a few roots of the matrix rather than the whole spectrum.

NB: This implementation will keep up to eight guess vectors for each root desired before collapsing to one vector per root. In addition, if smart_guess=1 (the default), guess vectors are constructed by diagonalization of a sub-matrix of A; otherwise, unit vectors are used.

TDC, July-August 2002

Parameters:
A = matrix to diagonalize
N = dimension of A
M = number of roots desired
eps = eigenvalues
v = eigenvectors
cutoff = tolerance for convergence of eigenvalues
print = Boolean for printing additional information
Returns: number of converged roots

void psi::dirprd_block ( double **  A,
double **  B,
int  rows,
int  cols 
)

dirprd_block()

This function takes two block matrices A and B and multiplies each element of B by the corresponding element of A

Parameters:
A = block matrix A
B = block matrix B
nrows = number of rows of A and B
ncols = number of columns of A and B
Returns: none

double psi::dot_block ( double **  A,
double **  B,
int  rows,
int  cols,
double  alpha 
)

dot_block(): Find dot product of two block matrices

Parameters:
A = block matrix A
B = block matrix B
nrows = number of rows of A and B
ncols = number of columns of A and B
alpha = scale factor by which the dot product is multiplied
Returns: dot product

double psi::eri ( unsigned int  l1,
unsigned int  m1,
unsigned int  n1,
double  alpha1,
double  A[3],
unsigned int  l2,
unsigned int  m2,
unsigned int  n2,
double  alpha2,
double  B[3],
unsigned int  l3,
unsigned int  m3,
unsigned int  n3,
double  alpha3,
double  C[3],
unsigned int  l4,
unsigned int  m4,
unsigned int  n4,
double  alpha4,
double  D[3],
int  norm_flag 
)

eri()

This is a very inefficient function for computing ERIs over primitive Gaussian functions. The argument list is self-explanatory, except for norm_flag:

Parameters:
norm_flag = tells what kind of normalization to use, 0 - no normalization, >0 - normalized ERI

double psi::factorial ( int  n  ) 

factorial(): Returns n!

Parameters:

Parameters:
n = number to take factorial of
Returns: n factorial, as a double word (since n! can get very large).

void psi::fill_sym_matrix ( double **  A,
int  size 
)

fill_sym_matrix(): Fills a symmetric matrix by placing the elements of the lower triangle into the upper triangle.

Parameters:
A = matrix to symmetrize
size = number of rows or columns (assume square)
Returns: none

void psi::filter ( double *  input,
double *  output,
int *  ioff,
int  norbs,
int  nfzc,
int  nfzv 
)

filter(): Filter out undesired (frozen core/virt) integrals

Given a lower-triangle array of integrals in the full space of orbitals as well as numbers of frozen core and virtual orbitals, this function returns a list of integrals involving only active orbitals.

TDC, June 2001

Note: Based on the code written by CDS in the original iwl_rd_one_all_act() function in LIBIWL.

void psi::free_3d_array ( double ***  A,
int  p,
int  q 
)

free_3d_array(): Free a (non-contiguous) 3D array

Parameters:
A = triple-star pointer to the 3D array
p = size of first dimension
q = size of second dimension
Returns: none

int * psi::get_frzcpi (  ) 

get_frzcpi(): Get frozen core per irrep array.

Parameters: none

Returns: pointer to int array

int * psi::get_frzvpi (  ) 

get_frzvpi(): Get frozen virtuals per irrep array.

Parameters: none

Returns: pointer to int array

double *** psi::init_3d_array ( int  p,
int  q,
int  r 
)

3d_array(): Initialize a (non-contiguous) 3D array

Parameters:
p = size of first dimension
q = size of second dimension
r = size of third dimension
Returns: triple-star pointer to 3D array

double psi::invert_matrix ( double **  a,
double **  y,
int  N,
FILE *  outfile 
)

INVERT_MATRIX(): The function takes the inverse of a matrix using the C routines in Numerical Recipes in C.

Matt Leininger, Summer 1994

Parameters:

Parameters:
a = matrix to take the inverse of (is modified by invert_matrix())
y = the inverse matrix
N = the size of the matrices
outfile = file for error messages
Other variables: col and indx are temporary arrays d is 1 or -1

Returns: double (determinant) Note: The original matrix is modified by invert_matrix()

int psi::mat_in ( FILE *  fp,
double **  array,
int  width,
int  max_length,
int *  stat 
)

MAT_IN(): Function to read in a matrix. Simple version for now.

Parameters:

Parameters:
fp = file pointer to input stream
array = matrix to hold data
width = number of columns to read
max_length = maximum number of rows to read
stat = pointer to int to hold status flag (0=read ok, 1=error)
Returns: number of rows read Also modifies stat to = error code (0 = ok, 1 = error)

void psi::mat_print ( double **  matrix,
int  rows,
int  cols,
FILE *  outfile 
)

mat_print(): Prints a matrix to a file in a formatted style

Parameters:
matrix = matrix to print
rows = number of rows
cols = number of columns
outfile = output file pointer for printing
Returns: Always returns zero...

double psi::newton ( double(*)(double)  F,
double(*)(double)  dF,
double  x,
double  tolerance,
int  maxiter,
int  printflag 
)

newton(): Find the root of a function by Newton's method. Iterations are limited to a maximum value. The algorithm stops when the difference between successive estimates of the root is less than the specified tolerance. An initial guess for the root must be given, as well as the function AND it's derivative.

Parameters:
F = pointer to function we want to examine (must return double)
dF = pointer to _derivative_ of function F
x = initial guess for root
tolerance = how close successive guesses must get before convergence
maxiter = maximum number of iterations
printflag = whether or not to print results for each iteration (1 or 0)
Returns: the value of the root

double psi::norm_const ( unsigned int  l1,
unsigned int  m1,
unsigned int  n1,
double  alpha1,
double  A[3] 
)

norm_const()

Returns: normalization constant

void psi::normalize ( double **  A,
int  rows,
int  cols 
)

normalize(): Normalize a set of vectors

Assume we're normalizing the ROWS

Parameters:
A = matrix holding vectors to normalize
rows = number of rows in A
cols = number of columns in A
Returns: none

David Sherrill, Feb 1994

int psi::pople ( double **  A,
double *  x,
int  dimen,
int  num_vecs,
double  tolerance,
FILE *  outfile,
int  print_lvl 
)

POPLE(): Uses Pople's method to iteratively solve linear equations Ax = b

Matt Leininger, April 1998

Parameters:
A = matrix
x = initially has vector b, but returns vector x.
dimen = dimension of vector x.
num_vecs = number of vectors x to obtain.
tolerance = cutoff threshold for norm of expansion vector.
Returns: 0 for success, 1 for failure

int psi::ras_set ( int  nirreps,
int  nbfso,
int  freeze_core,
int *  orbspi,
int *  docc,
int *  socc,
int *  frdocc,
int *  fruocc,
int **  ras_opi,
int *  order,
int  ras_type 
)

ras_set(): Deprecated

This function sets up the number of orbitals per irrep for each of the RAS subspaces [frozen core, RAS I, RAS II, RAS III, RAS IV, frozen virts]. It also obtains the appropriate orbital reordering array. The reordering array takes a basis function in Pitzer ordering (orbitals grouped according to irrep) and gives the corresponding index in the RAS numbering scheme. Orbitals are numbered according to irrep within each of the subspaces.

Formerly, docc, socc, frdocc, and fruocc were read in this function. Now docc and socc will be left as-is if they are not present in input.

C. David Sherrill Center for Computational Quantum Chemistry University of Georgia, 25 June 1995

Parameters:
nirreps = num of irreps in computational point group
nbfso = num of basis functions in symmetry orbitals (num MOs)
freeze_core = 1 to remove frozen core orbitals from ras_opi
orbspi = array giving num symmetry orbitals (or MOs) per irrep
docc = array of doubly occupied orbitals per irrep
socc = array of singly occupied orbitals per irrep
frdocc = array of frozen core per irrep
fruocc = array of frozen virtuals per irrep
ras_opi = matrix giving num of orbitals per irrep per ras space, addressed as ras_opi[ras_space][irrep]
order = array nbfso big which maps Pitzer to Correlated order
ras_type = if 1, put docc and socc together in same RAS space (RAS I), as appropriate for DETCI. If 0, put socc in its own RAS space (RAS II), as appropriate for CC.
Returns: 1 for success, 0 otherwise

int psi::ras_set2 ( int  nirreps,
int  nmo,
int  delete_fzdocc,
int  delete_restrdocc,
int *  orbspi,
int *  docc,
int *  socc,
int *  frdocc,
int *  fruocc,
int *  restrdocc,
int *  restruocc,
int **  ras_opi,
int *  order,
int  ras_type,
int  hoffmann 
)

ras_set2()

This function sets up the number of orbitals per irrep for each of the RAS subspaces [frozen core (FZC), restricted core (COR), RAS I, RAS II, RAS III, RAS IV, restricted virts (VIR), frozen virts (FZV)]. It also obtains the appropriate orbital reordering array. The reordering array takes a basis function in Pitzer ordering (orbitals grouped according to irrep) and gives the corresponding index in the RAS numbering scheme. Orbitals are numbered according to irrep within each of the subspaces.

Formerly, docc, socc, frdocc, and fruocc were read in this function. Now docc and socc will be left as-is if they are not present in input.

Assume we always want integrals (at least some of them...) involving restricted orbitals, but we may not need them for frozen orbitals unless perhaps it's a gradient. The frozen orbitals will never enter explicitly in DETCI, but restricted orbitals may or may not, depending on the type of computation (CI vs CAS vs CASPT2, etc). For conventional CI, FCI, MRCI, RASCI, CASSCF, restricted orbitals will not participate explicitly in DETCI. For CASPT2, perhaps they will. CLAG and DETCAS will still need to have some indices in the restricted (and possibly frozen) orbital subspaces?

C. David Sherrill

Updated June 2002 to distinguish between frozen and restricted spaces

Parameters:
nirreps = num of irreps in computational point group
nmo = number of MO's
delete_fzdocc = 1 to remove frozen core orbitals from ras_opi[0]
delete_restrdocc = 1 to remove restricted core orbs from ras_opi[0]
orbspi = array giving num symmetry orbitals (or MOs) per irrep
docc = array of doubly occupied orbitals per irrep (guess should be provided)
socc = array of singly occupied orbitals per irrep (guess should be provided)
frdocc = array of frozen core per irrep (returned by function, but allocate before call)
fruocc = array of frozen virtuals per irrep (returned by function, but allocate before call)
rstrdocc = array of restricted core per irrep (returned by function, but allocate before call)
rstruocc = array of restricted core per irrep (returned by function, but allocate before call)
ras_opi = matrix giving num of orbitals per irrep per ras space, addressed as ras_opi[ras_space][irrep] (returned by function, but allocate before call)
order = array nmo big which maps Pitzer to Correlated order (returned by function, but allocate before call)
ras_type = if 1, put docc and socc together in same RAS space (RAS I), as appropriate for DETCI. If 0, put socc in its own RAS space (RAS II), as appropriate for CC.
hoffmann = if > 0, order orbitals according to Mark Hoffmann. hoffmann==1: ras1, ras2, ..., rasn, COR, FZC, VIR, FZV. hoffmann==2: VIR, ras1, ras2, ..., rasn, COR, FZC, FZV. Note odd placement of FZC in middle!
Returns: 1 for success, 0 otherwise

void psi::reorder_qt ( int *  docc_in,
int *  socc_in,
int *  frozen_docc_in,
int *  frozen_uocc_in,
int *  order,
int *  orbs_per_irrep,
int  nirreps 
)

reorder_qt()

This function constructs a reordering array according to the "Quantum Trio" standard ordering, in which the orbitals are divided into the following sets: frozen core, then doubly occupied, then singly occupied, then virtuals, then deleted (frozen) virtuals. The reordering array takes a basis function in Pitzer ordering (orbitals grouped according to irrep) and gives the corresponding index in the Quantum Trio numbering scheme.

Should give the same reordering array as in the old libread30 routines.

C. David Sherrill Center for Computational Quantum Chemistry University of Georgia, 1995

Parameters:
docc_in = doubly occupied orbitals per irrep
socc_in = singly occupied orbitals per irrep
frozen_docc_in = frozen occupied orbitals per irrep
frozen_uocc_in = frozen unoccupied orbitals per irrep
order = reordering array (Pitzer->QT order)
nirreps = number of irreducible representations

void psi::reorder_qt_uhf ( int *  docc,
int *  socc,
int *  frozen_docc,
int *  frozen_uocc,
int *  order_alpha,
int *  order_beta,
int *  orbspi,
int  nirreps 
)

reorder_qt_uhf()

Generalization of reorder_qt() for UHF case

Parameters:
docc = doubly occupied orbitals per irrep
socc = singly occupied orbitals per irrep
frozen_docc = frozen occupied orbitals per irrep
frozen_uocc = frozen unoccupied orbitals per irrep
order_alpha = reordering array for alpha (Pitzer->QT order)
order_beta = reordering array for beta (Pitzer->QT order)
nirreps = number of irreducible representations

void psi::schmidt ( double **  A,
int  rows,
int  cols,
FILE *  outfile 
)

SCHMIDT(): Gram-Schmidt orthogonalize a set of vectors

Assume we're orthogonalizing the ROWS, since in C a vector is usually a row more often than a column.

David Sherrill, Feb 1994

Parameters:
A = matrix to orthogonalize (matrix of doubles)
rows = rows of A
cols = columns of A
Returns: none

int psi::schmidt_add ( double **  A,
int  rows,
int  cols,
double *  v 
)

SCHMIDT_ADD(): Assume A is a orthogonal matrix. This function Gram-Schmidt orthogonalizes a new vector v and adds it to matrix A. A must contain a free row pointer for a new row. Don't add orthogonalized v' if norm(v') < NORM_TOL.

David Sherrill, Feb 1994

Parameters:
A = matrix to add new vector to
rows = current number of rows in A (A must have ptr for 'rows+1' row.)
cols = columns in A v = vector to add to A after it has been made orthogonal to rest of A
Returns: 1 if a vector is added to A, 0 otherwise

double psi::secant ( double(*)(double)  F,
double  x0,
double  x1,
double  tolerance,
int  maxiter,
int  printflag 
)

secant(): Find the root of a function by the Secant Method. Iterations are limited to a maximum value. The algorithm stops when the relative difference between successive guesses is less than the specified tolerance. An initial TWO guesses for the root must be given, as well as the function itself.

Parameters:
F = pointer to function we want to examine (must return double)
x0 = 1st guess for root
x1 = 2nd guess for root
tolerance = how close successive guesses must get before convergence
maxiter = maximum number of iterations
printflag = whether or not to print results for each iteration (1 or 0)
Returns: the value of the root

void psi::slaterdetset_add ( SlaterDetSet *  sdset,
int  index,
int  alphastring,
int  betastring 
)

slaterdetset_add(): Add info for a particular Slater determinant to a SlaterDetSet.

Parameters:
sdset = pointer to SlaterDetSet to add to
index = location in the set to add to
alphastring = alpha string ID for the new determinant
betastring = beta string ID for the new determinant
Returns: none

void psi::slaterdetset_delete ( SlaterDetSet *  sdset  ) 

slaterdetset_delete(): Delete a Slater Determinant Set.

Does not free the members alphastrings and betastrings. See also: slaterdetset_delete_full() which does this.

Parameters:
sdset = pointer to SlaterDetSet to be de-allocated
Returns: none

void psi::slaterdetset_delete_full ( SlaterDetSet *  sdset  ) 

slaterdetset_delete_full(): De-allocate a Slater Determinant Set.

Frees memory including alpha and beta strings. See slaterdetset_delete() for a similar version which does not free the alpha and beta strings.

Parameters:
sdset = pointer to SlaterDetSet to be de-allocated
Returns: none

void psi::slaterdetset_init ( SlaterDetSet *  sdset,
int  size,
StringSet *  alphastrings,
StringSet *  betastrings 
)

slaterdetset_init(): Initialize a Slater Determinant Set

Parameters:
sdset = pointer to SlaterDetSet being initialized
size = number of SlaterDets to be held
alphastrings = pointer to StringSet of alpha strings
betastrings = pointer to StringSet of beta strings
Returns: none

void psi::slaterdetset_read ( ULI  unit,
char *  prefix,
SlaterDetSet **  slaterdetset 
)

slaterdetset_read(): Read a Slater Determinant Set

Parameters:
unit = file number of the PSIO file
prefix = prefix string to come before libpsio entry keys
sdset = pointer to SlaterDetSet to read into
Returns: none

void psi::slaterdetset_read_vect ( ULI  unit,
char *  prefix,
double *  coeffs,
int  size,
int  vectnum 
)

slaterdetset_read_vect(): Read in the coefficients for a single vector associated with a SlaterDetSet.

This function already assumes we've already called slaterdetset_read() to read in the string and determinant information. This is only going to read in the coefficients. This has been split out because we might want to read several roots for a given determinant setup. This does not actually depend on the presence of a SlaterDetVector object and is called a SlaterDetSet function.

Parameters:
unit = file number of the UNINITIALIZED PSIO file
prefix = prefix string to come before libpsio entry keys
coeffs = array to hold coefficients read
size = number of elements in coeffs array
vectnum = the vector number (for the PSIO key). Start from 0.
Returns: none

CDS 8/03

void psi::slaterdetset_write ( ULI  unit,
char *  prefix,
SlaterDetSet *  sdset 
)

slaterdetset_write(): Write a Slater Determinant Set to disk.

Parameters:
unit = file number to write to
prefix = prefix string to come before libpsio entry keys
sdset = pointer to SlaterDetSet to write
Returns: none

void psi::slaterdetset_write_vect ( ULI  unit,
char *  prefix,
double *  coeffs,
int  size,
int  vectnum 
)

slaterdetset_write_vect(): Write to disk the coefficients for a single vector associated with a set of Slater determinants.

This function already assumes we've already called slaterdetset_write() to write out the string and determinant information. This is only going to write out the coefficients. This has been split out because we might want to write several roots for a given determinant setup. This does not actually dpend on the presence of a SlaterDetVector object so it is called a SlaterDetSet function.

Parameters:
unit = file number of the UNINITIALIZED PSIO file
prefix = prefix string to come before libpsio entry keys
coeffs = array of coefficients to write
size = number of elements in coeffs array
vectnum = the vector number (to make a PSIO key). Start numbering from zero.
Returns: none

CDS 8/03

void psi::slaterdetvector_add ( SlaterDetVector *  sdvector,
int  index,
double  coeff 
)

slaterdetvector_add(): Add a coefficient to a SlaterDetVector

Parameters:
sdvector = Pointer to SlaterDetVector to add to
index = location in vector for writing the coefficient
coeff = the coefficient to write to location index
Returns: none

void psi::slaterdetvector_delete ( SlaterDetVector *  sdvector  ) 

slaterdetvector_delete(): De-allocate a SlaterDetVector

Parameters:
sdvector = pointer to SlaterDetVector to de-allocate
Note: does NOT fully free the associated SlaterDetSet. For that, see function slaterdetvector_delete_full()

Returns: none

void psi::slaterdetvector_delete_full ( SlaterDetVector *  sdvector  ) 

slaterdetvector_delete_full(): De-allocate a SlaterDetVector and its associated SlaterDetSet.

To keep the SlaterDetSet itself, use similar function slaterdetvector_delete().

Parameters:
sdvector = pointer to SlaterDetVector to delete
Returns: none

void psi::slaterdetvector_init ( SlaterDetVector *  sdvector,
SlaterDetSet *  sdset 
)

slaterdetvector_init(): Initialize a vector of coefficients corresponding to a Slater Determinant set

Parameters:
sdvector = pointer to SlaterDetVector to initialize (coeffs member will be allocated)
sdset = pointer to SlaterDetSet the vector is associated with
Returns: none

void psi::slaterdetvector_read ( ULI  unit,
char *  prefix,
SlaterDetVector **  sdvector 
)

slaterdetvector_read(): Read a SlaterDetVector from disk

Use this if we only need to read a single vector. Otherwise, call slaterdetset_read(); slaterdetset_read_vect(); to allow for multiple vectors per slaterdetset to be read from disk.

Parameters:
unit = file number to read from
prefix = prefix string to come before libpsio entry keys
sdvector = pointer to hold pointer to SlaterDetVector allocated by this function
Returns: none

void psi::slaterdetvector_set ( SlaterDetVector *  sdvector,
double *  coeffs 
)

slaterdetvector_set(): Set a SlaterDetVector's vector to a set of coefficients supplied by array coeffs

Parameters:
sdvector = pointer to SlaterDetVector for writing coefficients
coeffs = array of coefficients to write to sdvector

void psi::slaterdetvector_write ( ULI  unit,
char *  prefix,
SlaterDetVector *  vector 
)

slaterdetvector_write(): Write a SlaterDetVector to disk.

This writes a vector in the space of Slater determinants, along with the set of determinants itself, to a PSIO file.

Use this if we only need to write a single vector. Otherwise, call slaterdetset_write(); slaterdetset_write_vect(); to allow for multiple vectors per slaterdetset to be written to disk.

Parameters:
unit = file number of the UNINITIALIZED PSIO file
prefix = prefix string to come before libpsio entry keys
vector = SlaterDetVector to write to disk
Returns: none

void psi::solve_2x2_pep ( double **  H,
double  S,
double *  evals,
double **  evecs 
)

solve_2x2_pep(): Solve a 2x2 pseudo-eigenvalue problem of the form [ H11 - E H12 - E*S ] [c1] [ H12 - E*S H22 - E ] [c2] = 0

Parameters:
H = matrix to get eigenvalues of
S = overlap between states 1 & 2
evals = pointer to array to hold 2 eigenvalues
evecs = matrix to hold 2 eigenvectors
Returns: none

void psi::sort_vector ( double *  A,
int  n 
)

sort_vector(): Sort the elements of a vector into increasing order

Parameters:
A = array to sort
n = length of array
Returns: none

void psi::stringset_add ( StringSet *  sset,
int  index,
unsigned char *  Occ 
)

stringset_add(): Add a string (in Pitzer order, given by Occ) to the StringSet, writing to position index.

Parameters:
sset = StringSet to add to
index = location in StringSet to add to
Occ = orbital occupations (Pitzer order) of the string to add
Returns: none

void psi::stringset_delete ( StringSet *  sset  ) 

stringset_delete(): Delete a StringSet

Parameters:
sset = pointer to StringSet to delete
Returns: none

void psi::stringset_init ( StringSet *  sset,
int  size,
int  nelec,
int  nfzc,
short int *  frozen_occ 
)

stringset_init(): Initialize a set of alpha/beta strings

Parameters:
sset = pointer to StringSet (contains occs in Pitzer order)
size = number of strings
nelec = number of electrons
nfzc = number of frozen core orbitals
frozen_occ = array of frozen occupied orbitals (Pitzer numbering!)
Returns: none

void psi::stringset_read ( ULI  unit,
char *  prefix,
StringSet **  stringset 
)

stringset_read(): Read a StringSet from disk

Parameters:
unit = file number to read from
prefix = prefix string to come before libpsio entry keys
stringset = double pointer to StringSet allocated by this function
Returns: none

void psi::stringset_reindex ( StringSet *  sset,
short int *  mo_map 
)

stringset_reindex(): Remap orbital occupations from one ordering to another.

Parameters:
sset = pointer to StringSet
mo_map = mapping array from original orbital order to new order
Returns: none

void psi::stringset_write ( ULI  unit,
char *  prefix,
StringSet *  sset 
)

stringset_write(): Write a stringset to a PSI file

Parameters:
unit = file number to write to
prefix = prefix string to come before libpsio entry keys
sset = pointer to StringSet to write
Returns: none

void psi::timer_done ( void   ) 

timer_done(): Close down all timers and write results to timer.dat

void psi::timer_init ( void   ) 

timer_init(): Initialize the linked list of timers

void psi::timer_off ( const char *  key  ) 

timer_off(): Turn off the timer with the name given as an argument. Can be turned on and off, time will accumulate while on.

Parameters:
key = Name of timer

void psi::timer_on ( const char *  key  ) 

timer_on(): Turn on the timer with the name given as an argument. Can be turned on and off, time will accumulate while on.

Parameters:
key = Name of timer

struct timer* psi::timer_scan ( const char *  key  )  [read]

timer_scan(): Return a timer structure whose name matches that given by supplied string

Parameters:
key = name of timer to search for
Returns: the timer structure with the given name, else NULL


Generated on Mon Dec 21 14:14:44 2009 for PSI by  doxygen 1.5.6