예제 #1
0
TrialWaveFunction::RealType TrialWaveFunction::registerData(ParticleSet& P, PooledData<RealType>& buf)
{
  delta_G.resize(P.getTotalNum());
  delta_L.resize(P.getTotalNum());
  P.G = 0.0;
  P.L = 0.0;
  //save the current position
  BufferCursor=buf.current();
  ValueType logpsi(0.0);
  PhaseValue=0.0;
  vector<OrbitalBase*>::iterator it(Z.begin());
  vector<OrbitalBase*>::iterator it_end(Z.end());
  for (; it!=it_end; ++it)
  {
    logpsi += (*it)->registerData(P,buf);
    PhaseValue += (*it)->PhaseValue;
  }
  convert(logpsi,LogValue);
  //LogValue=real(logpsi);
//append current gradients and laplacians to the buffer
  NumPtcls = P.getTotalNum();
  TotalDim = PosType::Size*NumPtcls;
  buf.add(PhaseValue);
  buf.add(LogValue);
  buf.add(&(P.G[0][0]), &(P.G[0][0])+TotalDim);
  buf.add(&(P.L[0]), &(P.L[P.getTotalNum()]));
  return LogValue;
}
예제 #2
0
  TrialWaveFunction::RealType
  TrialWaveFunction::registerData(ParticleSet& P, PooledData<RealType>& buf) {
    delta_G.resize(P.getTotalNum());
    delta_L.resize(P.getTotalNum());

    P.G = 0.0;
    P.L = 0.0;

    ValueType logpsi(0.0);
    PhaseValue=0.0;
    vector<OrbitalBase*>::iterator it(Z.begin());
    vector<OrbitalBase*>::iterator it_end(Z.end());
    for(;it!=it_end; ++it)
    {
      logpsi += (*it)->registerData(P,buf);
      PhaseValue += (*it)->PhaseValue;
    }

    LogValue=real(logpsi);

    //append current gradients and laplacians to the buffer
    NumPtcls = P.getTotalNum();
    TotalDim = PosType::Size*NumPtcls;

    buf.add(&(P.G[0][0]), &(P.G[0][0])+TotalDim);
    buf.add(&(P.L[0]), &(P.L[P.getTotalNum()]));

    return LogValue;
//     cout << "Registering gradients and laplacians " << endl;
//     for(int i=0; i<P.getLocalNum(); i++) {
//       cout << P.G[i] << " " << P.L[i] << endl;
//     }
  }
예제 #3
0
 LRTwoBodyJastrow::ValueType 
   LRTwoBodyJastrow::evaluate(ParticleSet& P, PooledData<RealType>& buf) {
     buf.put(Rhok.first_address(), Rhok.last_address());
     buf.put(U.first_address(), U.last_address());
     buf.put(d2U.first_address(), d2U.last_address());
     buf.put(FirstAddressOfdU,LastAddressOfdU);
     return LogValue;
   }
예제 #4
0
 LRTwoBodyJastrow::ValueType 
   LRTwoBodyJastrow::registerData(ParticleSet& P, PooledData<RealType>& buf) {
     LogValue=evaluateLog(P,P.G,P.L); 
     buf.add(Rhok.first_address(), Rhok.last_address());
     buf.add(U.first_address(), U.last_address());
     buf.add(d2U.first_address(), d2U.last_address());
     buf.add(FirstAddressOfdU,LastAddressOfdU);
     return LogValue;
   }
예제 #5
0
 void SpaceWarp::copyFromBuffer(PooledData<RealType>& buf) {
   vector<ParticleSet*>::iterator pit(PtclRefs.begin()), pit_end(PtclRefs.end());
   while(pit != pit_end) {
     RealType* first=&((**pit).R[0][0]);
     buf.get(first,first+SizeOfR);
     ++pit;
   }
   buf.get(one_ptcl_Jacob.begin(),one_ptcl_Jacob.end());
 }
