src/QMCWaveFunctions/Fermion/MultiSlaterDeterminantWithBackflow.cpp
// use ci_node for this routine only
use ci_node for this routine only
use ci_node for this routine only
WaveFunctionComponent::ValueType MultiSlaterDeterminantWithBackflow::ratio(ParticleSet& P, int iat)
{
  APP_ABORT("MultiSlaterDeterminantWithBackflow:: pbyp routines not implemented ");
  UpdateMode = ORB_PBYP_RATIO;
  if (DetID[iat] == 0)
  {
    RatioTimer.start();
    spo_up->evaluateForPtclMove(P, iat);
    Ratio1Timer.start();
    for (int i = 0; i < dets_up.size(); i++)
    {
      spo_up->prepareFor(i);
      detsRatios[i] = dets_up[i]->ratio(P, iat);
    }
    Ratio1Timer.stop();
    std::vector<size_t>::iterator upC(C2node_up.begin()), dnC(C2node_dn.begin());
    std::vector<ValueType>::iterator it(C.begin()), last(C.end());
    ValueType psiOld = 0.0, psiNew = 0.0;
    while (it != last)
    {
      ValueType tmp = (*it) * detValues_up[*upC] * detValues_dn[*dnC];
      psiNew += tmp * detsRatios[*upC];
      psiOld += tmp;
      it++;
      upC++;
      dnC++;
    }
    curRatio = psiNew / psiOld;
    RatioTimer.stop();
    return curRatio;
  }
  else
  {
    RatioTimer.start();
    spo_dn->evaluateForPtclMove(P, iat);
    Ratio1Timer.start();
    for (int i = 0; i < dets_dn.size(); i++)
    {
      spo_dn->prepareFor(i);
      detsRatios[i] = dets_dn[i]->ratio(P, iat);
    }
    Ratio1Timer.stop();
    std::vector<size_t>::iterator upC(C2node_up.begin()), dnC(C2node_dn.begin());
    std::vector<ValueType>::iterator it(C.begin()), last(C.end());
    ValueType psiOld = 0.0, psiNew = 0.0;
    while (it != last)
    {
      ValueType tmp = (*it) * detValues_up[*upC] * detValues_dn[*dnC];
      psiNew += tmp * detsRatios[*dnC];
      psiOld += tmp;
      it++;
      upC++;
      dnC++;
    }
    curRatio = psiNew / psiOld;
    RatioTimer.stop();
    return curRatio;
  }
}
WaveFunctionComponent :: ValueType MultiSlaterDeterminantWithBackflow :: ratio ( ParticleSet & P , int iat ) { APP_ABORT ( " " ) ; UpdateMode = ORB_PBYP_RATIO ; if ( DetID [ iat ] == 0 ) { RatioTimer . start ( ) ; spo_up -> evaluateForPtclMove ( P , iat ) ; Ratio1Timer . start ( ) ; for ( int i = 0 ; i < dets_up . size ( ) ; i ++ ) { spo_up -> prepareFor ( i ) ; detsRatios [ i ] = dets_up [ i ] -> ratio ( P , iat ) ; } Ratio1Timer . stop ( ) ; std :: vector < size_t > :: iterator upC ( C2node_up . begin ( ) ) , dnC ( C2node_dn . begin ( ) ) ; std :: vector < ValueType > :: iterator it ( C . begin ( ) ) , last ( C . end ( ) ) ; ValueType psiOld = 0.0 , psiNew = 0.0 ; while ( it != last ) { ValueType tmp = ( * it ) * detValues_up [ * upC ] * detValues_dn [ * dnC ] ; psiNew += tmp * detsRatios [ * upC ] ; psiOld += tmp ; it ++ ; upC ++ ; dnC ++ ; } curRatio = psiNew / psiOld ; RatioTimer . stop ( ) ; return curRatio ; } else { RatioTimer . start ( ) ; spo_dn -> evaluateForPtclMove ( P , iat ) ; Ratio1Timer . start ( ) ; for ( int i = 0 ; i < dets_dn . size ( ) ; i ++ ) { spo_dn -> prepareFor ( i ) ; detsRatios [ i ] = dets_dn [ i ] -> ratio ( P , iat ) ; } Ratio1Timer . stop ( ) ; std :: vector < size_t > :: iterator upC ( C2node_up . begin ( ) ) , dnC ( C2node_dn . begin ( ) ) ; std :: vector < ValueType > :: iterator it ( C . begin ( ) ) , last ( C . end ( ) ) ; ValueType psiOld = 0.0 , psiNew = 0.0 ; while ( it != last ) { ValueType tmp = ( * it ) * detValues_up [ * upC ] * detValues_dn [ * dnC ] ; psiNew += tmp * detsRatios [ * dnC ] ; psiOld += tmp ; it ++ ; upC ++ ; dnC ++ ; } curRatio = psiNew / psiOld ; RatioTimer . stop ( ) ; return curRatio ; } }
use ci_node for this routine only
use ci_node for this routine only