42 APP_ABORT(
" LocalECPotential::resetTargetParticleSet found a different distance table index.");
48 for (
int iat = 0; iat <
PP.size(); iat++)
56 PPset[groupID] = std::move(ppot);
60 #if !defined(REMOVE_TRACEMANAGER) 86 #if !defined(REMOVE_TRACEMANAGER) 95 for (
size_t iel = 0; iel < Nelec; ++iel)
97 const auto& dist = d_table.getDistRow(iel);
99 for (
size_t iat = 0; iat <
NumIons; ++iat)
100 if (
PP[iat] !=
nullptr)
101 esum +=
PP[iat]->splint(dist[iat]) *
Zeff[iat] / dist[iat];
117 for (
size_t iel = 0; iel < Nelec; ++iel)
119 const auto& dist = d_table.getDistRow(iel);
120 const auto& dr = d_table.getDisplRow(iel);
127 for (
size_t iat = 0; iat <
NumIons; ++iat)
129 if (
PP[iat] !=
nullptr)
131 rinv = 1.0 / dist[iat];
132 v =
PP[iat]->splint(dist[iat], dv, d2v);
133 dvdr = -
Zeff[iat] * (dv - v * rinv) * rinv;
134 hf_terms[iat] += dvdr * dr[iat] * rinv;
135 esum += -
Zeff[iat] * v * rinv;
143 #if !defined(REMOVE_TRACEMANAGER) 154 for (
size_t iel = 0; iel < Nelec; ++iel)
156 const auto& dist = d_table.getDistRow(iel);
158 for (
size_t iat = 0; iat <
NumIons; ++iat)
159 if (
PP[iat] !=
nullptr)
161 pairpot = -0.5 *
PP[iat]->splint(dist[iat]) *
Zeff[iat] / dist[iat];
162 Vi_samp(iat) += pairpot;
163 Ve_samp(iel) += pairpot;
170 #if defined(TRACE_CHECK) 178 app_log() <<
"accumtest: LocalECPotential::evaluate()" << std::endl;
179 app_log() <<
"accumtest: tot:" << Vnow << std::endl;
180 app_log() <<
"accumtest: sum:" << Vsum << std::endl;
185 app_log() <<
"sharetest: LocalECPotential::evaluate()" << std::endl;
186 app_log() <<
"sharetest: e share:" << Vesum << std::endl;
187 app_log() <<
"sharetest: i share:" << Visum << std::endl;
192 app_log() <<
"versiontest: LocalECPotential::evaluate()" << std::endl;
193 app_log() <<
"versiontest: orig:" << Vorig << std::endl;
194 app_log() <<
"versiontest: mod:" << Vnow << std::endl;
208 for (
size_t iel = 0; iel < Nelec; ++iel)
210 const auto& dist = d_table.getDistRow(iel);
212 for (
size_t iat = 0; iat <
NumIons; ++iat)
213 if (
PP[iat] !=
nullptr)
214 esum +=
PP[iat]->splint(dist[iat]) *
Zeff[iat] / dist[iat];
222 std::unique_ptr<LocalECPotential> myclone = std::make_unique<LocalECPotential>(
IonConfig, qp);
224 for (
int ig = 0; ig <
PPset.size(); ++ig)
Array< TraceReal, 1 > * Vi_sample
void twoBodyQuantumDomain(const ParticleSet &P)
set quantum domain for two-body operator
bool streaming_particles_
void resetTargetParticleSet(ParticleSet &P) override
Reset the data with the target ParticleSet.
helper functions for EinsplineSetBuilder
bool streaming_array(const std::string &name)
MakeReturn< UnaryNode< FnFabs, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t abs(const Vector< T1, C1 > &l)
size_t getTotalNum() const
Declaration of OperatorBase.
std::vector< RealType > Zeff
effective charge per ion
const ParticleSet & IonConfig
reference to the ionic configuration
int myTableIndex
distance table index
Attaches a unit to a Vector for IO.
Return_t evaluate(ParticleSet &P) override
Evaluate the local energy contribution of this component.
TraceRequest request_
whether traces are being collected
Return_t evaluate_sp(ParticleSet &P)
ParticleIndex GroupID
Species ID.
int getTotalNum() const
return the number of species
const DistanceTableAB & getDistTableAB(int table_ID) const
get a distance table by table_ID and dyanmic_cast to DistanceTableAB
int addTable(const ParticleSet &psrc, DTModes modes=DTModes::ALL_OFF)
add a distance table
Array< TraceReal, 1 > * Ve_sample
single particle trace samples
std::string name_
name of this object
Specialized paritlce class for atomistic simulations.
std::vector< std::unique_ptr< RadialPotentialType > > PPset
unique set of local ECP to cleanup
LocalECPotential(const ParticleSet &ions, ParticleSet &els)
std::vector< RadialPotentialType * > PP
PP[iat] is the local potential for the iat-th particle.
Return_t evaluate_orig(ParticleSet &P)
#define APP_ABORT(msg)
Widely used but deprecated fatal error macros from legacy code.
void checkoutParticleQuantities(TraceManager &tm) override
void setEnergyDomain(EnergyDomains edomain)
Set the Energy Domain.
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
Array< TraceReal, D > * checkout_real(const std::string &name, int n1=1, int n2=0, int n3=0, int n4=0)
void add(int groupID, std::unique_ptr< RadialPotentialType > &&ppot, RealType z)
Add a RadialPotentialType of a species.
std::vector< RealType > gZeff
effective charge per species
FullPrecRealType Return_t
type of return value of evaluate
Class to represent a many-body trial wave function.
Return_t value_
current value
void contribute_array(const std::string &name, bool default_quantity=false)
int NumIons
the number of ioncs
std::unique_ptr< OperatorBase > makeClone(ParticleSet &qp, TrialWaveFunction &psi) override
void contributeParticleQuantities() override
Return_t evaluateWithIonDerivs(ParticleSet &P, ParticleSet &ions, TrialWaveFunction &psi, ParticleSet::ParticlePos &hf_terms, ParticleSet::ParticlePos &pulay_terms) override
Evaluate contribution to local energy and derivatives w.r.t ionic coordinates from OperatorBase...
void deleteParticleQuantities() override