예제 #6
0
void TrialWaveFunction::copyFromBuffer(ParticleSet& P, PooledData<RealType>& buf)
{
  buf.rewind(BufferCursor);
  //TAU_PROFILE("TrialWaveFunction::copyFromBuffer","(P,..)", TAU_USER);
  for (int i=0; i<Z.size(); i++)
    Z[i]->copyFromBuffer(P,buf);
  //get the gradients and laplacians from the buffer
  buf.get(PhaseValue);
  buf.get(LogValue);
  buf.get(&(P.G[0][0]), &(P.G[0][0])+TotalDim);
  buf.get(&(P.L[0]), &(P.L[0])+NumPtcls);
}
예제 #7
0
  void TrialWaveFunction::copyFromBuffer(ParticleSet& P, PooledData<RealType>& buf) {

    for(int i=0; i<Z.size(); i++) Z[i]->copyFromBuffer(P,buf);

    //get the gradients and laplacians from the buffer
    buf.get(&(P.G[0][0]), &(P.G[0][0])+TotalDim);
    buf.get(&(P.L[0]), &(P.L[0])+NumPtcls);

//     cout << "Checking out gradients and laplacians " << endl;
//     for(int i=0; i<P.getLocalNum(); i++) {
//       cout << P.G[i] << " " << P.L[i] << endl;
//     }
  }
예제 #8
0
  AGPDeterminant::ValueType 
  AGPDeterminant::registerData(ParticleSet& P, PooledData<RealType>& buf) {

    evaluateLogAndStore(P);

    P.G += myG;
    P.L += myL;

    //copy psiM to temporary
    psiM_temp = psiM;

    if(UseBuffer) 
    {  //add the data: determinant, inverse, gradient and laplacians
      buf.add(CurrentDet);
      buf.add(psiM.begin(),psiM.end());
      buf.add(phiT.begin(),phiT.end());
      buf.add(d2psiU.begin(),d2psiU.end());
      buf.add(d2psiD.begin(),d2psiD.end());
      buf.add(FirstAddressOfdVU,LastAddressOfdVU);
      buf.add(FirstAddressOfdVD,LastAddressOfdVD);
      buf.add(d2Y.begin(),d2Y.end());
      buf.add(FirstAddressOfdY,LastAddressOfdY);
      buf.add(FirstAddressOfG,LastAddressOfG);
      buf.add(myL.first_address(), myL.last_address());
      //buf.add(myL.begin(), myL.end());
    }

    return LogValue = evaluateLogAndPhase(CurrentDet,PhaseValue);
  }
예제 #9
0
  AGPDeterminant::ValueType 
  AGPDeterminant::updateBuffer(ParticleSet& P, PooledData<RealType>& buf,
      bool fromscratch) {

    evaluateLogAndStore(P);

    P.G += myG;
    P.L += myL;

    if(UseBuffer) {
      buf.put(CurrentDet);
      buf.put(psiM.begin(),psiM.end());
      buf.put(phiT.begin(),phiT.end());
      buf.put(d2psiU.begin(),d2psiU.end());
      buf.put(d2psiD.begin(),d2psiD.end());
      buf.put(FirstAddressOfdVU,LastAddressOfdVU);
      buf.put(FirstAddressOfdVD,LastAddressOfdVD);
      buf.put(d2Y.begin(),d2Y.end());
      buf.put(FirstAddressOfdY,LastAddressOfdY);
      buf.put(FirstAddressOfG,LastAddressOfG);
      buf.put(myL.first_address(), myL.last_address());
      //buf.put(myL.begin(), myL.end());
    }

    return CurrentDet;
  }
예제 #10
0
 TrialWaveFunction::RealType
 TrialWaveFunction::evaluateLog(ParticleSet& P, PooledData<RealType>& buf) 
 {
   LogValue=0.0;
   PhaseValue=0.0;
   for(int i=0; i<Z.size(); i++) 
   {
     LogValue += Z[i]->evaluateLog(P,buf);
     PhaseValue += Z[i]->PhaseValue;
   }
   buf.put(&(P.G[0][0]), &(P.G[0][0])+TotalDim);
   buf.put(&(P.L[0]), &(P.L[0])+NumPtcls);
   return real(LogValue);
 }
