Exemplo n.º 1
0
/** This should be moved to branch engine */
bool EstimatorManager::put(MCWalkerConfiguration& W, QMCHamiltonian& H, xmlNodePtr cur)
{
  vector<string> extra;
  cur = cur->children;
  while(cur != NULL)
  {
    string cname((const char*)(cur->name));
    if(cname == "estimator")
    {
      string est_name(MainEstimatorName);
      string use_hdf5("yes");
      OhmmsAttributeSet hAttrib;
      hAttrib.add(est_name, "name");
      hAttrib.add(use_hdf5, "hdf5");
      hAttrib.put(cur);
      if( (est_name == MainEstimatorName) || (est_name=="elocal") )
      {
        max4ascii=H.sizeOfObservables()+3;
        add(new LocalEnergyEstimator(H,use_hdf5=="yes"),MainEstimatorName);
      }
      else
        extra.push_back(est_name);
    }
    cur = cur->next;
  }
  if(Estimators.empty())
  {
    app_log() << "  Adding a default LocalEnergyEstimator for the MainEstimator " << endl;
    max4ascii=H.sizeOfObservables()+3;
    add(new LocalEnergyEstimator(H,true),MainEstimatorName);
  }
  //Collectables is special and should not be added to Estimators
  if(Collectables == 0 && H.sizeOfCollectables())
  {
    app_log() << "  Using CollectablesEstimator for collectables, e.g. sk, gofr, density " << endl;
    Collectables=new CollectablesEstimator(H);
  }
  return true;
}
Exemplo n.º 2
0
  /** This should be moved to branch engine */
  bool EstimatorManager::put(MCWalkerConfiguration& W, QMCHamiltonian& H, xmlNodePtr cur) 
  {
    vector<string> extra;
    cur = cur->children;
    while(cur != NULL) 
    {
      string cname((const char*)(cur->name));
      if(cname == "estimator") 
      {
        string est_name(MainEstimatorName);
        string use_hdf5("yes");
        OhmmsAttributeSet hAttrib;
        hAttrib.add(est_name, "name");
        hAttrib.add(use_hdf5, "hdf5");
        hAttrib.put(cur);
        if( (est_name == MainEstimatorName) || (est_name=="elocal") )
        {
          if(use_hdf5 == "yes")
          {
            max4ascii=H.size()+3;//write only physical energies
            add(new LocalEnergyEstimatorHDF(H),MainEstimatorName);
          }
          else
          {//fall back to the ascii file
            max4ascii=H.sizeOfObservables()+3;
            add(new LocalEnergyEstimator(H),MainEstimatorName);
          }
        }
        else if (est_name=="WFMConly")
        {
          max4ascii=H.sizeOfObservables()+10;
          app_log() << "  Using WFMConly for the MainEstimator " << endl;
          add(new WFMCOnlyEstimator(H),MainEstimatorName);
          est_name=MainEstimatorName;
        }
        else if (est_name=="releasednode")
        { 
          int Smax(100);
          int primary(1);
          OhmmsAttributeSet hAttrib;
          hAttrib.add(Smax, "Smax");
          hAttrib.add(primary, "primary");
          hAttrib.put(cur);
        
          max4ascii=H.sizeOfObservables()+ 4 + 3*(Smax+1);
          app_log() << "  Using ReleasedNode for the MainEstimator with Smax="<<Smax<<" and max4ascii="<<max4ascii << endl;
          if (primary==2) add(new ReleasedNodeEnergyEstimator(H,Smax),MainEstimatorName);
          else add(new AlternateReleasedNodeEnergyEstimator(H,Smax),MainEstimatorName);
          est_name=MainEstimatorName;
        }
        else if (est_name=="forwardwalking")
        {
          max4ascii=2*H.sizeOfObservables()+4;
          app_log() << "  Doing forwardwalking on hdf5 " << endl;
          add(new ForwardWalkingEstimator(H),MainEstimatorName);
          est_name=MainEstimatorName;
        }        else 
          extra.push_back(est_name);
      } 
      cur = cur->next;
    }

    if(Estimators.empty()) 
    {
      app_log() << "  Adding a default LocalEnergyEstimator for the MainEstimator " << endl;
      max4ascii=H.sizeOfObservables()+3;
      add(new LocalEnergyEstimator(H),MainEstimatorName);
      //add(new LocalEnergyOnlyEstimator(),MainEstimatorName);
    } 

    if(Collectables == 0 && H.sizeOfCollectables())
    {
      app_log() << "  Using CollectablesEstimator for collectables, e.g. sk, gofr, density " << endl;
      Collectables=new CollectablesEstimator(H);
      add(Collectables,"collectables");
    }
    return true;
  }
Exemplo n.º 3
0
 CollectablesEstimator::CollectablesEstimator(QMCHamiltonian& h)
   : refH(h)
 { 
   scalars.resize(h.sizeOfCollectables());
   scalars_saved.resize(h.sizeOfCollectables());
 }