00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef QMCSLATER_H
00033 #define QMCSLATER_H
00034
00035 #include <iostream>
00036
00037 #include "Array1D.h"
00038 #include "Array2D.h"
00039 #include "Array3D.h"
00040 #include "Array4D.h"
00041 #include "QMCInput.h"
00042 #include "Stopwatch.h"
00043 #include "QMCElectronNucleusCusp.h"
00044 #include "svdcmp.h"
00045 #include "QMCWalkerData.h"
00046
00047 #ifdef QMC_GPU
00048 #include "GPUQMCMatrix.h"
00049 #include "GPUQMCBasisFunction.h"
00050 #endif
00051
00052 using namespace std;
00053
00063 class QMCSlater
00064 {
00065 public:
00069 QMCSlater();
00070
00074 ~QMCSlater();
00075
00086 void initialize(QMCInput *input, int startEl, int stopEl, bool isAlpha);
00087
00100 void evaluate(Array1D<Array2D<double>*> & X,
00101 int num, int start, int whichE);
00102
00111 void update_Ds(Array1D<QMCWalkerData *> & walkerData);
00112
00129 template <class T>
00130 bool calculate_DerivativeRatios(int ci, int row,
00131 Array2D<double> & psi,
00132 Array2D<double> & inv,
00133 Array2D<T> & lap,
00134 Array2D<T> & gradx,
00135 Array2D<T> & grady,
00136 Array2D<T> & gradz,
00137 Array1D<double> & det,
00138 Array3D<double> & gradPR,
00139 Array1D<double> & lapPR);
00140
00141 #ifdef QMC_GPU
00142
00143
00144
00145
00146
00147
00148 void gpuEvaluate(Array1D<Array2D<double>*> &X, int num);
00149 #endif
00150
00151
00160 Array1D<double>* getPsi(int i);
00161
00169 Array3D<double>* getGradPsiRatio(int i);
00170
00178 Array1D<double>* getLaplacianPsiRatio(int i);
00179
00184 Array2D<double> * get_p_a(int walker, int ci)
00185 {
00186 return & (p_a(walker))(ci);
00187 }
00188
00193 Array2D<double> * get_p2_xa(int walker, int ci, int el, int xyz)
00194 {
00195 return & (p2_xa(walker))(ci,el,xyz);
00196 }
00197
00202 Array2D<double> * get_p3_xxa(int walker, int ci)
00203 {
00204 return & (p3_xxa(walker))(ci);
00205 }
00206
00212 Array1D<double>* getChiDensity(int i);
00213
00218 bool isSingular(int i);
00219
00224 void operator=(const QMCSlater & rhs );
00225
00226 #ifdef QMC_GPU
00227 GPUQMCBasisFunction gpuBF;
00228 GPUQMCMatrix gpuMatMult;
00229 #endif
00230
00231 private:
00236 bool isAlpha;
00237
00238 QMCInput *Input;
00239 QMCBasisFunction *BF;
00240 QMCWavefunction *WF;
00241
00246 Array1D< Array1D< Array2D<double> > > p_a;
00247 Array1D< Array3D< Array2D<double> > > p2_xa;
00248 Array1D< Array1D< Array2D<double> > > p3_xxa;
00249
00254 int Start;
00255 int Stop;
00256
00257 QMCElectronNucleusCusp ElectronNucleusCusp;
00258
00267 Array1D< Array2D<qmcfloat> > Xw;
00268 Array1D< Array1D< Array2D<qmcfloat> > > Xw_x;
00269 Array1D< Array2D<qmcfloat> > Xw_xx;
00270 Array1D< Array1D<double> > Xw_Density;
00271
00283 Array2D< double > * ciDet;
00284 Array1D< Array2D<qmcfloat> > Dw;
00285 Array2D< Array2D<qmcfloat> > Dw_x;
00286 Array1D< Array2D<qmcfloat> > Dw_xx;
00287 Array2D< Array2D<double> > Dwc_inv;
00288
00299 Array1D< Array1D<double> > Dwc;
00300 Array1D< Array3D<double> > rDwc_x;
00301 Array1D< Array1D<double> > rDwc_xx;
00302 Array1D< Array1D<bool> > Singular;
00303
00322 Array1D< Array1D<double> * > pointer_Dwc;
00323 Array1D< Array3D<double> * > pointer_rDwc_x;
00324 Array1D< Array1D<double> * > pointer_rDwc_xx;
00325
00326 #ifdef QMC_GPU
00327
00335 Array1D< Array2D<float> > gpu_Dw;
00336 Array2D< Array2D<float> > gpu_Dw_inv;
00337 Array1D< Array2D<float> > gpu_Dw_xx;
00338 Array2D< Array2D<float> > gpu_Dw_x;
00339
00345 Array2D< Array2D<float>* > resultsCollector;
00346 #endif
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358 void allocateIteration(int whichE, int & start, int & stop);
00359
00360 void allocate();
00361
00368 int getNumberElectrons()
00369 {
00370 return Stop-Start+1;
00371 }
00372 };
00373
00374 #endif
00375