当前位置: 首页>>代码示例>>C++>>正文


C++ QMCHamiltonian::add方法代码示例

本文整理汇总了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);
*/
}
开发者ID:digideskio,项目名称:qmcpack,代码行数:67,代码来源:qmc.cpp


注:本文中的QMCHamiltonian::add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。