20 #ifndef HEFF_CHEMPS2_H 21 #define HEFF_CHEMPS2_H 24 #include "TensorOperator.h" 32 #include "SyBookkeeper.h" 70 double SolveDAVIDSON(
Sobject * denS,
TensorL *** Ltensors,
TensorOperator **** Atensors,
TensorOperator **** Btensors,
TensorOperator **** Ctensors,
TensorOperator **** Dtensors,
TensorS0 **** S0tensors,
TensorS1 **** S1tensors,
TensorF0 **** F0tensors,
TensorF1 **** F1tensors,
TensorQ *** Qtensors,
TensorX ** Xtensors,
int nLower = 0,
double ** VeffTilde = NULL)
const;
75 static int phase(
const int TwoTimesPower){
return (((TwoTimesPower/2)%2)!=0)?-1:1; }
89 void makeHeff(
double * memS,
double * memHeff,
const Sobject * denS,
TensorL *** Ltensors,
TensorOperator **** Atensors,
TensorOperator **** Btensors,
TensorOperator **** Ctensors,
TensorOperator **** Dtensors,
TensorS0 **** S0tensors,
TensorS1 **** S1tensors,
TensorF0 **** F0tensors,
TensorF1 **** F1tensors,
TensorQ *** Qtensors,
TensorX ** Xtensors,
int nLower,
double ** VeffTilde)
const;
95 double SolveDAVIDSON_main(
Sobject * denS,
TensorL *** Ltensors,
TensorOperator **** Atensors,
TensorOperator **** Btensors,
TensorOperator **** Ctensors,
TensorOperator **** Dtensors,
TensorS0 **** S0tensors,
TensorS1 **** S1tensors,
TensorF0 **** F0tensors,
TensorF1 **** F1tensors,
TensorQ *** Qtensors,
TensorX ** Xtensors,
int nLower,
double ** VeffTilde)
const;
98 double SolveDAVIDSON_help(
Sobject * denS,
TensorL *** Ltensors,
TensorOperator **** Atensors,
TensorOperator **** Btensors,
TensorOperator **** Ctensors,
TensorOperator **** Dtensors,
TensorS0 **** S0tensors,
TensorS1 **** S1tensors,
TensorF0 **** F0tensors,
TensorF1 **** F1tensors,
TensorQ *** Qtensors,
TensorX ** Xtensors,
int nLower,
double ** VeffTilde)
const;
101 void addDiagram1A(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorX * Xleft)
const;
102 void addDiagram1B(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorX * Xright)
const;
103 void addDiagram1C(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
double Helem_links)
const;
104 void addDiagram1D(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
double Helem_rechts)
const;
105 void addDiagramExcitations(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
int nLower,
double ** VeffTilde)
const;
108 void addDiagram2a1spin0(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator **** Atensors,
TensorS0 **** S0tensors,
double * workspace)
const;
109 void addDiagram2a2spin0(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator **** Atensors,
TensorS0 **** S0tensors,
double * workspace)
const;
110 void addDiagram2a1spin1(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator **** Btensors,
TensorS1 **** S1tensors,
double * workspace)
const;
111 void addDiagram2a2spin1(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator **** Btensors,
TensorS1 **** S1tensors,
double * workspace)
const;
112 void addDiagram2a3spin0(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator **** Ctensors,
TensorF0 **** F0tensors,
double * workspace)
const;
113 void addDiagram2a3spin1(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator **** Dtensors,
TensorF1 **** F1tensors,
double * workspace)
const;
114 void addDiagram2b1and2b2(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator * Atensor)
const;
115 void addDiagram2c1and2c2(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator * Atensor)
const;
116 void addDiagram2dall(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS)
const;
117 void addDiagram2e1and2e2(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator * Atensor)
const;
118 void addDiagram2f1and2f2(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator * Atensor)
const;
119 void addDiagram2b3spin0(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator * Ctensor)
const;
120 void addDiagram2c3spin0(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator * Ctensor)
const;
121 void addDiagram2e3spin0(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator * Ctensor)
const;
122 void addDiagram2f3spin0(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator * Ctensor)
const;
123 void addDiagram2b3spin1(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator * Dtensor)
const;
124 void addDiagram2c3spin1(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator * Dtensor)
const;
125 void addDiagram2e3spin1(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator * Dtensor)
const;
126 void addDiagram2f3spin1(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator * Dtensor)
const;
129 void addDiagram3Aand3D(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorQ * Qleft,
TensorL ** Lleft,
double * temp)
const;
130 void addDiagram3Band3I(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorQ * Qleft,
TensorL ** Lleft,
double * temp)
const;
131 void addDiagram3C(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorQ ** Qleft,
TensorL ** Lright,
double * temp)
const;
132 void addDiagram3Eand3H(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS)
const;
133 void addDiagram3Kand3F(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorQ * Qright,
TensorL ** Lright,
double * temp)
const;
134 void addDiagram3Land3G(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorQ * Qright,
TensorL ** Lright,
double * temp)
const;
135 void addDiagram3J(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorQ ** Qright,
TensorL ** Lleft,
double * temp)
const;
138 void addDiagram4A1and4A2spin0(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator * Atens)
const;
139 void addDiagram4A1and4A2spin1(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator * Btens)
const;
140 void addDiagram4A3and4A4spin0(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator * Ctens)
const;
141 void addDiagram4A3and4A4spin1(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator * Dtens)
const;
142 void addDiagram4B1and4B2spin0(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator *** Aleft,
TensorL ** Lright,
double * temp)
const;
143 void addDiagram4B1and4B2spin1(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator *** Bleft,
TensorL ** Lright,
double * temp)
const;
144 void addDiagram4B3and4B4spin0(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator *** Cleft,
TensorL ** Lright,
double * temp)
const;
145 void addDiagram4B3and4B4spin1(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator *** Dleft,
TensorL ** Lright,
double * temp)
const;
146 void addDiagram4C1and4C2spin0(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator *** Aleft,
TensorL ** Lright,
double * temp)
const;
147 void addDiagram4C1and4C2spin1(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator *** Bleft,
TensorL ** Lright,
double * temp)
const;
148 void addDiagram4C3and4C4spin0(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator *** Cleft,
TensorL ** Lright,
double * temp)
const;
149 void addDiagram4C3and4C4spin1(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator *** Dleft,
TensorL ** Lright,
double * temp)
const;
150 void addDiagram4D(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorL ** Lleft,
double * temp)
const;
151 void addDiagram4E(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorL ** Lleft,
TensorL ** Lright,
double * temp,
double * temp2)
const;
152 void addDiagram4F(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorL ** Lright,
double * temp)
const;
153 void addDiagram4G(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorL ** Lright,
double * temp)
const;
154 void addDiagram4H(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorL ** Lleft,
TensorL ** Lright,
double * temp,
double * temp2)
const;
155 void addDiagram4I(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorL ** Lleft,
double * temp)
const;
156 void addDiagram4J1and4J2spin0(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator * Aright)
const;
157 void addDiagram4J1and4J2spin1(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator * Bright)
const;
158 void addDiagram4J3and4J4spin0(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator * Cright)
const;
159 void addDiagram4J3and4J4spin1(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorOperator * Dright)
const;
160 void addDiagram4K1and4K2spin0(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorL ** Lleft,
TensorOperator *** Aright,
double * temp)
const;
161 void addDiagram4L1and4L2spin0(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorL ** Lleft,
TensorOperator *** Aright,
double * temp)
const;
162 void addDiagram4K1and4K2spin1(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorL ** Lleft,
TensorOperator *** Bright,
double * temp)
const;
163 void addDiagram4L1and4L2spin1(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorL ** Lleft,
TensorOperator *** Bright,
double * temp)
const;
164 void addDiagram4K3and4K4spin0(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorL ** Lleft,
TensorOperator *** Cright,
double * temp)
const;
165 void addDiagram4L3and4L4spin0(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorL ** Lleft,
TensorOperator *** Cright,
double * temp)
const;
166 void addDiagram4K3and4K4spin1(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorL ** Lleft,
TensorOperator *** Dright,
double * temp)
const;
167 void addDiagram4L3and4L4spin1(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorL ** Lleft,
TensorOperator *** Dright,
double * temp)
const;
170 void addDiagram5A(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorL ** Lleft,
TensorL ** Lright,
double * temp,
double * temp2)
const;
171 void addDiagram5B(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorL ** Lleft,
TensorL ** Lright,
double * temp,
double * temp2)
const;
172 void addDiagram5C(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorL ** Lleft,
TensorL ** Lright,
double * temp,
double * temp2)
const;
173 void addDiagram5D(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorL ** Lleft,
TensorL ** Lright,
double * temp,
double * temp2)
const;
174 void addDiagram5E(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorL ** Lleft,
TensorL ** Lright,
double * temp,
double * temp2)
const;
175 void addDiagram5F(
const int ikappa,
double * memS,
double * memHeff,
const Sobject * denS,
TensorL ** Lleft,
TensorL ** Lright,
double * temp,
double * temp2)
const;
178 void addDiagonal1A(
const int ikappa,
double * memHeffDiag,
const Sobject * denS,
TensorX * Xleft)
const;
179 void addDiagonal1B(
const int ikappa,
double * memHeffDiag,
const Sobject * denS,
TensorX * Xright)
const;
180 void addDiagonal1C(
const int ikappa,
double * memHeffDiag,
const Sobject * denS,
const double Helem_links)
const;
181 void addDiagonal1D(
const int ikappa,
double * memHeffDiag,
const Sobject * denS,
const double Helem_rechts)
const;
182 void addDiagonal2d3all(
const int ikappa,
double * memHeffDiag,
const Sobject * denS)
const;
183 void addDiagonal2b3spin0(
const int ikappa,
double * memHeffDiag,
const Sobject * denS,
TensorOperator * Ctensor)
const;
184 void addDiagonal2c3spin0(
const int ikappa,
double * memHeffDiag,
const Sobject * denS,
TensorOperator * Ctensor)
const;
185 void addDiagonal2e3spin0(
const int ikappa,
double * memHeffDiag,
const Sobject * denS,
TensorOperator * Ctensor)
const;
186 void addDiagonal2f3spin0(
const int ikappa,
double * memHeffDiag,
const Sobject * denS,
TensorOperator * Ctensor)
const;
187 void addDiagonal2b3spin1(
const int ikappa,
double * memHeffDiag,
const Sobject * denS,
TensorOperator * Dtensor)
const;
188 void addDiagonal2c3spin1(
const int ikappa,
double * memHeffDiag,
const Sobject * denS,
TensorOperator * Dtensor)
const;
189 void addDiagonal2e3spin1(
const int ikappa,
double * memHeffDiag,
const Sobject * denS,
TensorOperator * Dtensor)
const;
190 void addDiagonal2f3spin1(
const int ikappa,
double * memHeffDiag,
const Sobject * denS,
TensorOperator * Dtensor)
const;
191 void addDiagonal2a3spin0(
const int ikappa,
double * memHeffDiag,
const Sobject * denS,
TensorOperator **** Ctensors,
TensorF0 **** F0tensors)
const;
192 void addDiagonal2a3spin1(
const int ikappa,
double * memHeffDiag,
const Sobject * denS,
TensorOperator **** Dtensors,
TensorF1 **** F1tensors)
const;
193 void addDiagonalExcitations(
const int ikappa,
double * memHeffDiag,
const Sobject * denS,
int nLower,
double ** VeffTilde)
const;
Heff(const SyBookkeeper *denBKIn, const Problem *ProbIn, const double dvdson_rtol_in)
Constructor.
virtual ~Heff()
Destructor.
double SolveDAVIDSON(Sobject *denS, TensorL ***Ltensors, TensorOperator ****Atensors, TensorOperator ****Btensors, TensorOperator ****Ctensors, TensorOperator ****Dtensors, TensorS0 ****S0tensors, TensorS1 ****S1tensors, TensorF0 ****F0tensors, TensorF1 ****F1tensors, TensorQ ***Qtensors, TensorX **Xtensors, int nLower=0, double **VeffTilde=NULL) const
Davidson Solver.
static int phase(const int TwoTimesPower)
Phase function.