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 QMCRUN_H 00014 #define QMCRUN_H 00015 00016 #include <fstream> 00017 #include <list> 00018 #include <queue> 00019 00020 #include "QMCWalker.h" 00021 #include "QMCEquilibrationArray.h" 00022 #include "QMCProperties.h" 00023 #include "QMCStopwatches.h" 00024 #include "QMCHartreeFock.h" 00025 #include "QMCInitializeWalkerFactory.h" 00026 #include "QMCFunctionsFactory.h" 00027 00028 using namespace std; 00029 00035 class QMCRun 00036 { 00037 public: 00038 00039 ~QMCRun(); 00040 00044 QMCRun(); 00045 00050 void initialize(QMCInput *input); 00051 00057 void initializeFunction(); 00058 00062 void zeroOut(); 00063 00070 bool step(bool writeConfigs, int iteration); 00071 00076 QMCProperties * getProperties(); 00077 00084 QMCProperties * getTimeStepProperties(); 00085 00090 QMCPropertyArrays * getFWProperties(); 00091 00098 QMCPropertyArrays * getFWTimeStepProperties(); 00099 00103 void startTimers(); 00104 00108 void stopTimers(); 00109 00116 Stopwatch * getPropagationStopwatch(); 00117 00124 Stopwatch * getEquilibrationStopwatch(); 00125 00130 double getWeights(); 00131 00136 double getPopulationSizeBiasCorrectionFactor(); 00137 00142 int getNumberOfWalkers(); 00143 00149 void randomlyInitializeWalkers(); 00150 00155 void writeEnergies(ostream& strm); 00156 00161 void calculateElectronDensities(); 00162 00168 Array1D<double>* getPllSpinHistogram(); 00169 00175 Array1D<double>* getOppSpinHistogram(); 00176 00181 Array1D< Array1D<double> >* getAlphaHistograms(); 00182 00187 Array1D< Array1D<double> >* getBetaHistograms(); 00188 00193 Array1D< Array1D<double> >* getPllxCorrelationDiagram(); 00194 00199 Array1D< Array1D<double> >* getPllyCorrelationDiagram(); 00200 00205 Array1D< Array1D<double> >* getPllzCorrelationDiagram(); 00206 00211 Array1D< Array1D<double> >* getOppxCorrelationDiagram(); 00212 00217 Array1D< Array1D<double> >* getOppyCorrelationDiagram(); 00218 00223 Array1D< Array1D<double> >* getOppzCorrelationDiagram(); 00224 00228 double getdr(); 00229 00234 void toXML(ostream& strm); 00235 00241 bool readXML(istream& strm); 00242 00243 void updateHFPotential(); 00244 00245 private: 00246 00250 list<QMCWalker> wlist; 00251 00252 QMCFunctions * QMF; 00253 00257 QMCEquilibrationArray EquilibrationArray; 00258 00263 QMCProperties Properties; 00264 00269 QMCPropertyArrays fwProperties; 00270 00274 QMCProperties timeStepProperties; 00275 00280 QMCPropertyArrays fwTimeStepProperties; 00281 00285 QMCInput *Input; 00286 00292 double populationSizeBiasCorrectionFactor; 00293 00299 queue<double> correctionDivisor; 00300 00307 void unitWeightBranching(); 00308 00313 void nonunitWeightBranching(); 00314 00324 void ack_reconfiguration(); 00325 00337 void propagateWalkers(bool writeConfigs, int iteration); 00338 00342 void branchWalkers(); 00343 00348 void calculateObservables(); 00349 00357 void calculatePopulationSizeBiasCorrectionFactor(); 00358 00362 int growthRate; 00363 00368 double max_pair_distance; 00369 00373 double dr; 00374 00378 Array1D<double> pllSpinHistogram; 00379 00383 Array1D<double> oppSpinHistogram; 00384 00389 Array1D< Array1D<double> > alphaHistograms; 00390 00395 Array1D< Array1D<double> > betaHistograms; 00396 00400 Array1D< Array1D<double> > pllxCorrelationDiagram; 00401 00405 Array1D< Array1D<double> > pllyCorrelationDiagram; 00406 00410 Array1D< Array1D<double> > pllzCorrelationDiagram; 00411 00415 Array1D< Array1D<double> > oppxCorrelationDiagram; 00416 00420 Array1D< Array1D<double> > oppyCorrelationDiagram; 00421 00425 Array1D< Array1D<double> > oppzCorrelationDiagram; 00426 00430 QMCHartreeFock HartreeFock; 00431 }; 00432 00433 #endif