예제 #11
0
  void SpaceWarp::registerData(vector<ParticleSet*>& plist, PooledData<RealType>& buf) {
    if(PtclRefs.empty()) {
      SizeOfR=plist[0]->getTotalNum()*OHMMS_DIM;
      for(int ipsi=0; ipsi<npsi; ipsi++){
        PtclRefs.push_back(plist[ipsi]);
      }
    }

    for(int ipsi=0; ipsi<npsi; ipsi++){
      RealType* first=&(plist[ipsi]->R[0][0]);
      buf.add(first,first+SizeOfR);
    }
    buf.add(one_ptcl_Jacob.begin(),one_ptcl_Jacob.end());
  }
예제 #12
0
void
TrialWaveFunction::evaluateDeltaLog(ParticleSet& P
                                    , RealType& logpsi_fixed_r, RealType& logpsi_opt_r
                                    , ParticleSet::ParticleGradient_t& fixedG
                                    , ParticleSet::ParticleLaplacian_t& fixedL
                                    , PooledData<RealType>& buf)
{
  //TAU_PROFILE("TrialWaveFunction::evaluateDeltaLog","ParticleSet& P", TAU_USER);
  P.G = 0.0;
  P.L = 0.0;
  fixedG = 0.0;
  fixedL = 0.0;
  ValueType logpsi_fixed(0.0);
  ValueType logpsi_opt(0.0);
  buf.rewind();
  vector<OrbitalBase*>::iterator it(Z.begin());
  vector<OrbitalBase*>::iterator it_end(Z.end());
  for (; it!=it_end; ++it)
  {
    if ((*it)->Optimizable)
      logpsi_opt += (*it)->evaluateLog(P, P.G, P.L,buf,true);
    else
      logpsi_fixed += (*it)->evaluateLog(P, fixedG, fixedL,buf,true);
  }
  P.G += fixedG;
  P.L += fixedL;
  convert(logpsi_fixed,logpsi_fixed_r);
  convert(logpsi_opt,logpsi_opt_r);
  //logpsi_fixed_r = real(logpsi_fixed);
  //logpsi_opt_r = real(logpsi_opt);
}
예제 #13
0
TrialWaveFunction::RealType TrialWaveFunction::evaluateDeltaLog(ParticleSet& P, PooledData<RealType>& buf)
{
  P.G = 0.0;
  P.L = 0.0;
  ValueType logpsi(0.0);
  PhaseValue=0.0;
  buf.rewind();
  vector<OrbitalBase*>::iterator it(Z.begin());
  vector<OrbitalBase*>::iterator it_end(Z.end());
  for (; it!=it_end; ++it)
  {
// mmorales: I don't remember if I did this, but eliminating the "if ((*it)->Optimizable)"
//           forces everything to be evaluated. This was probably done because for optm with the
//           nonlocal component in the cost function, the slater determinant might not be optimizable
//           but this must be called anyway to load the inverse. CHECK CHECK CHECK, FIX FIX FIX
    if ((*it)->Optimizable)
    {
      logpsi += (*it)->evaluateLog(P, P.G, P.L,buf,false);
      PhaseValue += (*it)->PhaseValue;
    }
    else
//          ValueType x = (*it)->evaluateLog(P, P.G, P.L,buf,false);
      (*it)->copyFromDerivativeBuffer(P,buf);//keep buffer synched
  }
  convert(logpsi,LogValue);
  return LogValue;
  //return LogValue=real(logpsi);
}
예제 #14
0
RNDiracDeterminantBase::RealType
RNDiracDeterminantBase::evaluateLog(ParticleSet& P, PooledData<RealType>& buf)
{
  buf.put(psiM.first_address(),psiM.last_address());
  buf.put(FirstAddressOfdV,LastAddressOfdV);
  buf.put(d2psiM.first_address(),d2psiM.last_address());
  buf.put(myL.first_address(), myL.last_address());
  buf.put(FirstAddressOfG,LastAddressOfG);
  buf.put(LogValue);
  buf.put(alternateLogValue);
  buf.put(alternatePhaseValue);
  return LogValue;
}
예제 #15
0
  void 
  ThreeBodyGeminal::copyFromBuffer(ParticleSet& P, PooledData<RealType>& buf) {
    buf.get(LogValue);
    buf.get(V.begin(), V.end());

    buf.get(Y.begin(), Y.end());
    buf.get(FirstAddressOfdY,LastAddressOfdY);
    buf.get(d2Y.begin(),d2Y.end());

    buf.get(Uk.begin(), Uk.end());
    buf.get(FirstAddressOfgU,LastAddressOfgU);
    buf.get(d2Uk.begin(), d2Uk.end());
  }
