MPQC  2.3.1
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_;
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:
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 
sc::R12IntEvalInfo::tfactory
Ref< MOIntsTransformFactory > tfactory() const
Returns the MOIntsTransformFactory object.
Definition: vxb_eval_info.h:200
sc::R12IntEvalInfo::compute_overlap_ints
static void compute_overlap_ints(const Ref< MOIndexSpace > &space1, const Ref< MOIndexSpace > &space2, RefSCMatrix &S)
Compute overlap matrices in the basis of space1 and space2.
sc::R12IntEvalInfo::obs_space
Ref< MOIndexSpace > obs_space() const
Returns the MOIndexSpace object for energy-sorted MOs in OBS.
Definition: vxb_eval_info.h:182
sc::R12IntEvalInfo::basis_vir
Ref< GaussianBasisSet > basis_vir() const
Returns the virtuals basis set (VBS) object.
Definition: vxb_eval_info.h:155
sc::R12IntEvalInfo::set_ints_method
void set_ints_method(const StoreMethod method)
Sets the method of storing transformed MO integrals.
Definition: vxb_eval_info.h:138
sc::MBPT2_R12
The MBPT2_R12 class implements several linear R12 second-order perturbation theory methods.
Definition: mbptr12.h:61
sc::OverlapOrthog::OrthogMethod
OrthogMethod
An enum for the types of orthogonalization.
Definition: orthog.h:42
sc::RefSCMatrix
The RefSCMatrix class is a smart pointer to an SCMatrix specialization.
Definition: matrix.h:135
sc::R12IntEvalInfo::mo_space
Ref< MOIndexSpace > mo_space() const
Returns the MOIndexSpace object for symmetry-blocked MOs in OBS.
Definition: vxb_eval_info.h:180
sc::Ref
A template class that maintains references counts.
Definition: ref.h:332
sc::R12IntEvalInfo::compute_multipole_ints
static void compute_multipole_ints(const Ref< MOIndexSpace > &space1, const Ref< MOIndexSpace > &space2, RefSCMatrix &MX, RefSCMatrix &MY, RefSCMatrix &MZ, RefSCMatrix &MXX, RefSCMatrix &MYY, RefSCMatrix &MZZ)
Compute electric dipole and quadrupole moment matrices in the basis of space1 and space2.
sc::R12IntEvalInfo::ribs_space
Ref< MOIndexSpace > ribs_space() const
Returns the MOIndexSpace object for RI-BS.
Definition: vxb_eval_info.h:198
sc::Wavefunction
A Wavefunction is a MolecularEnergy that utilizies a GaussianBasisSet.
Definition: wfn.h:48
sc::R12IntEvalInfo::vir_space_symblk
Ref< MOIndexSpace > vir_space_symblk() const
Returns the MOIndexSpace object for all unoccupied MOs ordered by symmetry.
Definition: vxb_eval_info.h:194
sc::R12IntEvalInfo::abs_space
Ref< MOIndexSpace > abs_space() const
Returns the MOIndexSpace object for ABS.
Definition: vxb_eval_info.h:196
sc::R12IntEvalInfo::set_dynamic
void set_dynamic(bool dynamic)
Sets whether to use dynamic load balancing in parallel MO transformations.
Definition: vxb_eval_info.h:131
sc::R12IntEvalInfo::basis_ri
Ref< GaussianBasisSet > basis_ri() const
Returns the resolution-of-the-identity basis set (RIBS) object.
Definition: vxb_eval_info.h:157
sc::StateIn
Restores objects that derive from SavableState.
Definition: statein.h:70
sc::R12IntEvalInfo::StoreMethod
StoreMethod
Describes the method of storing transformed MO integrals. See MBPT2_R12.
Definition: vxb_eval_info.h:58
sc::R12IntEvalInfo::set_absmethod
void set_absmethod(LinearR12::ABSMethod abs_method)
Sets the ABS approach to be used (ABS or CABS).
sc::R12IntEvalInfo::set_print_percent
void set_print_percent(double print_percent)
Sets how frequently updates of progress are printed out. Default is 10%.
Definition: vxb_eval_info.h:133
sc::R12IntEvalInfo::set_ints_file
void set_ints_file(const std::string &filename)
Sets name of the file used to store transformed integrals.
Definition: vxb_eval_info.h:141
sc::R12IntEvalInfo::basis
Ref< GaussianBasisSet > basis() const
Returns the orbital basis set (OBS) object.
Definition: vxb_eval_info.h:153
sc::R12IntEvalInfo::act_occ_space
Ref< MOIndexSpace > act_occ_space() const
Returns the MOIndexSpace object for the active occupied MOs.
Definition: vxb_eval_info.h:184
sc::StateOut
Serializes objects that derive from SavableState.
Definition: stateout.h:61
sc::R12IntEvalInfo::orthog_comp
static Ref< MOIndexSpace > orthog_comp(const Ref< MOIndexSpace > &space1, const Ref< MOIndexSpace > &space2, const std::string &name, double lindep_tol)
Compute subspace of space2 which is orthogonal complement to space1.
sc::R12IntEvalInfo::gen_project
static Ref< MOIndexSpace > gen_project(const Ref< MOIndexSpace > &space1, const Ref< MOIndexSpace > &space2, const std::string &name, double lindep_tol)
Project space1 on space2.
sc::R12IntEvalInfo::set_debug_level
void set_debug_level(int debug)
Set debug level. Default is 0.
Definition: vxb_eval_info.h:135
sc::SavableState
Base class for objects that can save/restore state.
Definition: state.h:46
sc::R12IntEvalInfo::occ_space_symblk
Ref< MOIndexSpace > occ_space_symblk() const
Returns the MOIndexSpace object for all occupied MOs symmetry-blocked.
Definition: vxb_eval_info.h:190
sc::R12IntEvalInfo::save_data_state
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
sc::R12IntEvalInfo::set_memory
void set_memory(const size_t nbytes)
Sets the amount of memory to use for the calculation.
sc::R12IntEvalInfo::occ_space
Ref< MOIndexSpace > occ_space() const
Returns the MOIndexSpace object for all occupied MOs sorted by energy.
Definition: vxb_eval_info.h:188
sc::R12IntEvalInfo
Class R12IntEvalInfo contains information necessary for R12 intermediate evaluators.
Definition: vxb_eval_info.h:53
sc::R12IntEvalInfo::vir_space
Ref< MOIndexSpace > vir_space() const
Returns the MOIndexSpace object for all unoccupied MOs ordered by energy.
Definition: vxb_eval_info.h:192
sc::R12IntEvalInfo::act_vir_space
Ref< MOIndexSpace > act_vir_space() const
Returns the MOIndexSpace object for the active unoccupied MOs.
Definition: vxb_eval_info.h:186
sc::R12IntEvalInfo::orthogonalize
static Ref< MOIndexSpace > orthogonalize(const std::string &name, const Ref< GaussianBasisSet > &bs, const Ref< Integral > &integral, OverlapOrthog::OrthogMethod orthog_method, double lindep_tol, int &nlindep)
Compute span of bs and create corresponding mospace referred to by name.

Generated at Sun Jan 26 2020 23:33:05 for MPQC 2.3.1 using the documentation package Doxygen 1.8.16.