33 ei_table_index(elns.addTable(ions)),
34 ee_table_index(elns.addTable(elns)),
35 ii_table_index(ions.addTable(ions)),
60 int ChargeAttribIndxA = tspeciesA.
addAttribute(
"charge");
61 int ChargeAttribIndxB = tspeciesB.addAttribute(
"charge");
75 Zspec[spec] = tspeciesA(ChargeAttribIndxA, spec);
80 Qspec[spec] = tspeciesB(ChargeAttribIndxB, spec);
85 for (
int iat = 0; iat <
NptclA; iat++)
105 AA->evaluateStress(P.
getSimulationCell().getKLists().kshell, RhoKA.rhok_r[i], RhoKA.rhok_i[i],
106 RhoKB.rhok_r[j], RhoKB.rhok_i[j]);
107 res +=
Zspec[i] * esum;
118 for (
int jpart = 0; jpart <
NptclB; jpart++)
120 const auto& drijs = d_ab.getDisplRow(jpart);
121 const auto& rijs = d_ab.getDistRow(jpart);
123 for (
int iat = 0; iat <
NptclA; iat++)
125 res +=
Zat[iat] *
e *
AA->evaluateSR_dstrain(drijs[iat], rijs[iat]);
136 for (
int ipart = 0; ipart <
NptclB; ipart++)
139 const auto& drijs = d_aa.getDisplRow(ipart);
140 const auto& rijs = d_aa.getDistRow(ipart);
141 for (
int jpart = 0; jpart < ipart; jpart++)
143 esum += P.
Z[jpart] *
AA->evaluateSR_dstrain(drijs[jpart], rijs[jpart]);
145 stress_aa += P.
Z[ipart] * esum;
158 std::vector<int> NofSpecies;
159 std::vector<int> Zmyspec;
160 NofSpecies.resize(NumSpecies);
161 Zmyspec.resize(NumSpecies);
163 for (
int spec = 0; spec < NumSpecies; spec++)
170 for (
int spec1 = 0; spec1 < NumSpecies; spec1++)
173 for (
int spec2 = spec1; spec2 < NumSpecies; spec2++)
176 AA->evaluateStress(P.
getSimulationCell().getKLists().kshell, PtclRhoK.rhok_r[spec1], PtclRhoK.rhok_i[spec1],
177 PtclRhoK.rhok_r[spec2], PtclRhoK.rhok_i[spec2]);
180 stress_aa += Z1 * Zmyspec[spec2] * temp;
197 for (
int i = 0; i < nelns; ++i)
202 Consts += -.5 *
Qat[i] * vs_k0 * v1;
204 for (
int i = 0; i < nions; ++i)
209 Consts += -.5 *
Zat[i] * vs_k0 * v1;
225 std::vector<int> NofSpecies;
226 std::vector<int> Zmyspec;
227 NofSpecies.resize(NumSpecies);
228 Zmyspec.resize(NumSpecies);
230 for (
int spec = 0; spec < NumSpecies; spec++)
237 for (
int ipart = 0; ipart < NumCenters; ipart++)
239 tmpconsts += -.5 * P.
Z[ipart] * P.
Z[ipart] * vl_r0;
242 app_log() <<
" PBCAA self-interaction term \n" << tmpconsts << std::endl;
245 for (
int ks = 0; ks <
AA->Fk.size(); ks++)
246 MC0 +=
AA->dFk_dstrain[ks];
247 MC0 = 0.5 * (MC0 - vl_r0);
250 for (
int ipart = 0; ipart < NumCenters; ipart++)
253 for (
int spec = 0; spec < NumSpecies; spec++)
254 v1 += -.5 * P.
Z[ipart] * NofSpecies[spec] * Zmyspec[spec];
255 tmpconsts += v1 * vs_k0;
258 app_log() <<
" PBCAA total constant \n" << tmpconsts << std::endl;
299 complex_ktensor += grad_grad_psi[iat] * minv;
305 kinetic_tensor(i, j) = complex_ktensor(i, j).real();
307 return kinetic_tensor;
312 std::string ionionforce(
"yes");
315 attr.
add(ionionforce,
"add_ion_ion_");
317 add_ion_ion_ = (ionionforce ==
"yes") || (ionionforce ==
"true");
324 std::unique_ptr<StressPBC> tmp = std::make_unique<StressPBC>(
PtclA, qp, psi);
static std::unique_ptr< LRHandlerType > getDerivHandler(ParticleSet &ref)
This returns a force/stress optimized LR handler. If non existent, it creates one.
std::unique_ptr< OperatorBase > makeClone(ParticleSet &qp, TrialWaveFunction &psi) final
helper functions for EinsplineSetBuilder
const DistanceTableAA & getDistTableAA(int table_ID) const
get a distance table by table_ID and dyanmic_cast to DistanceTableAA
int NumSpeciesB
number of species of B particle set
SymTensor< Real, OHMMS_DIM > stress_ee_
size_t getTotalNum() const
void evaluateHessian(ParticleSet &P, HessVector &all_grad_grad_psi)
evaluate the hessian w.r.t.
bool put(xmlNodePtr cur)
assign attributes to the set
EwaldHandler3D::mRealType mRealType
SymTensor< RealType, OHMMS_DIM > evaluateSR_AB(ParticleSet &P_target)
std::vector< int > NofSpeciesA
number of particles per species of A
SymTensor< RealType, OHMMS_DIM > evaluateKineticSymTensor(ParticleSet &P)
SymTensor< RealType, OHMMS_DIM > stress_eI_const
int NptclA
number of particles of A (classical, e.g. ions)
Calculates the structure-factor for a particle set.
int addAttribute(const std::string &aname)
for a new attribute, allocate the data, !More often used to get the index of a species ...
QTFull::ValueType SingleParticleValue
SymTensor< Real, OHMMS_DIM > stress_kin_
ParticleIndex GroupID
Species ID.
for(int i=0;i< size_test;++i) CHECK(Approx(gauss_random_vals[offset_for_rs+i])
const DistanceTableAB & getDistTableAB(int table_ID) const
get a distance table by table_ID and dyanmic_cast to DistanceTableAB
SymTensor< RealType, OHMMS_DIM > stress_ee_const
int NumSpeciesA
number of species of A particle set
std::vector< RealType > Zat
Zat[iat] charge for the iat-th particle of A.
const auto & getSimulationCell() const
std::string name_
name of this object
Specialized paritlce class for atomistic simulations.
bool add_ion_ion_
Determines if ion-ion force will be added to electron-ion force in derived force estimators. If false, forces_ion_ion_=0.0.
Tensor<T,D> class for D by D tensor.
Final class and should not be derived.
std::vector< RealType > Qat
Qat[iat] charge for the iat-th particle of B.
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > outerProduct(const TinyVector< T1, D > &lhs, const TinyVector< T2, D > &rhs)
class to handle a set of attributes of an xmlNode
std::vector< RealType > Zspec
Zspec[spec] charge for the spec-th species of A.
std::unique_ptr< LRHandlerType > AA
long-range Handler
declaration of ProgressReportEngine
ParticleGradient G
gradients of the particles
Return_t evaluate(ParticleSet &P) override
Evaluate the local energy contribution of this component.
int groupsize(int igroup) const
return the size of a group
ParticleSet & PtclTarg
source particle set
void initBreakup(ParticleSet &P)
SymTensor< RealType, OHMMS_DIM > evaluateSR_AA(ParticleSet &P, int itabSelf)
SymTensor< RealType, OHMMS_DIM > evaluateLR_AB(ParticleSet &P)
const StructFact & getSK() const
return Structure Factor
std::vector< RealType > Qspec
Qspec[spec] charge for the spec-th species of B.
StressPBC(ParticleSet &ions, ParticleSet &elns, TrialWaveFunction &Psi)
bool put(xmlNodePtr cur) override
Read the input parameter.
SymTensor< RealType, OHMMS_DIM > evalConsts_AB()
ParticleScalar Z
charge of each particle
std::vector< int > NofSpeciesB
number of particles per species of B
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
Declaration of a TrialWaveFunction.
FullPrecRealType Return_t
type of return value of evaluate
Define determinant operators.
Class to represent a many-body trial wave function.
int getAttribute(const std::string &aname) const
When a name species does not exist, return attribute.size()
ParticleScalar Mass
mass of each particle
SymTensor< Real, OHMMS_DIM > stress_ion_ion_
SymTensor< Real, OHMMS_DIM > stress_
const auto & getLattice() const
OrbitalSetTraits< ValueType >::HessVector HessVector
int NptclB
number of particles of B (quantum, e.g. electrons)
Declaration of WaveFunctionComponent.
Custom container for set of attributes for a set of species.
SymTensor< RealType, OHMMS_DIM > evaluateLR_AA(ParticleSet &P)
void CalculateIonIonStress()
SymTensor< Real, OHMMS_DIM > stress_ei_
void add(PDT &aparam, const std::string &aname, std::vector< PDT > candidate_values={}, TagStatus status=TagStatus::OPTIONAL)
add a new attribute
const int ee_table_index
e-e table ID
SymTensor< RealType, OHMMS_DIM > evalConsts_AA(ParticleSet &P)
unsigned TotalNum
The number of species.
const int ei_table_index
locator of the distance table