예제 #16
0
  TrialWaveFunction::RealType
  TrialWaveFunction::updateBuffer(ParticleSet& P, PooledData<RealType>& buf,
      bool fromscratch) {
    P.G = 0.0;
    P.L = 0.0;

    ValueType logpsi(0.0);
    PhaseValue=0.0;
    vector<OrbitalBase*>::iterator it(Z.begin());
    vector<OrbitalBase*>::iterator it_end(Z.end());
    for(int ii=1; it!=it_end; ++it,ii+=TIMER_SKIP)
    {
      myTimers[ii]->start();
      logpsi += (*it)->updateBuffer(P,buf,fromscratch);
      PhaseValue += (*it)->PhaseValue;
      myTimers[ii]->stop();
    }

    LogValue=real(logpsi);
    buf.put(&(P.G[0][0]), &(P.G[0][0])+TotalDim);
    buf.put(&(P.L[0]), &(P.L[0])+NumPtcls);
    return LogValue;
  }
예제 #17
0
  OrbitalBase::RealType 
  ThreeBodyGeminal::updateBuffer(ParticleSet& P, PooledData<RealType>& buf,
      bool fromscratch) {
    evaluateLogAndStore(P);
    buf.put(LogValue);
    buf.put(V.begin(), V.end());

    buf.put(Y.begin(), Y.end());
    buf.put(FirstAddressOfdY,LastAddressOfdY);
    buf.put(d2Y.begin(),d2Y.end());

    buf.put(Uk.begin(), Uk.end());
    buf.put(FirstAddressOfgU,LastAddressOfgU);
    buf.put(d2Uk.begin(), d2Uk.end());
    return LogValue;
  }
예제 #18
0
  OrbitalBase::RealType 
  ThreeBodyGeminal::evaluateLog(ParticleSet& P, PooledData<RealType>& buf) {
    buf.put(LogValue);
    buf.put(V.begin(), V.end());

    buf.put(Y.begin(), Y.end());
    buf.put(FirstAddressOfdY,LastAddressOfdY);
    buf.put(d2Y.begin(),d2Y.end());

    buf.put(Uk.begin(), Uk.end());
    buf.put(FirstAddressOfgU,LastAddressOfgU);
    buf.put(d2Uk.begin(), d2Uk.end());

    return LogValue;
    //return std::exp(LogValue);
  }
  RNDiracDeterminantBaseAlternate::RealType
  RNDiracDeterminantBaseAlternate::registerData(ParticleSet& P, PooledData<RealType>& buf)
  {

    if (NP == 0) //first time, allocate once
      {
        //int norb = cols();
        dpsiV.resize(NumOrbitals);
        d2psiV.resize(NumOrbitals);
        workV1.resize(NumOrbitals);
        workV2.resize(NumOrbitals);
        NP=P.getTotalNum();
        myG.resize(NP);
        myL.resize(NP);
        myG_temp.resize(NP);
        myL_temp.resize(NP);
        myG_alternate.resize(NP);
        myL_alternate.resize(NP);
        FirstAddressOfG = &myG[0][0];
        LastAddressOfG = FirstAddressOfG + NP*DIM;
        FirstAddressOfdV = &(dpsiM(0,0)[0]); //(*dpsiM.begin())[0]);
        LastAddressOfdV = FirstAddressOfdV + NumPtcls*NumOrbitals*DIM;
      }

    myG=0.0;
    myL=0.0;
    myG_alternate=0.0;
    myL_alternate=0.0;

    //ValueType x=evaluate(P,myG,myL);
    evaluateLog(P,myG,myL);

    P.G += myG;
    P.L += myL;

    //add the data: determinant, inverse, gradient and laplacians
    buf.add(psiM.first_address(),psiM.last_address());
    buf.add(FirstAddressOfdV,LastAddressOfdV);
    buf.add(d2psiM.first_address(),d2psiM.last_address());
    buf.add(myL.first_address(), myL.last_address());
    buf.add(FirstAddressOfG,LastAddressOfG);
    buf.add(LogValue);
    buf.add(alternateLogValue);
    buf.add(PhaseValue);

    return LogValue;
  }
