28 #ifndef _mpqc_src_lib_chemistry_qc_lcao_tbint_runtime_h
29 #define _mpqc_src_lib_chemistry_qc_lcao_tbint_runtime_h
32 #include <util/state/state.h>
33 #include <chemistry/qc/basis/intdescr.h>
34 #include <math/distarray4/distarray4.h>
35 #include <chemistry/qc/wfn/spin.h>
36 #include <chemistry/qc/lcao/transform_factory.h>
82 const std::string& key()
const {
return key_; }
83 const std::string& oper()
const {
return oper_; }
84 const std::string& params()
const {
return params_; }
87 static std::string key(
const std::string& oper,
88 const std::string& params);
90 template <
int NumCenters>
97 template<
int NumCenters>
147 "ParsedTwoBodyOperSetKey::create_descr() -- unknown oper",
164 const std::string& key()
const {
return key_; }
165 const std::string& bra1()
const {
return bra1_; }
166 const std::string& bra2()
const {
return bra2_; }
167 const std::string& ket1()
const {
return ket1_; }
168 const std::string& ket2()
const {
return ket2_; }
169 const std::string& oper()
const {
return oper_pkey_.oper(); }
170 const std::string& params()
const {
return oper_pkey_.params(); }
171 const std::string& layout()
const {
return layout_; }
174 static std::string key(
const std::string& bra1,
175 const std::string& bra2,
176 const std::string& ket1,
177 const std::string& ket2,
178 const std::string& oper,
179 const std::string& params,
180 const std::string& layout);
182 static std::string key(
const std::string& bra1,
183 const std::string& bra2,
184 const std::string& ket1,
185 const std::string& ket2,
186 const std::string& descr,
187 const std::string& layout);
191 std::string bra1_, bra2_, ket1_, ket2_;
201 const std::string& key()
const {
return pkey_.key(); }
202 const std::string& bra1()
const {
return pkey_.bra1(); }
203 const std::string& bra2()
const {
return pkey_.bra2(); }
204 const std::string& ket1()
const {
return pkey_.ket1(); }
205 const std::string& oper()
const {
return pkey_.oper(); }
206 const std::string& params()
const {
return pkey_.params(); }
209 static std::string key(
const std::string& bra1,
210 const std::string& bra2,
211 const std::string& ket1,
212 const std::string& oper,
213 const std::string& params);
215 static std::string key(
const std::string& bra1,
216 const std::string& bra2,
217 const std::string& ket1,
218 const std::string& descr);
230 const std::string& key()
const {
return pkey_.key(); }
231 const std::string& bra1()
const {
return pkey_.bra1(); }
232 const std::string& bra2()
const {
return pkey_.bra2(); }
233 const std::string& oper()
const {
return pkey_.oper(); }
234 const std::string& params()
const {
return pkey_.params(); }
237 static std::string key(
const std::string& bra1,
238 const std::string& bra2,
239 const std::string& oper,
240 const std::string& params);
242 static std::string key(
const std::string& bra1,
243 const std::string& bra2,
244 const std::string& descr);
261 operator std::string();
320 template <
int NumCenters>
339 const Params*
params()
const {
return const_cast<const Params*>(params_); }
341 void params(
const Params* p) { params_ = const_cast<Params*>(p); }
345 bool exists(
const std::string& key)
const;
353 TwoBodyIntEvalRef
get(
const std::string& key);
361 void remove_if(
const std::string& space_key);
375 const TwoBodyIntEvalRef& create_eval(
const std::string& key);
381 const std::string& params_key);
387 template <
int NumCenters>
389 TwoBodyMOIntsRuntime<NumCenters>::class_desc_(
typeid(this_type),
390 (std::string(
"TwoBodyMOIntsRuntime<") +
391 static_cast<char>(
'0' + NumCenters) +
392 std::string(
">")).c_str(),
394 "virtual public SavableState", 0, 0,
397 template <
int NumCenters>
398 TwoBodyMOIntsRuntime<NumCenters>::TwoBodyMOIntsRuntime(
const Ref<MOIntsTransformFactory>& f) : factory_(f),
399 evals_(EvalRegistry::instance()), params_(0)
403 template <
int NumCenters>
408 EvalRegistry::save_instance(evals_,so);
412 template <
int NumCenters>
417 template <
int NumCenters>
423 template <
int NumCenters>
431 return pkey.bra1() == space_key ||
432 pkey.bra2() == space_key ||
433 pkey.ket1() == space_key ||
434 pkey.ket2() == space_key;
436 std::string space_key;
443 return pkey.bra1() == space_key ||
444 pkey.bra2() == space_key ||
445 pkey.ket1() == space_key;
447 std::string space_key;
454 return pkey.bra1() == space_key ||
455 pkey.bra2() == space_key;
457 std::string space_key;
460 template <
int NumCenters>
464 evals_->remove_if(pred);
468 template <
int NumCenters>
472 return evals_->key_exists(key);
475 template <
int NumCenters>
476 typename TwoBodyMOIntsRuntime<NumCenters>::TwoBodyIntEvalRef
479 if (evals_->key_exists(key)) {
480 return evals_->value(key);
483 try { ParsedTwoBodyIntKey parsedkey(key); }
485 std::ostringstream oss;
486 oss <<
"TwoBodyMOIntsRuntime<NumCenters>::get() -- key " << key <<
" does not match the format";
490 const TwoBodyIntEvalRef& eval = create_eval(key);
496 template <
int NumCenters>
500 return ParsedTwoBodyOperSetKey::key<NumCenters>(descr);
503 template <
int NumCenters>
506 const std::string& params_key)
510 return ParsedTwoBodyOperSetKey::create_descr<NumCenters>(oper_key,p,integral);
515 typedef TwoBodyMOIntsRuntime<4> TwoBodyFourCenterMOIntsRuntime;
516 typedef TwoBodyMOIntsRuntime<3> TwoBodyThreeCenterMOIntsRuntime;
517 typedef TwoBodyMOIntsRuntime<2> TwoBodyTwoCenterMOIntsRuntime;
559 #endif // end of header guard
{eri, r12_0_g12, r12_m1_g12, g12t1g12, anti_g12g12}
Definition: operator.h:348
TwoBodyMOIntsRuntimeUnion23 packages 2-center and 3-center runtimes; it also keeps track of 2-center ...
Definition: tbint_runtime.h:523
static std::string key(const Ref< typename NCentersToIntDescr< NumCenters, 2 >::value > &descr)
computes key from the given TwoBodyOperSetDescr object
Definition: tbint_runtime.h:91
The RefSymmSCMatrix class is a smart pointer to an SCSymmSCMatrix specialization.
Definition: matrix.h:265
static Ref< typename NCentersToIntDescr< NumCenters, 2 >::value > create_descr(const std::string &operset_key, const Ref< IntParams > &p, const Ref< Integral > &integral)
this factory method constructs a descriptor given operator key + IntParams object + Integrals object
Definition: tbint_runtime.h:98
bool key_exists(const std::string &key) const
key exists?
this is a singleton registry that holds IntParams objects.
Definition: tbint_runtime.h:41
Parsed representation of a string key that represents a two-body operator set (TwoBodyOperSet + assoc...
Definition: tbint_runtime.h:77
Definition: intdescr.h:156
const Ref< MOIntsTransformFactory > & factory() const
returns the factory
Definition: tbint_runtime.h:364
The RefSCMatrix class is a smart pointer to an SCMatrix specialization.
Definition: matrix.h:135
A template class that maintains references counts.
Definition: ref.h:361
const Ref< KernelInverseRegistry > & runtime_2c_inv() const
runtime for 2-center integral matrix inverses
Definition: tbint_runtime.h:544
const Ref< TwoBodyThreeCenterMOIntsRuntime > & runtime_3c() const
runtime for 3-center integrals
Definition: tbint_runtime.h:542
bool exists(const std::string &key) const
Returns true if the given TwoBodyIntEval is available.
Definition: tbint_runtime.h:470
static std::string descr_key(const Ref< TwoBodyIntDescr > &descr)
Returns key that corresponds to descr.
Definition: tbint_runtime.h:498
void params(const Params *p)
set the params object
Definition: tbint_runtime.h:341
void save_data_state(StateOut &so)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
Definition: tbint_runtime.h:405
Definition: tbint_runtime.h:290
Smart runtime support for computing MO-basis integrals.
Definition: tbint_runtime.h:321
NonsingletonCreationPolicy is used to create non-Singletons on heap.
Definition: registry.h:73
{eri, r12, r12t1, r12t2}
Definition: operator.h:346
{r12_m1_g12}
Definition: operator.h:351
{g12p4g12_m_g12t1g12t1}
Definition: operator.h:349
std::string key(const Ref< IntParams > ¶ms) const
Returns key that describes params.
Parsed representation of a string key that represents a set of 4-center 2-body integrals.
Definition: tbint_runtime.h:160
Parsed representation of a string key that represents a set of 3-center 2-body integrals.
Definition: tbint_runtime.h:197
const Params * params() const
return the params object that determines optional aspects of behavior of the runtime
Definition: tbint_runtime.h:339
this class encapsulates objects needed to perform density fitting of a 4-center integral
Definition: df_runtime.h:235
{g12t1g12}
Definition: operator.h:352
This class is used to contain information about classes.
Definition: class.h:147
Definition: tbint_runtime.h:275
void add(const std::string &key, const Ref< IntParams > ¶ms) const
register key->params mapping
const Ref< MOIntsTransformFactory > & factory() const
factory for creating AO->MO transforms
Definition: tbint_runtime.h:538
static const Ref< ParamsRegistry > & instance()
this is a singleton
Parsed representation of a string key that represents a set of 2-center 2-body integrals.
Definition: tbint_runtime.h:226
this functor compares RefSymmSCMatrix objects.
Definition: matrix.h:537
TwoBodyThreeCenterMOIntsTransform computes (xy|z) integrals, using parallel integral-direct AO->MO tr...
Definition: transform_tbint.h:240
describes the physical layout of the integrals in TwoBodyIntsAcc
Definition: tbint_runtime.h:252
TwoBodyIntEvalRef get(const std::string &key)
Returns the TwoBodyIntEval that contains the integrals described by key.
Definition: tbint_runtime.h:477
{delta}
Definition: operator.h:353
{eri}
Definition: operator.h:345
SpinCase1 other(SpinCase1 S)
given 1-spin return the other 1-spin
void remove_if(const std::string &space_key)
removes all entries that contain this space
Definition: tbint_runtime.h:462
Implements descriptors for various two-body evaluators.
Definition: intdescr.h:93
Definition: stateout.h:71
Definition: tbint_runtime.h:303
void save_state(StateOut &)
Save the state of the object as specified by the StateOut object.
This is thrown when a situations arises that should be impossible.
Definition: scexception.h:92
{r12_0_g12}
Definition: operator.h:350
Base class for objects that can save/restore state.
Definition: state.h:45
Definition: tbint_runtime.h:424
The base class for all reference counted objects.
Definition: ref.h:192
TwoBodyMOIntsTransform computes two-body integrals in MO basis using parallel integrals-direct AO->MO...
Definition: transform_tbint.h:49
void clear()
erases all entries
void obsolete()
obsoletes this object
Definition: tbint_runtime.h:419
Contains all MPQC code up to version 3.
Definition: mpqcin.h:14
const Ref< TwoBodyTwoCenterMOIntsRuntime > & runtime_2c() const
runtime for 2-center integrals
Definition: tbint_runtime.h:540
Ref< IntParams > value(const std::string &key) const
Returns params that correspond to key.
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
useful as a dummy template argument
Definition: state.h:116
Registry wraps std::map and can be policy-configured to act as a Singleton or a regular object.
Definition: registry.h:112
{eri, r12_0_g12, r12_m1_g12, t1g12, t2g12, g12t1g12}
Definition: operator.h:347
this functor can be used as a binary predicate for standard algorithms.
Definition: ref.h:659
Generated at Sun Jan 26 2020 23:23:58 for MPQC
3.0.0-alpha using the documentation package Doxygen
1.8.16.