本文整理汇总了C++中QMCHamiltonian::add方法的典型用法代码示例。如果您正苦于以下问题:C++ QMCHamiltonian::add方法的具体用法?C++ QMCHamiltonian::add怎么用?C++ QMCHamiltonian::add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QMCHamiltonian
的用法示例。
在下文中一共展示了QMCHamiltonian::add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char **argv) {
int nblocks = 10;
int nsteps = 10000;
int nup = 1;
int ndown = 1;
int nw = 1;
RealType Tau = 0.01;
int iargc = 0;
while(iargc<argc) {
if(!strcmp(argv[iargc],"--blocks")) {
nblocks = atoi(argv[++iargc]);
} else if(!strcmp(argv[iargc],"--steps")) {
nsteps = atoi(argv[++iargc]);
} else if(!strcmp(argv[iargc],"--walkers")) {
nw = atoi(argv[++iargc]);
} else if(!strcmp(argv[iargc],"--up")) {
nup = atoi(argv[++iargc]);
} else if(!strcmp(argv[iargc],"--down")) {
ndown = atoi(argv[++iargc]);
} else if(!strcmp(argv[iargc],"--tau")) {
Tau = atof(argv[++iargc]);
}
iargc++;
}
Random.init(0,1,0);
DOMProcessor reader(argv[1]);
MCWalkerConfiguration el;
initQuantumParticle(el,reader);
///create ions
ParticleBase ion;
ion.create(1);
ion.R[0] = 0.0;
IndexType iee = DistanceTable::add(el,"ee");
IndexType iei = DistanceTable::add(ion,el,"ie");
///create a trial wave function
TrialWaveFunction Psi;
initTrialWaveFunction(Psi,reader);
nup = el.last(0);
QMCHamiltonian H;
DistanceTableData* d_ee = DistanceTable::getTable(iee);
DistanceTableData* d_ei = DistanceTable::getTable(iei);
H.add(new CoulombPotential(el.getTotalNum()), d_ei);
H.add(new HartreePotential, d_ee);
H.add(new BareKineticEnergy, NULL);
EstimatorManager Estimators;
Estimators.reset("vmc");
VMC vmc(el,Psi,H,Estimators);
vmc.initialize(nw);
vmc.run(nblocks,nsteps,Tau);
/*
Estimators.reset("dmc");
DMC dmc(el,Psi,H,Estimators);
dmc.run(nblocks,nsteps,Tau);
*/
}