MPQC 2.3.1

- Main Page
- Related Pages
- Classes
- Files

- File List

vxb_eval_info.h
1 //
2 // vxb_eval_info.h
3 //
4 // Copyright (C) 2003 Edward Valeev
5 //
6 // Author: Edward Valeev <edward.valeev@chemistry.gatech.edu>
7 // Maintainer: EV
8 //
9 // This file is part of the SC Toolkit.
10 //
11 // The SC Toolkit is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU Library General Public License as published by
13 // the Free Software Foundation; either version 2, or (at your option)
14 // any later version.
15 //
16 // The SC Toolkit is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU Library General Public License for more details.
20 //
21 // You should have received a copy of the GNU Library General Public License
22 // along with the SC Toolkit; see the file COPYING.LIB. If not, write to
23 // the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24 //
25 // The U.S. Government is granted a limited license as per AL 91-7.
26 //
27
28 #ifdef __GNUG__
29 #pragma interface
30 #endif
31
32 #ifndef _chemistry_qc_mbptr12_vxbevalinfo_h
33 #define _chemistry_qc_mbptr12_vxbevalinfo_h
34
35 #include <string>
36 #include <util/misc/string.h>
37 #include <util/ref/ref.h>
38 #include <math/scmat/abstract.h>
39 #include <util/group/memory.h>
40 #include <chemistry/molecule/energy.h>
41 #include <chemistry/qc/scf/scf.h>
42 #include <chemistry/qc/mbptr12/linearr12.h>
43 #include <chemistry/qc/mbptr12/moindexspace.h>
44 #include <chemistry/qc/mbptr12/transform_factory.h>
45
46 namespace sc {
47
48 class MBPT2_R12;
49
53 class R12IntEvalInfo : virtual public SavableState {
54
55 public:
56
58 enum StoreMethod { mem_posix = 0, posix = 1, mem_mpi = 2, mpi = 3, mem_only = 4 };
59
60 private:
61
62 Wavefunction* wfn_; // Wavefunction that owns this
63 Ref<SCF> ref_;
64 Ref<Integral> integral_;
65 Ref<GaussianBasisSet> bs_;
66 Ref<GaussianBasisSet> bs_aux_;
67 Ref<GaussianBasisSet> bs_vir_;
68 Ref<GaussianBasisSet> bs_ri_;
69 Ref<SCMatrixKit> matrixkit_;
70 Ref<MessageGrp> msg_;
71 Ref<MemoryGrp> mem_;
72 Ref<ThreadGrp> thr_;
73
74 int nocc_;
75 int nfzc_;
76 int nfzv_;
77
78 size_t memory_;
79 bool dynamic_;
80 double print_percent_;
81 int debug_;
82 StoreMethod ints_method_;
83 std::string ints_file_;
84 LinearR12::ABSMethod abs_method_;
85
86 int nlindep_aux_;
87 int nlindep_vir_;
88 int nlindep_ri_;
89
90 Ref<MOIndexSpace> mo_space_; // symblocked MO space
91 Ref<MOIndexSpace> obs_space_; // energy-sorted MO space
92 Ref<MOIndexSpace> abs_space_;
93 Ref<MOIndexSpace> ribs_space_;
94 Ref<MOIndexSpace> act_occ_space_;
95 Ref<MOIndexSpace> occ_space_;
96 Ref<MOIndexSpace> occ_space_symblk_;
97 Ref<MOIndexSpace> act_vir_space_;
98 Ref<MOIndexSpace> vir_space_;
99 Ref<MOIndexSpace> vir_space_symblk_;
100 Ref<MOIntsTransformFactory> tfactory_;
101
102 // construct the RI basis based on abs_method
103 void construct_ri_basis_(bool safe);
104 void construct_ri_basis_ks_(bool safe);
105 void construct_ri_basis_ksplus_(bool safe);
106 void construct_ri_basis_ev_(bool safe);
107 void construct_ri_basis_evplus_(bool safe);
108 // Uses ri_basis to construct a basis that spans the orthogonal complement to the OBS
109 void construct_ortho_comp_svd_();
110 // Returns true if ABS spans OBS
111 bool abs_spans_obs_();
112 // Construct eigenvector and eigenvalues sorted by energy
113 void eigen2_();
114 // Construct orthog_aux_
115 void construct_orthog_aux_();
116 // Construct orthog_vir_
117 void construct_orthog_vir_();
118 // Construct orthog_ri_
119 void construct_orthog_ri_();
120
121 public:
122 R12IntEvalInfo(StateIn&);
124 R12IntEvalInfo(MBPT2_R12*);
125 ~R12IntEvalInfo();
126
127 void save_data_state(StateOut&);
128
131 void set_dynamic(bool dynamic) { dynamic_ = dynamic; };
133 void set_print_percent(double print_percent) { print_percent_ = print_percent; };
135 void set_debug_level(int debug) { debug_ = debug; };
138 void set_ints_method(const StoreMethod method) { ints_method_ = method; };
141 void set_ints_file(const std::string& filename) { ints_file_ = filename; };
144 void set_memory(const size_t nbytes);
147 void set_absmethod(LinearR12::ABSMethod abs_method);
148
149 Wavefunction* wfn() const { return wfn_; };
150 Ref<SCF> ref() const { return ref_; };
151 Ref<Integral> integral() const { return integral_; };
153 Ref<GaussianBasisSet> basis() const { return bs_; };
155 Ref<GaussianBasisSet> basis_vir() const { return bs_vir_; };
157 Ref<GaussianBasisSet> basis_ri() const { return bs_ri_; };
158 Ref<SCMatrixKit> matrixkit() const { return matrixkit_; };
159 Ref<MemoryGrp> mem() const { return mem_;};
160 Ref<MessageGrp> msg() const { return msg_;};
161 Ref<ThreadGrp> thr() const { return thr_;};
162
163 bool dynamic() const { return dynamic_; };
164 double print_percent() const { return print_percent_; };
165 int debug_level() const { return debug_; };
166 const StoreMethod ints_method() const { return ints_method_; };
167 const std::string& ints_file() const;
168 const size_t memory() const { return memory_; };
169
170 const int nocc() const { return nocc_;};
171 const int nocc_act() const { return nocc_ - nfzc_;};
172 const int nfzc() const { return nfzc_;};
173 const int nvir() const { return vir_space_->rank();};
174 const int nvir_act() const { return act_vir_space_->rank();};
175 const int nfzv() const { return nfzv_;};
176
177 LinearR12::ABSMethod abs_method() const { return abs_method_; };
178
180 Ref<MOIndexSpace> mo_space() const { return mo_space_; };
182 Ref<MOIndexSpace> obs_space() const { return obs_space_; };
184 Ref<MOIndexSpace> act_occ_space() const { return act_occ_space_; };
186 Ref<MOIndexSpace> act_vir_space() const { return act_vir_space_; };
188 Ref<MOIndexSpace> occ_space() const { return occ_space_; };
190 Ref<MOIndexSpace> occ_space_symblk() const { return occ_space_symblk_; };
192 Ref<MOIndexSpace> vir_space() const { return vir_space_; };
194 Ref<MOIndexSpace> vir_space_symblk() const { return vir_space_symblk_; };
196 Ref<MOIndexSpace> abs_space() const { return abs_space_; };
198 Ref<MOIndexSpace> ribs_space() const { return ribs_space_; };
200 Ref<MOIntsTransformFactory> tfactory() const { return tfactory_; };
201
203 static Ref<MOIndexSpace> orthog_comp(const Ref<MOIndexSpace>& space1, const Ref<MOIndexSpace>& space2,
204 const std::string& name, double lindep_tol);
207 static Ref<MOIndexSpace> orthogonalize(const std::string& name, const Ref<GaussianBasisSet>& bs, const Ref<Integral>& integral,
208 OverlapOrthog::OrthogMethod orthog_method, double lindep_tol,
209 int& nlindep);
210
213 static Ref<MOIndexSpace> gen_project(const Ref<MOIndexSpace>& space1, const Ref<MOIndexSpace>& space2,
214 const std::string& name, double lindep_tol);
215
217 static void compute_overlap_ints(const Ref<MOIndexSpace>& space1,
218 const Ref<MOIndexSpace>& space2,
219 RefSCMatrix& S);
221 static void compute_multipole_ints(const Ref<MOIndexSpace>& space1,
222 const Ref<MOIndexSpace>& space2,
223 RefSCMatrix& MX,
224 RefSCMatrix& MY,
225 RefSCMatrix& MZ,
226 RefSCMatrix& MXX,
227 RefSCMatrix& MYY,
228 RefSCMatrix& MZZ);
229
230 };
231
232 }
233
234 #endif
235
236 // Local Variables:
237 // mode: c++
238 // c-file-style: "CLJ"
239 // End:
240
241