MADNESS  0.10.1
operatorinfo.h
Go to the documentation of this file.
1 //
2 // Created by Florian Bischoff on 11/2/23.
3 //
4 
5 #ifndef MADNESS_OPERATORINFO_H
6 #define MADNESS_OPERATORINFO_H
7 
8 namespace madness {
9 
10 /// operator types
11 enum OpType {
13  OT_ONE, /// indicates the identity
14  OT_G12, /// 1/r
15  OT_SLATER, /// exp(-r)
16  OT_GAUSS, /// exp(-r2)
17  OT_F12, /// 1-exp(-r)
18  OT_FG12, /// (1-exp(-r))/r
19  OT_F212, /// (1-exp(-r))^2
20  OT_F2G12, /// (1-exp(-r))^2/r = 1/r + exp(-2r)/r - 2 exp(-r)/r
21  OT_BSH, /// exp(-r)/r
22  OT_SIZE /// for ending loops
23 };
24 
25 /// operator type to string
26 template<std::size_t N=1> // dummy template argument to avoid ambiguity with the other operator<<
27 std::ostream& operator<<(std::ostream& os, const OpType type) {
28  auto name = [](OpType type) {
29  switch (type) {
31  return "undefined";
32  case OpType::OT_ONE:
33  return "identity";
34  case OpType::OT_G12:
35  return "g12";
36  case OpType::OT_SLATER:
37  return "slater";
38  case OpType::OT_GAUSS:
39  return "gauss";
40  case OpType::OT_F12:
41  return "f12";
42  case OpType::OT_FG12:
43  return "fg12";
44  case OpType::OT_F212:
45  return "f12^2";
46  case OpType::OT_F2G12:
47  return "f12^2g";
48  case OpType::OT_BSH:
49  return "bsh";
50  default:
51  return "undefined";
52  }
53  };
54  os << name(type);
55  return os;
56 }
57 
58 struct OperatorInfo {
59  OperatorInfo() = default;
60  OperatorInfo(double mu, double lo, double thresh, OpType type) : mu(mu), lo(lo), thresh(thresh), type(type) { }
61  double mu=0.0; ///< some introspection
62  double lo=1.e-5;
63  double thresh=1.e-4;
64  OpType type=OT_UNDEFINED; ///< introspection
65  double hi=-1.0;
66  bool debug=false;
67 };
68 
69 
70 
71 }
72 #endif //MADNESS_OPERATORINFO_H
File holds all helper structures necessary for the CC_Operator and CC2 class.
Definition: DFParameters.h:10
std::ostream & operator<<(std::ostream &os, const particle< PDIM > &p)
Definition: lowrankfunction.h:397
OpType
operator types
Definition: operatorinfo.h:11
@ OT_FG12
1-exp(-r)
Definition: operatorinfo.h:18
@ OT_SLATER
1/r
Definition: operatorinfo.h:15
@ OT_GAUSS
exp(-r)
Definition: operatorinfo.h:16
@ OT_BSH
(1-exp(-r))^2/r = 1/r + exp(-2r)/r - 2 exp(-r)/r
Definition: operatorinfo.h:21
@ OT_SIZE
exp(-r)/r
Definition: operatorinfo.h:22
@ OT_ONE
Definition: operatorinfo.h:13
@ OT_F12
exp(-r2)
Definition: operatorinfo.h:17
@ OT_F212
(1-exp(-r))/r
Definition: operatorinfo.h:19
@ OT_UNDEFINED
Definition: operatorinfo.h:12
@ OT_G12
indicates the identity
Definition: operatorinfo.h:14
@ OT_F2G12
(1-exp(-r))^2
Definition: operatorinfo.h:20
std::string type(const PairType &n)
Definition: PNOParameters.h:18
std::string name(const FuncType &type, const int ex=-1)
Definition: ccpairfunction.h:28
Definition: operatorinfo.h:58
double hi
Definition: operatorinfo.h:65
double thresh
Definition: operatorinfo.h:63
bool debug
Definition: operatorinfo.h:66
OpType type
introspection
Definition: operatorinfo.h:64
double mu
some introspection
Definition: operatorinfo.h:61
OperatorInfo(double mu, double lo, double thresh, OpType type)
Definition: operatorinfo.h:60
double lo
Definition: operatorinfo.h:62