예제 #20
0
TrialWaveFunction::RealType TrialWaveFunction::updateBuffer(ParticleSet& P
    , PooledData<RealType>& buf, bool fromscratch)
{
  //TAU_PROFILE("TrialWaveFunction::updateBuffer","(P,..)", TAU_USER);
  P.G = 0.0;
  P.L = 0.0;
  buf.rewind(BufferCursor);
  ValueType logpsi(0.0);
  PhaseValue=0.0;
  vector<OrbitalBase*>::iterator it(Z.begin());
  vector<OrbitalBase*>::iterator it_end(Z.end());
  for (; it!=it_end; ++it)
  {
    logpsi += (*it)->updateBuffer(P,buf,fromscratch);
    PhaseValue += (*it)->PhaseValue;
  }
  convert(logpsi,LogValue);
  //LogValue=real(logpsi);
  buf.put(PhaseValue);
  buf.put(LogValue);
  buf.put(&(P.G[0][0]), &(P.G[0][0])+TotalDim);
  buf.put(&(P.L[0]), &(P.L[0])+NumPtcls);
  return LogValue;
}
예제 #21
0
 void AGPDeterminant::copyFromBuffer(ParticleSet& P, PooledData<RealType>& buf) {
   if(UseBuffer) {
     buf.get(CurrentDet);
     buf.get(psiM.begin(),psiM.end());
     buf.get(phiT.begin(),phiT.end());
     buf.get(d2psiU.begin(),d2psiU.end());
     buf.get(d2psiD.begin(),d2psiD.end());
     buf.get(FirstAddressOfdVU,LastAddressOfdVU);
     buf.get(FirstAddressOfdVD,LastAddressOfdVD);
     buf.get(d2Y.begin(),d2Y.end());
     buf.get(FirstAddressOfdY,LastAddressOfdY);
     buf.get(FirstAddressOfG,LastAddressOfG);
     buf.get(myL.first_address(), myL.last_address());
     //buf.get(myL.begin(), myL.end());
     //copy current inverse of the determinant
     psiM_temp = psiM;
   }
 }
예제 #22
0
void RNDiracDeterminantBase::copyFromBuffer(ParticleSet& P, PooledData<RealType>& buf)
{
  buf.get(psiM.first_address(),psiM.last_address());
  buf.get(FirstAddressOfdV,LastAddressOfdV);
  buf.get(d2psiM.first_address(),d2psiM.last_address());
  buf.get(myL.first_address(), myL.last_address());
  buf.get(FirstAddressOfG,LastAddressOfG);
  buf.get(LogValue);
  buf.get(alternateLogValue);
  buf.get(alternatePhaseValue);
  //re-evaluate it for testing
  //Phi.evaluate(P, FirstIndex, LastIndex, psiM, dpsiM, d2psiM);
  //CurrentDet = Invert(psiM.data(),NumPtcls,NumOrbitals);
  //need extra copy for gradient/laplacian calculations without updating it
  psiM_temp = psiM;
  dpsiM_temp = dpsiM;
  d2psiM_temp = d2psiM;
}
예제 #23
0
  DiracDeterminantBase::ValueType DiracDeterminantBase::evaluate(ParticleSet& P, PooledData<RealType>& buf) {

    buf.put(psiM.first_address(),psiM.last_address());
    buf.put(FirstAddressOfdV,LastAddressOfdV);
    buf.put(d2psiM.first_address(),d2psiM.last_address());
    buf.put(myL.first_address(), myL.last_address());
    buf.put(FirstAddressOfG,LastAddressOfG);
    buf.put(CurrentDet);

    return CurrentDet;
  }
