38 using QMCT = QMCTraits;
43 const double vmad_sc = -1.4186487397403098;
56 ions.
R[0] = {0.0, 0.0, 0.0};
60 ion_species(pChargeIdx, pIdx) = 1;
68 CHECK(consts == Approx(-3.1151210154));
72 CHECK(val == Approx(vmad_sc));
76 CHECK(val == Approx(vmad_sc));
81 const double alat = 3.77945227;
82 const double vmad_sc = -1.4186487397403098 / alat;
96 ions.
R[0] = {0.0, 0.0, 0.0};
97 ions.
R[1] = {1.88972614, 1.88972614, 1.88972614};
101 ion_species(pChargeIdx, pIdx) = 1;
109 CHECK(consts == Approx(-1.675229452));
112 CHECK(val == Approx(-0.9628996199));
116 CHECK(val == Approx(vmad_sc));
133 elec.
R[0] = {0.0, 0.5, 0.0};
138 tspecies(chargeIdx, upIdx) = -1;
139 tspecies(massIdx, upIdx) = 1.0;
149 CHECK(consts == Approx(-3.1151210154));
152 CHECK(val == Approx(-1.418648723));
157 const double alat = 1.0;
158 const double vmad_bcc = -1.819616724754322 / alat;
174 elec.
R[0] = {0.0, 0.0, 0.0};
180 tspecies(chargeIdx, upIdx) = -1;
181 tspecies(massIdx, upIdx) = 1.0;
190 CHECK(val == Approx(vmad_bcc));
193 CHECK(val == Approx(vmad_bcc));
198 const double alat = 1.0;
199 const double vmad_bcc = -1.819616724754322 / alat;
215 elec.
R[0] = {0.0, 0.0, 0.0};
216 elec.
R[1] = {0.1, 0.2, 0.3};
217 elec.
R[2] = {0.3, 0.1, 0.2};
224 tspecies(chargeIdx, upIdx) = -1;
225 tspecies(chargeIdx, dnIdx) = -1;
226 tspecies(massIdx, upIdx) = 1.0;
227 tspecies(massIdx, dnIdx) = 1.0;
236 elec_clone.
R[2] = {0.2, 0.3, 0.0};
258 caa.
mw_evaluate(caa_ref_list, psi_ref_list, p_ref_list);
267 TEST_CASE(
"Coulomb PBC A-A BCC 3 particles",
"[hamiltonian]")
274 TEST_CASE(
"CoulombAA::mw_evaluatePerParticle",
"[hamiltonian]")
290 elec.
R[0] = {0.0, 0.5, 0.0};
291 elec.
R[1] = {0.0, 0.0, 0.0};
296 tspecies(chargeIdx, upIdx) = -1;
297 tspecies(massIdx, upIdx) = 1.0;
321 elec2.
R[0] = {0.0, 0.5, 0.1};
322 elec2.
R[1] = {0.6, 0.05, -0.1};
334 CHECK(consts == Approx(-6.3314780332));
352 std::vector<ListenerVector<Real>> listeners;
355 std::vector<ListenerVector<Real>> ion_listeners;
363 CHECK(std::accumulate(local_pots.
begin(), local_pots.
begin() + local_pots.
cols(), 0.0) == Approx(-2.9332312765));
364 CHECK(std::accumulate(local_pots[1], local_pots[1] + local_pots.
cols(), 0.0) == Approx(-3.4537460926));
a class that defines a supercell in D-dimensional Euclean space.
DynamicCoordinateKind
enumerator for DynamicCoordinates kinds
void setName(const std::string &aname)
Container_t::iterator begin()
Calculates the AA Coulomb potential using PBCs.
int addSpecies(const std::string &aname)
When a name species does not exist, add a new species.
helper functions for EinsplineSetBuilder
QTBase::RealType RealType
TEST_CASE("complex_helper", "[type_traits]")
CHECKED_ELSE(check_matrix_result.result)
void createResource(ResourceCollection &collection) const
initialize a shared resource and hand it to a collection
void update(bool skipSK=false)
update the internal data
static std::unique_ptr< LRHandlerType > CoulombHandler
Stores the energ optimized LR handler.
int addAttribute(const std::string &aname)
for a new attribute, allocate the data, !More often used to get the index of a species ...
void test_CoulombPBCAA_3p(DynamicCoordinateKind kind)
CrystalLattice< OHMMS_PRECISION, OHMMS_DIM > lattice
Specialized paritlce class for atomistic simulations.
void createResource(ResourceCollection &collection) const override
initialize a shared resource and hand it to a collection
void mw_evaluate(const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< TrialWaveFunction > &wf_list, const RefVectorWithLeader< ParticleSet > &p_list) const override
Evaluate the contribution of this component of multiple walkers.
RealType get_madelung_constant() const
Return_t evalConsts(bool report=true)
auto getParticularListener(Matrix< T > &local_pots)
Return_t getValue() const noexcept
get a copy of value_
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
void create(const std::vector< int > &agroup)
create grouped particles
Declaration of a TrialWaveFunction.
std::vector< std::reference_wrapper< T > > RefVector
Class to represent a many-body trial wave function.
CheckMatrixResult checkMatrix(M1 &a_mat, M2 &b_mat, const bool check_all=false, std::optional< const double > eps=std::nullopt)
This function checks equality a_mat and b_mat elements M1, M2 need to have their element type declare...
static void mw_update(const RefVectorWithLeader< ParticleSet > &p_list, bool skipSK=false)
batched version of update
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
handles acquire/release resource by the consumer (RefVectorWithLeader type).
void createSK()
create Structure Factor with PBCs
Custom container for set of attributes for a set of species.
void mw_evaluatePerParticle(const RefVectorWithLeader< OperatorBase > &o_list, const RefVectorWithLeader< TrialWaveFunction > &wf_list, const RefVectorWithLeader< ParticleSet > &p_list, const std::vector< ListenerVector< RealType >> &listeners, const std::vector< ListenerVector< RealType >> &ion_listeners) const override
Evaluate the contribution of this component of multiple walkers per particle reporting to registered ...
void informOfPerParticleListener() override
Inform objects associated with this operator of per particle listeners.
Listener types that allow Estimators to register with QMCHamiltonian to have "trace" values from oper...
Return_t evaluate(ParticleSet &P) override
Evaluate the local energy contribution of this component.