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


C++ MCWalkerConfiguration::first方法代码示例

本文整理汇总了C++中MCWalkerConfiguration::first方法的典型用法代码示例。如果您正苦于以下问题:C++ MCWalkerConfiguration::first方法的具体用法?C++ MCWalkerConfiguration::first怎么用?C++ MCWalkerConfiguration::first使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MCWalkerConfiguration的用法示例。


在下文中一共展示了MCWalkerConfiguration::first方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

void
initialize(TrialWaveFunction& Psi, MCWalkerConfiguration& el,
           ParticleBase& ion) {

    enum {Up = 0, Down};

    ///add a distance table for ee IndexTypeeractions
    IndexType iee = DistanceTable::add(el,"ee");
    DistanceTableData* d_ee = DistanceTable::getTable(iee);
    ///add a distance table for ie interactions
    int iei = DistanceTable::add(ion,el,"ie");
    DistanceTableData* d_ei = DistanceTable::getTable(iei);

    ///create molecular orbital
    MolecularOrbitals<SlaterTypeOrbitals_t> *MO =
        new MolecularOrbitals<SlaterTypeOrbitals_t>;

    AtomicOrbitalBuilder<SlaterTypeOrbitals_t> orbitalbuilder;
    for(int iat=0; iat<ion.getTotalNum(); iat++) {
        orbitalbuilder.add("He",*MO);
    }
    MO->setTable(d_ei);

    typedef SlaterDeterminant<MolecularOrbitals<SlaterTypeOrbitals_t> > Det_t;
    Det_t *DetU = new Det_t(*MO,el.first(Up));
    DetU->set(el.first(Up),el.last(Up)-el.first(Up));

    Det_t* DetD = new Det_t(*MO,el.first(Down));
    DetD->set(el.first(Down),el.last(Down)-el.first(Down));

    LinearSlaterDeterminant<MolecularOrbitals<SlaterTypeOrbitals_t> >
    *asymmpsi
        = new LinearSlaterDeterminant<MolecularOrbitals<SlaterTypeOrbitals_t> >;

    asymmpsi->add(DetU);
    asymmpsi->add(DetD);

    Psi.add(asymmpsi,d_ei);

    /*
    OneBodyJastrow<PadeJastrow<ValueType>,FastWalkerIndex> *Jie
      = new OneBodyJastrow<PadeJastrow<ValueType>,FastWalkerIndex>;
    Jie->F.push_back(PadeJastrow<ValueType>(1.0,1.0));
    Psi.add(Jie,d_ei);
    */

    TwoBodyJastrow<PadeJastrow<ValueType>,FastWalkerIndex> *Jee
        = new TwoBodyJastrow<PadeJastrow<ValueType>,FastWalkerIndex>;

    Jee->F.push_back(PadeJastrow<double>(0.5,1.0));
    Jee->F.push_back(PadeJastrow<double>(1.0/6.0,1.0));
    Jee->F.push_back(PadeJastrow<double>(1.0/6.0,1.0));
    Jee->F.push_back(PadeJastrow<double>(0.5,1.0));
    Psi.add(Jee,d_ee);

}
开发者ID:svn2github,项目名称:qmcpack,代码行数:56,代码来源:HeWaveFunctionBuilder.cpp


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