예제 #24
0
 AGPDeterminant::ValueType AGPDeterminant::evaluateLog(ParticleSet& P, PooledData<RealType>& buf) 
 {
   if(UseBuffer) 
   {
     buf.put(CurrentDet);
     buf.put(psiM.begin(),psiM.end());
     buf.put(phiT.begin(),phiT.end());
     buf.put(d2psiU.begin(),d2psiU.end());
     buf.put(d2psiD.begin(),d2psiD.end());
     buf.put(FirstAddressOfdVU,LastAddressOfdVU);
     buf.put(FirstAddressOfdVD,LastAddressOfdVD);
     buf.put(d2Y.begin(),d2Y.end());
     buf.put(FirstAddressOfdY,LastAddressOfdY);
     buf.put(FirstAddressOfG,LastAddressOfG);
     buf.put(myL.first_address(), myL.last_address());
     //buf.put(myL.begin(), myL.end());
   }
   return evaluateLogAndPhase(CurrentDet,PhaseValue);
   //return CurrentDet;
 }
예제 #25
0
OrbitalBase::RealType
ThreeBodyGeminal::registerData(ParticleSet& P, PooledData<RealType>& buf)
{
  evaluateLogAndStore(P);
  FirstAddressOfdY=&(dY(0,0)[0]);
  LastAddressOfdY=FirstAddressOfdY+NumPtcls*BasisSize*DIM;
  FirstAddressOfgU=&(dUk(0,0)[0]);
  LastAddressOfgU = FirstAddressOfgU + NumPtcls*NumPtcls*DIM;
  buf.add(LogValue);
  buf.add(V.begin(), V.end());
  buf.add(Y.begin(), Y.end());
  buf.add(FirstAddressOfdY,LastAddressOfdY);
  buf.add(d2Y.begin(),d2Y.end());
  buf.add(Uk.begin(), Uk.end());
  buf.add(FirstAddressOfgU,LastAddressOfgU);
  buf.add(d2Uk.begin(), d2Uk.end());
  return LogValue;
}
예제 #26
0
  DiracDeterminantBase::ValueType DiracDeterminantBase::updateBuffer(ParticleSet& P, PooledData<RealType>& buf) {

    myG=0.0;
    myL=0.0;
    ValueType x=evaluate(P,myG,myL); 
    P.G += myG;
    P.L += myL;
    buf.put(psiM.first_address(),psiM.last_address());
    buf.put(FirstAddressOfdV,LastAddressOfdV);
    buf.put(d2psiM.first_address(),d2psiM.last_address());
    buf.put(myL.first_address(), myL.last_address());
    buf.put(FirstAddressOfG,LastAddressOfG);
    buf.put(CurrentDet);

    return CurrentDet;
  }
