00001 // QMcBeaver 00002 // 00003 // Constructed by 00004 // 00005 // Michael Todd Feldmann 00006 // and 00007 // David Randall "Chip" Kent IV 00008 // 00009 // Copyright 2000. All rights reserved. 00010 // 00011 // drkent@users.sourceforge.net mtfeldmann@users.sourceforge.net 00012 00013 #ifndef QMCSCFJastrow_H 00014 #define QMCSCFJastrow_H 00015 00016 #include <iostream> 00017 #include <sstream> 00018 00019 #include "QMCFunctions.h" 00020 #include "QMCSlater.h" 00021 #include "QMCInput.h" 00022 #include "QMCJastrow.h" 00023 #include "QMCPotential_Energy.h" 00024 #include "QMCDouble.h" 00025 #include "QMCHartreeFock.h" 00026 #include "QMCConfigIO.h" 00027 #include "IeeeMath.h" 00028 #include "QMCNuclearForces.h" 00029 #include "QMCWalkerData.h" 00030 00031 using namespace std; 00032 00057 class QMCSCFJastrow : public QMCFunctions 00058 { 00059 public: 00063 QMCSCFJastrow(); 00064 00072 QMCSCFJastrow(QMCInput *input, QMCHartreeFock* HF); 00073 00080 QMCSCFJastrow(QMCInput *input); 00081 00088 QMCSCFJastrow(const QMCSCFJastrow & rhs ); 00089 00093 ~QMCSCFJastrow(); 00094 00100 void initialize(QMCInput *input, QMCHartreeFock *HF); 00101 00113 void evaluate(Array2D<double> &X, QMCWalkerData & data); 00114 void evaluate(Array1D<QMCWalkerData *> &walkerData, 00115 Array1D<Array2D<double> * > &xData, int num); 00116 00122 void operator=(const QMCSCFJastrow & rhs ); 00123 00124 private: 00125 QMCWalkerData * wd; 00126 Array2D<double> * x; 00127 int iWalker; 00128 00134 QMCSlater Alpha, Beta; 00135 QMCJastrow Jastrow; 00136 QMCPotential_Energy PE; 00137 QMCNuclearForces nf; 00138 00139 QMCDouble Psi; 00140 00141 double Laplacian_PsiRatio; 00142 00143 double E_Local; 00144 00153 Array1D<double> termPR; 00154 double** term_AlphaGrad; 00155 double** term_BetaGrad; 00156 00157 Array1D<double>* alphaPsi; 00158 Array3D<double>* alphaGrad; 00159 Array1D<double>* alphaLaplacian; 00160 00161 Array1D<double>* betaPsi; 00162 Array3D<double>* betaGrad; 00163 Array1D<double>* betaLaplacian; 00164 00165 Array2D<double>* JastrowGrad; 00166 00172 void calculate_Psi_quantities(); 00173 00174 void update_SCF(); 00175 00181 void calculate_CorrelatedSampling(Array1D<QMCWalkerData *> &walkerData, 00182 Array1D<Array2D<double> * > &xData, 00183 int num); 00184 00190 void calculate_Modified_Grad_PsiRatio(); 00191 00199 void calculate_JastrowDerivatives(int & ai); 00200 00208 void calculate_CIDerivatives(int & ai); 00209 00217 void calculate_OrbitalDerivatives(int & ai); 00218 00240 void checkParameterDerivatives(); 00241 00248 QMCDouble getPsi() 00249 { 00250 return Psi; 00251 } 00252 00266 double getLocalEnergy() 00267 { 00268 return E_Local; 00269 } 00270 00276 double getKineticEnergy() 00277 { 00278 return -0.5 * Laplacian_PsiRatio; 00279 } 00280 00286 double getPotentialEnergy(int whichWalker) 00287 { 00288 return PE.getEnergy(whichWalker); 00289 } 00290 00291 double getEnergyEE(int whichWalker) 00292 { 00293 return PE.getEnergyEE(whichWalker); 00294 } 00295 00296 double getEnergyNE(int whichWalker) 00297 { 00298 return PE.getEnergyNE(whichWalker); 00299 } 00300 00306 void calculate_E_Local(int whichWalker) 00307 { 00308 E_Local = -0.5 * Laplacian_PsiRatio + PE.getEnergy(whichWalker); 00309 } 00310 00318 bool isSingular(int whichWalker); 00319 }; 00320 00321 #endif 00322 00323 00324 00325 00326