29 TEST_CASE(
"Coulomb PBC A-B Ewald3D",
"[hamiltonian]")
42 ions.
R[0] = {0.0, 0.0, 0.0};
46 ion_species(pChargeIdx, pIdx) = 1;
53 elec.
R[0] = {0.5, 0.0, 0.0};
58 tspecies(chargeIdx, upIdx) = -1;
59 tspecies(massIdx, upIdx) = 1.0;
75 CHECK(consts == Approx(0.0523598776 * 2));
78 CHECK(val_ei == Approx(-0.008302 + 0.0523598776 * 2));
82 double val_ee = caa_elec.
evaluate(elec);
83 double val_ii = caa_ion.
evaluate(ions);
84 double sum = val_ee + val_ii + val_ei;
86 CHECK(val_ee == Approx(-1.418927));
87 CHECK(val_ii == Approx(-1.418927));
88 CHECK(sum == Approx(-2.741436));
94 TEST_CASE(
"Coulomb PBC A-B BCC H Ewald3D",
"[hamiltonian]")
107 ions.
R[0] = {0.0, 0.0, 0.0};
108 ions.
R[1] = {1.88972614, 1.88972614, 1.88972614};
112 ion_species(pChargeIdx, pIdx) = 1;
119 elec.
R[0] = {0.5, 0.0, 0.0};
120 elec.
R[1] = {0.0, 0.5, 0.0};
125 tspecies(chargeIdx, upIdx) = -1;
126 tspecies(massIdx, upIdx) = 1.0;
141 CHECK(consts == Approx(0.0277076538 * 4));
145 CHECK(val_ei == Approx(-2.223413 + 0.0277076538 * 4));
150 double val_ee = caa_elec.
evaluate(elec);
151 double val_ii = caa_ion.
evaluate(ions);
152 double sum = val_ee + val_ii + val_ei;
154 CHECK(val_ee == Approx(-0.012808 - 0.0277076538 * 2));
155 CHECK(val_ii == Approx(-0.907659 - 0.0277076538 * 2));
156 CHECK(sum == Approx(-3.143880));
a class that defines a supercell in D-dimensional Euclean space.
void setName(const std::string &aname)
Return_t evaluate(ParticleSet &P) override
Evaluate the local energy contribution of this component.
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
Calculates the AA Coulomb potential using PBCs.
TEST_CASE("complex_helper", "[type_traits]")
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 ...
CrystalLattice< OHMMS_PRECISION, OHMMS_DIM > lattice
int addTable(const ParticleSet &psrc, DTModes modes=DTModes::ALL_OFF)
add a distance table
Specialized paritlce class for atomistic simulations.
SpeciesSet & getSpeciesSet()
retrun the SpeciesSet of this particle set
void create(const std::vector< int > &agroup)
create grouped particles
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
void createSK()
create Structure Factor with PBCs
Custom container for set of attributes for a set of species.
Return_t evaluate(ParticleSet &P) override
Evaluate the local energy contribution of this component.
Return_t evalConsts(const ParticleSet &P, bool report=true)
Evaluates madelung and background contributions to total energy.