MPQC 2.3.1
orthog.h
1
2//
3// orthog.h -- orthogonalize the basis set
4//
5// Copyright (C) 1996 Limit Point Systems, Inc.
6//
7// Author: Curtis Janssen <cljanss@ca.sandia.gov>
8// Maintainer: LPS
9//
10// This file is part of the SC Toolkit.
11//
12// The SC Toolkit is free software; you can redistribute it and/or modify
13// it under the terms of the GNU Library General Public License as published by
14// the Free Software Foundation; either version 2, or (at your option)
15// any later version.
16//
17// The SC Toolkit is distributed in the hope that it will be useful,
18// but WITHOUT ANY WARRANTY; without even the implied warranty of
19// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20// GNU Library General Public License for more details.
21//
22// You should have received a copy of the GNU Library General Public License
23// along with the SC Toolkit; see the file COPYING.LIB. If not, write to
24// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
25//
26// The U.S. Government is granted a limited license as per AL 91-7.
27//
28
29#ifndef _chemistry_qc_basis_orthog_h
30#define _chemistry_qc_basis_orthog_h
31
32#include <util/state/state.h>
33#include <math/scmat/matrix.h>
34
35namespace sc {
36
38class OverlapOrthog: virtual public SavableState {
39 public:
40
42 enum OrthogMethod { Symmetric=1, Canonical=2, GramSchmidt=3 };
43
44 private:
45 int debug_;
46
47 RefSCDimension dim_;
48 RefSCDimension orthog_dim_;
49
50 // The tolerance for linearly independent basis functions.
51 // The intepretation depends on the orthogonalization method.
52 double lindep_tol_;
53 // The number of linearly dependent functions
54 int nlindep_;
55 // The orthogonalization method
56 OrthogMethod orthog_method_;
57 // The orthogonalization matrices
58 RefSCMatrix orthog_trans_;
59 RefSCMatrix orthog_trans_inverse_;
60 // The maximum and minimum residuals from the orthogonalization
61 // procedure. The interpretation depends on the method used.
62 // For symmetry and canonical, these are the min and max overlap
63 // eigenvalues. These are the residuals for the basis functions
64 // that actually end up being used.
65 double min_orthog_res_;
66 double max_orthog_res_;
67
68 void compute_overlap_eig(RefSCMatrix& overlap_eigvec,
69 RefDiagSCMatrix& overlap_isqrt_eigval,
70 RefDiagSCMatrix& overlap_sqrt_eigval);
71 void compute_symmetric_orthog();
72 void compute_canonical_orthog();
73 void compute_gs_orthog();
74 void compute_orthog_trans();
75
76 // WARNING: after a SavableState save/restore, these two members will
77 // be null. There is really no need to store these anyway--should be
78 // removed.
79 RefSymmSCMatrix overlap_;
80 Ref<SCMatrixKit> result_kit_; // this kit is used for the result matrices
81
82 public:
84 const RefSymmSCMatrix &overlap,
85 const Ref<SCMatrixKit> &result_kit,
86 double lindep_tolerance,
87 int debug = 0);
88
90
91 virtual ~OverlapOrthog();
92
94
95 void reinit(OrthogMethod method,
96 const RefSymmSCMatrix &overlap,
97 const Ref<SCMatrixKit> &result_kit,
98 double lindep_tolerance,
99 int debug = 0);
100
101 double min_orthog_res() const { return min_orthog_res_; }
102 double max_orthog_res() const { return max_orthog_res_; }
103
104 Ref<OverlapOrthog> copy() const;
105
107 OrthogMethod orthog_method() const { return orthog_method_; }
108
110 double lindep_tol() const { return lindep_tol_; }
111
119
124
125 RefSCDimension dim();
126 RefSCDimension orthog_dim();
127
131 int nlindep();
132};
133
134}
135
136#endif
This class computes the orthogonalizing transform for a basis set.
Definition: orthog.h:38
RefSCMatrix basis_to_orthog_basis()
Returns a matrix which does the requested transform from a basis to an orthogonal basis.
OrthogMethod
An enum for the types of orthogonalization.
Definition: orthog.h:42
RefSCMatrix basis_to_orthog_basis_inverse()
Returns the inverse of the transformation returned by basis_to_orthog_basis.
int nlindep()
Returns the number of linearly dependent functions eliminated from the orthogonal basis.
double lindep_tol() const
Returns the tolerance for linear dependencies.
Definition: orthog.h:110
OrthogMethod orthog_method() const
Returns the orthogonalization method.
Definition: orthog.h:107
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
The RefDiagSCMatrix class is a smart pointer to an DiagSCMatrix specialization.
Definition: matrix.h:380
The RefSCDimension class is a smart pointer to an SCDimension specialization.
Definition: dim.h:156
The RefSCMatrix class is a smart pointer to an SCMatrix specialization.
Definition: matrix.h:135
The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization.
Definition: matrix.h:261
A template class that maintains references counts.
Definition: ref.h:332
Base class for objects that can save/restore state.
Definition: state.h:46
Restores objects that derive from SavableState.
Definition: statein.h:70
Serializes objects that derive from SavableState.
Definition: stateout.h:61

Generated at Wed Feb 28 2024 16:35:31 for MPQC 2.3.1 using the documentation package Doxygen 1.9.6.