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); }
/** evalaute the sum of log value of optimizable many-body wavefunctions * @param P input configuration containing N particles * @param logpsi_fixed log(abs(psi)) of the invariant orbitals * @param logpsi_opt log(abs(psi)) of the variable orbitals * @param fixedG gradients of log(psi) of the fixed wave functions * @param fixedL laplacians of log(psi) of the fixed wave functions * * This function is introduced for optimization only. * fixedG and fixedL save the terms coming from the wave functions * that are invarient during optimizations. * It is expected that evaluateLog(P,false) is called later * and the external object adds the varying G and L and the fixed terms. * Additionally, dumpToBuffer and dumpFromBuffer is used to manage * necessary data for ratio evaluations. */ void TrialWaveFunction::evaluateDeltaLog(ParticleSet& P, RealType& logpsi_fixed_r, RealType& logpsi_opt_r, ParticleSet::ParticleGradient_t& fixedG, ParticleSet::ParticleLaplacian_t& fixedL) { P.G = 0.0; P.L = 0.0; fixedG = 0.0; fixedL = 0.0; ValueType logpsi_fixed(0.0); ValueType logpsi_opt(0.0); 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); else logpsi_fixed += (*it)->evaluateLog(P, fixedG, fixedL); } P.G += fixedG; P.L += fixedL; logpsi_fixed_r = real(logpsi_fixed); logpsi_opt_r = real(logpsi_opt); }