source: ThirdParty/mpqc_open/src/lib/chemistry/qc/basis/orthog.h@ 860145

Action_Thermostats Add_AtomRandomPerturbation Add_RotateAroundBondAction Add_SelectAtomByNameAction Adding_Graph_to_ChangeBondActions Adding_MD_integration_tests Adding_StructOpt_integration_tests Automaking_mpqc_open AutomationFragmentation_failures Candidate_v1.6.0 Candidate_v1.6.1 ChangeBugEmailaddress ChangingTestPorts ChemicalSpaceEvaluator Combining_Subpackages Debian_Package_split Debian_package_split_molecuildergui_only Disabling_MemDebug Docu_Python_wait EmpiricalPotential_contain_HomologyGraph_documentation Enable_parallel_make_install Enhance_userguide Enhanced_StructuralOptimization Enhanced_StructuralOptimization_continued Example_ManyWaysToTranslateAtom Exclude_Hydrogens_annealWithBondGraph FitPartialCharges_GlobalError Fix_ChronosMutex Fix_StatusMsg Fix_StepWorldTime_single_argument Fix_Verbose_Codepatterns ForceAnnealing_goodresults ForceAnnealing_oldresults ForceAnnealing_tocheck ForceAnnealing_with_BondGraph ForceAnnealing_with_BondGraph_continued ForceAnnealing_with_BondGraph_continued_betteresults ForceAnnealing_with_BondGraph_contraction-expansion GeometryObjects Gui_displays_atomic_force_velocity IndependentFragmentGrids_IntegrationTest JobMarket_RobustOnKillsSegFaults JobMarket_StableWorkerPool JobMarket_unresolvable_hostname_fix ODR_violation_mpqc_open PartialCharges_OrthogonalSummation PythonUI_with_named_parameters QtGui_reactivate_TimeChanged_changes Recreated_GuiChecks RotateToPrincipalAxisSystem_UndoRedo StoppableMakroAction Subpackage_levmar Subpackage_mpqc_open Subpackage_vmg ThirdParty_MPQC_rebuilt_buildsystem TremoloParser_IncreasedPrecision TremoloParser_MultipleTimesteps Ubuntu_1604_changes stable
Last change on this file since 860145 was 860145, checked in by Frederik Heber <heber@…>, 8 years ago

Merge commit '0b990dfaa8c6007a996d030163a25f7f5fc8a7e7' as 'ThirdParty/mpqc_open'

  • Property mode set to 100644
File size: 4.5 KB
Line 
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
37/// This class computes the orthogonalizing transform for a basis set.
38class OverlapOrthog: virtual public SavableState {
39 public:
40
41 /// An enum for the types of orthogonalization.
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:
83 OverlapOrthog(OrthogMethod method,
84 const RefSymmSCMatrix &overlap,
85 const Ref<SCMatrixKit> &result_kit,
86 double lindep_tolerance,
87 int debug = 0);
88
89 OverlapOrthog(StateIn&);
90
91 virtual ~OverlapOrthog();
92
93 void save_data_state(StateOut&);
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
106 /// Returns the orthogonalization method
107 OrthogMethod orthog_method() const { return orthog_method_; }
108
109 /// Returns the tolerance for linear dependencies.
110 double lindep_tol() const { return lindep_tol_; }
111
112 /** Returns a matrix which does the requested transform from a basis to
113 an orthogonal basis. This could be either the symmetric or
114 canonical orthogonalization matrix. The row dimension is the basis
115 dimension and the column dimension is orthogonal basis dimension.
116 An operator \f$O\f$ in the orthogonal basis is given by \f$X O
117 X^T\f$ where \f$X\f$ is the return value of this function. */
118 RefSCMatrix basis_to_orthog_basis();
119
120 /** Returns the inverse of the transformation returned by
121 * basis_to_orthog_basis.
122 */
123 RefSCMatrix basis_to_orthog_basis_inverse();
124
125 RefSCDimension dim();
126 RefSCDimension orthog_dim();
127
128 /** Returns the number of linearly dependent functions eliminated from
129 the orthogonal basis.
130 */
131 int nlindep();
132};
133
134}
135
136#endif
Note: See TracBrowser for help on using the repository browser.