MPQC  3.0.0-alpha
transform_factory.h
1 //
2 // transform_factory.h
3 //
4 // Copyright (C) 2004 Edward Valeev
5 //
6 // Author: Edward Valeev <evaleev@vt.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 #ifndef _chemistry_qc_lcao_transformfactory_h
29 #define _chemistry_qc_lcao_transformfactory_h
30 
31 #include <string>
32 #include <util/ref/ref.h>
33 #include <util/group/memory.h>
34 #include <chemistry/molecule/energy.h>
35 #include <chemistry/qc/basis/integral.h>
36 #include <chemistry/qc/basis/intdescr.h>
37 #include <chemistry/qc/wfn/orbitalspace.h>
38 #include <chemistry/qc/lcao/transform.h>
39 
40 namespace sc {
41 
48  public:
52 
54  bool data_persistent() const
55  {
56  return data_persistent_;
57  }
58  void data_persistent(bool data_persistent_)
59  {
60  this->data_persistent_ = data_persistent_;
61  }
62 
63  private:
64  bool data_persistent_;
65  };
66 
67 class TwoBodyMOIntsTransform;
68 class TwoBodyThreeCenterMOIntsTransform;
69 class DensityFittingInfo;
70 namespace detail {
71  template <bool DF> struct MakeTwoBodyTransform;
72 };
73 
76 class MOIntsTransformFactory : virtual public SavableState {
77 
78  public:
80 
81 private:
82 
85 
86  Ref<MolecularEnergy> top_mole_; // Top-level molecular energy to enable checkpointing
87 
88  Ref<Integral> integral_;
89  Ref<MessageGrp> msg_;
90  Ref<MemoryGrp> mem_;
91  Ref<ThreadGrp> thr_;
92 
93  Ref<TwoBodyIntDescr> tbintdescr_;
94 
96  Ref<AOSpaceRegistry> aoreg_;
97  Ref<OrbitalSpace> space1_;
98  Ref<OrbitalSpace> space2_;
99  Ref<OrbitalSpace> space3_;
100  Ref<OrbitalSpace> space4_;
101  DensityFittingInfo* df_info_;
102 
103  CreateTransformHints hints_;
104  bool dynamic_;
105  double print_percent_;
106  int debug_;
107  MOIntsTransform::StoreMethod::type ints_method_;
108  std::string file_prefix_;
109  double log2_precision_; //< numerical precision of the integrals
110 
111  template <typename TransformType> Ref<TwoBodyMOIntsTransform>
112  twobody_transform(const std::string& name,
113  const Ref<TwoBodyIntDescr>& descrarg);
114  template <typename TransformType> Ref<TwoBodyThreeCenterMOIntsTransform>
115  twobody_transform(const std::string& name,
116  const Ref<TwoBodyThreeCenterIntDescr>& descrarg);
117 
118  // this class helps to form correct transform constructor calls
119  template <bool DF> friend struct sc::detail::MakeTwoBodyTransform;
120 
121 public:
122 
126 
127  void save_data_state(StateOut&);
128 
130  void obsolete();
131 
134  const Ref<OrbitalSpace>& space3 = 0, const Ref<OrbitalSpace>& space4 = 0);
136  const DensityFittingInfo* df_info() const { return const_cast<const DensityFittingInfo*>(df_info_); }
137  void df_info(const DensityFittingInfo* i) { df_info_ = const_cast<DensityFittingInfo*>(i); }
138 
140  void set_top_mole(const Ref<MolecularEnergy>& top_mole) { top_mole_ = top_mole; }
142  void tbintdescr(const Ref<TwoBodyIntDescr>& descr) { tbintdescr_ = descr; }
144  void set_ints_method(const MOIntsTransform::StoreMethod::type method) { ints_method_ = method; }
146  void set_file_prefix(const std::string& prefix) { file_prefix_ = prefix; }
147  void set_debug(int debug);
148  void set_print_percent(double print_percent);
149  void set_dynamic(bool dynamic) { dynamic_ = dynamic; }
154  void set_log2_precision(double prec) { log2_precision_ = prec; }
155 
157  Ref<MemoryGrp> mem() const { return mem_; }
159  Ref<MessageGrp> msg() const { return msg_; }
161  const Ref<Integral>& integral() const { return integral_; }
163  const Ref<OrbitalSpaceRegistry>& orbital_registry() const { return oreg_; }
165  const Ref<AOSpaceRegistry>& ao_registry() const { return aoreg_; }
167  Ref<TwoBodyIntDescr> tbintdescr() const { return tbintdescr_; }
169  MOIntsTransform::StoreMethod::type ints_method() const { return ints_method_; }
170  const CreateTransformHints& hints() const { return hints_; }
171  CreateTransformHints& hints() { return hints_; }
173  std::string file_prefix() const { return file_prefix_; }
174  int debug() const { return debug_; }
175  double print_percent() const { return print_percent_; }
176  bool dynamic() const { return dynamic_; }
181  double log2_precision() const { return log2_precision_; }
182 
184  Ref<OrbitalSpace> space1() const;
186  Ref<OrbitalSpace> space2() const;
188  Ref<OrbitalSpace> space3() const;
190  Ref<OrbitalSpace> space4() const;
191 
195  twobody_transform_13(const std::string& id, const Ref<TwoBodyIntDescr>& descr = 0);
196 
200  twobody_transform_12(const std::string& id, const Ref<TwoBodyIntDescr>& descr = 0);
201 
202 #if 1
203 
206  twobody_transform(StorageType storage, const std::string& id,
207  const Ref<TwoBodyIntDescr>& descr = 0);
208 #endif
209 
212  const std::string& name,
213  const Ref<TwoBodyIntDescr>& descrarg);
216  const std::string& name,
217  const Ref<TwoBodyThreeCenterIntDescr>& descrarg);
218 
219 };
220 
221 }
222 
223 #include <chemistry/qc/lcao/transform_tbint.h>
224 
225 #endif
226 
227 // Local Variables:
228 // mode: c++
229 // c-file-style: "CLJ"
230 // End:
231 
232 
sc::MOIntsTransformFactory::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::MOIntsTransformFactory::space1
Ref< OrbitalSpace > space1() const
Returns OrbitalSpace object 1.
sc::MOIntsTransformFactory::set_file_prefix
void set_file_prefix(const std::string &prefix)
Sets the name of the file to hold the integrals.
Definition: transform_factory.h:146
sc::MOIntsTransformFactory
MOIntsTransformFactory is a factory that produces MOIntsTransform objects.
Definition: transform_factory.h:76
sc::MOIntsTransformFactory::twobody_transform_12
Ref< TwoBodyMOIntsTransform > twobody_transform_12(const std::string &id, const Ref< TwoBodyIntDescr > &descr=0)
Creates an TwoBodyMOIntsTransform object that will compute (pq|rs) integrals stored in rs blocks for ...
sc::MOIntsTransformFactory::space3
Ref< OrbitalSpace > space3() const
Returns OrbitalSpace object 3.
sc::Ref
A template class that maintains references counts.
Definition: ref.h:361
sc::MOIntsTransform::StorageType
StorageType
How integrals are stored. Type_13 means (ix|jy) integrals are stored as (ij|xy)
Definition: transform.h:41
sc::MOIntsTransform::TwoBodyTransformType
TwoBodyTransformType
enumerates all known 4-center transform types
Definition: transform.h:44
sc::MOIntsTransformFactory::file_prefix
std::string file_prefix() const
Sets the name of the file to hold the integrals.
Definition: transform_factory.h:173
sc::MOIntsTransformFactory::obsolete
void obsolete()
obsolete this object
sc::DensityFittingInfo
this class encapsulates objects needed to perform density fitting of a 4-center integral
Definition: df_runtime.h:235
sc::MOIntsTransformFactory::twobody_transform_13
Ref< TwoBodyMOIntsTransform > twobody_transform_13(const std::string &id, const Ref< TwoBodyIntDescr > &descr=0)
Creates an TwoBodyMOIntsTransform object that will compute (pq|rs) integrals stored in qs blocks for ...
sc::StateIn
Definition: statein.h:79
sc::MOIntsTransformFactory::integral
const Ref< Integral > & integral() const
Returns the Integral factory.
Definition: transform_factory.h:161
sc::MOIntsTransformFactory::set_top_mole
void set_top_mole(const Ref< MolecularEnergy > &top_mole)
Specifies the top-level MolecularEnergy object to use for checkpointing.
Definition: transform_factory.h:140
sc::MOIntsTransformFactory::df_info
const DensityFittingInfo * df_info() const
provides the DensityFittingInfo object
Definition: transform_factory.h:136
sc::CreateTransformHints
Provides hints to the constructors of a Transform class that help configure its implementation.
Definition: transform_factory.h:47
sc::CreateTransformHints::data_persistent
bool data_persistent() const
will this transform's data need to be used multiple times?
Definition: transform_factory.h:54
sc::other
SpinCase1 other(SpinCase1 S)
given 1-spin return the other 1-spin
sc::MOIntsTransformFactory::tbintdescr
Ref< TwoBodyIntDescr > tbintdescr() const
Returns the default TwoBodyIntDescr used to produce integrals.
Definition: transform_factory.h:167
sc::TwoBodyNCenterIntDescr
Implements descriptors for various two-body evaluators.
Definition: intdescr.h:93
sc::StateOut
Definition: stateout.h:71
sc::MOIntsTransformFactory::set_spaces
void set_spaces(const Ref< OrbitalSpace > &space1, const Ref< OrbitalSpace > &space2=0, const Ref< OrbitalSpace > &space3=0, const Ref< OrbitalSpace > &space4=0)
Sets the orbital spaces.
sc::MOIntsTransformFactory::tbintdescr
void tbintdescr(const Ref< TwoBodyIntDescr > &descr)
Changes the default TwoBodyIntDescr used to produce integrals.
Definition: transform_factory.h:142
sc::MOIntsTransformFactory::ao_registry
const Ref< AOSpaceRegistry > & ao_registry() const
returns the AOSpaceRegistry
Definition: transform_factory.h:165
sc::MOIntsTransformFactory::set_ints_method
void set_ints_method(const MOIntsTransform::StoreMethod::type method)
Sets the method of storing transformed MO integrals. Default method is mem_posix.
Definition: transform_factory.h:144
sc::detail::MakeTwoBodyTransform
Definition: transform_factory.h:71
sc::MOIntsTransformFactory::msg
Ref< MessageGrp > msg() const
Returns the MessageGrp object.
Definition: transform_factory.h:159
sc::MOIntsTransformFactory::ints_method
MOIntsTransform::StoreMethod::type ints_method() const
Returns the method of storing transformed MO integrals.
Definition: transform_factory.h:169
sc::SavableState
Base class for objects that can save/restore state.
Definition: state.h:45
sc::MOIntsTransformFactory::mem
Ref< MemoryGrp > mem() const
Returns the MemoryGrp object.
Definition: transform_factory.h:157
sc::MOIntsTransformFactory::space4
Ref< OrbitalSpace > space4() const
Returns OrbitalSpace object 4.
sc::MOIntsTransformFactory::log2_precision
double log2_precision() const
Definition: transform_factory.h:181
sc::MOIntsTransformFactory::orbital_registry
const Ref< OrbitalSpaceRegistry > & orbital_registry() const
returns the OrbitalSpaceRegistry
Definition: transform_factory.h:163
sc
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
sc::MOIntsTransformFactory::set_log2_precision
void set_log2_precision(double prec)
Definition: transform_factory.h:154
sc::MOIntsTransformFactory::space2
Ref< OrbitalSpace > space2() const
Returns OrbitalSpace object 2.

Generated at Sun Jan 26 2020 23:23:58 for MPQC 3.0.0-alpha using the documentation package Doxygen 1.8.16.