sisi4s
Loading...
Searching...
No Matches
ParenthesisTriples.hpp
Go to the documentation of this file.
1#ifndef PARENTHESIS_TRIPLES
2#define PARENTHESIS_TRIPLES
3
5
6namespace sisi4s {
10struct IJKPointer {
11 double *i, *j, *k;
12};
13
14template <typename F>
16 std::vector<int64_t> lens;
17 int64_t order;
18 std::vector<F> data;
19 // A move constructor should be created automatically by the compiler
20 IrmlerTensor(std::vector<int64_t> lens_, int64_t order_, std::vector<F> data_)
21 : lens(lens_)
22 , order(order_)
23 , data(data_) {}
24};
25
26template <typename F>
28 static const int64_t NO_REF = -1;
29 std::array<IrmlerTensor<F> *, 3> tensors;
30 std::array<int64_t, 3> refs;
32 auto *p = std::find(refs.begin(), refs.end(), r);
33 // if (p == refs.size()) {/* panic */}
34 const int64_t idx(std::distance(refs.begin(), p));
35 return tensors[idx];
36 }
38 : tensors({nullptr, nullptr, nullptr})
39 , refs({NO_REF, NO_REF, NO_REF}) {}
40};
41
43public:
45 ParenthesisTriples(std::vector<Argument> const &argumentList);
46 virtual ~ParenthesisTriples();
50 virtual void run();
51
55 virtual void dryRun();
56
57protected:
58 int64_t No, Nv, NG;
59 int64_t NvCube;
60 double *Tabc;
61 double *Zabc;
62 double *scratch;
63 double *Tabij, *Tai;
64 double *epsi, *epsa;
65 double *Vabij, *Vhphh, *Vppph = nullptr;
66 double *Vpppijk = nullptr;
67 double *realGab = nullptr, *imagGab = nullptr, *realGai = nullptr,
68 *imagGai = nullptr;
69 bool particleDiagram = true, holeDiagram = true;
70 double
71 getEnergy(const double epsijk, const double *Tabc_, const double *Zabc_);
72 void doublesContribution(const std::array<int64_t, 3> &ijk,
73 IJKPointer integralContainer,
74 double *scratchV,
75 double *scratchO,
76 double *output);
77 void singlesContribution(const std::array<int64_t, 3> &ijk,
78 double *scratchO,
79 double *output);
80 void getVpppijkFromVertex(const std::array<int64_t, 3> &ijk,
81 double *scratchO,
82 double *output);
83
84 IJKPointer getVpppijkOnTheFly(const std::array<int64_t, 3> &ijk,
85 VectorTensor<double> &vtensor);
86};
87} // namespace sisi4s
88
89#endif
#define ALGORITHM_REGISTRAR_DECLARATION(NAME)
Auxiliary macro declaring the algorithm registrar for the algorithm type of the given name....
Definition Algorithm.hpp:169
Definition Algorithm.hpp:26
Definition ParenthesisTriples.hpp:42
int64_t NvCube
Definition ParenthesisTriples.hpp:59
void doublesContribution(const std::array< int64_t, 3 > &ijk, IJKPointer integralContainer, double *scratchV, double *scratchO, double *output)
Definition ParenthesisTriples.cxx:302
int64_t Nv
Definition ParenthesisTriples.hpp:58
virtual void run()
Calculates perturbative triples correction, third attemp.
Definition ParenthesisTriples.cxx:701
double * Vppph
Definition ParenthesisTriples.hpp:65
double * Tai
Definition ParenthesisTriples.hpp:63
double * realGai
Definition ParenthesisTriples.hpp:67
double * Vabij
Definition ParenthesisTriples.hpp:65
double * realGab
Definition ParenthesisTriples.hpp:67
double * Tabc
Definition ParenthesisTriples.hpp:60
void singlesContribution(const std::array< int64_t, 3 > &ijk, double *scratchO, double *output)
Definition ParenthesisTriples.cxx:515
double * scratch
Definition ParenthesisTriples.hpp:62
double * epsa
Definition ParenthesisTriples.hpp:64
double * imagGai
Definition ParenthesisTriples.hpp:68
double * epsi
Definition ParenthesisTriples.hpp:64
virtual void dryRun()
Dry run for perturbative triples correction, third attemp.
Definition ParenthesisTriples.cxx:925
double * Vhphh
Definition ParenthesisTriples.hpp:65
double * Vpppijk
Definition ParenthesisTriples.hpp:66
bool particleDiagram
Definition ParenthesisTriples.hpp:69
IJKPointer getVpppijkOnTheFly(const std::array< int64_t, 3 > &ijk, VectorTensor< double > &vtensor)
Definition ParenthesisTriples.cxx:644
int64_t NG
Definition ParenthesisTriples.hpp:58
double * Zabc
Definition ParenthesisTriples.hpp:61
double * Tabij
Definition ParenthesisTriples.hpp:63
double * imagGab
Definition ParenthesisTriples.hpp:67
void getVpppijkFromVertex(const std::array< int64_t, 3 > &ijk, double *scratchO, double *output)
Definition ParenthesisTriples.cxx:543
double getEnergy(const double epsijk, const double *Tabc_, const double *Zabc_)
Definition ParenthesisTriples.cxx:81
bool holeDiagram
Definition ParenthesisTriples.hpp:69
virtual ~ParenthesisTriples()
Definition ParenthesisTriples.cxx:23
int64_t No
Definition ParenthesisTriples.hpp:58
Definition Algorithm.hpp:10
Caclulates perturbative triples correction, third attemp.
Definition ParenthesisTriples.hpp:10
double * j
Definition ParenthesisTriples.hpp:11
double * k
Definition ParenthesisTriples.hpp:11
double * i
Definition ParenthesisTriples.hpp:11
Definition ParenthesisTriples.hpp:15
int64_t order
Definition ParenthesisTriples.hpp:17
std::vector< int64_t > lens
Definition ParenthesisTriples.hpp:16
std::vector< F > data
Definition ParenthesisTriples.hpp:18
IrmlerTensor(std::vector< int64_t > lens_, int64_t order_, std::vector< F > data_)
Definition ParenthesisTriples.hpp:20
Definition ParenthesisTriples.hpp:27
std::array< IrmlerTensor< F > *, 3 > tensors
Definition ParenthesisTriples.hpp:29
std::array< int64_t, 3 > refs
Definition ParenthesisTriples.hpp:30
static const int64_t NO_REF
Definition ParenthesisTriples.hpp:28
IrmlerTensor< F > * withReference(int64_t r)
Definition ParenthesisTriples.hpp:31
VectorTensor()
Definition ParenthesisTriples.hpp:37