예제 #27
0
  DiracDeterminantBase::ValueType DiracDeterminantBase::registerData(ParticleSet& P, PooledData<RealType>& buf) {

    if(NP == 0) {//first time, allocate once
      //int norb = cols();
      dpsiV.resize(NumOrbitals);
      d2psiV.resize(NumOrbitals);
      workV1.resize(NumOrbitals);
      workV2.resize(NumOrbitals);
      NP=P.getTotalNum();
      myG.resize(NP);
      myL.resize(NP);
      myG_temp.resize(NP);
      myL_temp.resize(NP);
      FirstAddressOfG = &myG[0][0];
      LastAddressOfG = FirstAddressOfG + NP*DIM;
      FirstAddressOfdV = &(dpsiM(0,0)[0]); //(*dpsiM.begin())[0]);
      LastAddressOfdV = FirstAddressOfdV + NumPtcls*NumOrbitals*DIM;
    }

    //allocate once but each walker calls this
    myG=0.0;
    myL=0.0;

    ValueType x=evaluate(P,myG,myL); 

    P.G += myG;
    P.L += myL;

    //add the data: determinant, inverse, gradient and laplacians
    buf.add(psiM.first_address(),psiM.last_address());
    buf.add(FirstAddressOfdV,LastAddressOfdV);
    buf.add(d2psiM.first_address(),d2psiM.last_address());
    buf.add(myL.first_address(), myL.last_address());
    buf.add(FirstAddressOfG,LastAddressOfG);
    buf.add(CurrentDet);

    return CurrentDet;
  }
예제 #28
0
 /** dump the inverse to the buffer
 */
 void DiracDeterminantBase::dumpToBuffer(ParticleSet& P, PooledData<RealType>& buf) {
   APP_ABORT("DiracDeterminantBase::dumpToBuffer");
   buf.add(psiM.first_address(),psiM.last_address());
 }
예제 #29
0
RNDiracDeterminantBase::RealType RNDiracDeterminantBase::updateBuffer(ParticleSet& P,
    PooledData<RealType>& buf, bool fromscratch)
{
  myG=0.0;
  myL=0.0;
  myG_alternate=0.0;
  myL_alternate=0.0;
  if (fromscratch)
  {
    evaluateLog(P,myG,myL);
    UpdateTimer.start();
  }
  else
  {
    if (UpdateMode == ORB_PBYP_RATIO)
      Phi->evaluate(P, FirstIndex, LastIndex, psiM_temp,dpsiM, d2psiM);
    RealType cp = std::exp(logepsilon -2.0*alternateLogValue);
    RealType bp = 1.0/(1+cp);
    UpdateTimer.start();
    if (NumPtcls==1)
    {
      ValueType y=psiM(0,0);
      GradType rv = y*dpsiM(0,0);
      ValueType rv2=dot(rv,rv);
      myG_alternate(FirstIndex) += rv;
      myL_alternate(FirstIndex) += y*d2psiM(0,0) - rv2;
      myG(FirstIndex) += bp*rv;
      myL(FirstIndex) += bp*(y*d2psiM(0,0) + (1-2*bp)*rv2);
    }
    else
    {
      const ValueType* restrict yptr=psiM.data();
      const ValueType* restrict d2yptr=d2psiM.data();
      const GradType* restrict dyptr=dpsiM.data();
      for (int i=0, iat=FirstIndex; i<NumPtcls; i++, iat++)
      {
        GradType rv;
        ValueType lap=0.0;
        for (int j=0; j<NumOrbitals; j++,yptr++)
        {
          rv += *yptr * *dyptr++;
          lap += *yptr * *d2yptr++;
        }
        ValueType rv2=dot(rv,rv);
        myG_alternate(iat) += rv;
        myL_alternate(iat) += lap - rv2;
        myG(iat) += bp*rv;
        myL(iat) += bp*(lap + (1-2*bp)*rv2);
      }
    }
  }
  P.G += myG;
  P.L += myL;
  //copy psiM to psiM_temp
  psiM_temp=psiM;
  buf.put(psiM.first_address(),psiM.last_address());
  buf.put(FirstAddressOfdV,LastAddressOfdV);
  buf.put(d2psiM.first_address(),d2psiM.last_address());
  buf.put(myL.first_address(), myL.last_address());
  buf.put(FirstAddressOfG,LastAddressOfG);
  buf.put(LogValue);
  buf.put(alternateLogValue);
  buf.put(alternatePhaseValue);
  UpdateTimer.stop();
  return LogValue;
}
예제 #30
0
 /** copy the inverse from the buffer
 */
 void DiracDeterminantBase::dumpFromBuffer(ParticleSet& P, PooledData<RealType>& buf) {
   buf.get(psiM.first_address(),psiM.last_address());
 }