20 TEST_CASE(
"Coulomb PBC A-A Ewald2D square",
"[hamiltonian]")
24 const double vmad_sq = -1.95013246;
36 elec.
R[0] = {0.0, 0.0, 0.0};
42 tspecies(chargeIdx, upIdx) = -1;
43 tspecies(massIdx, upIdx) = 1.0;
51 CHECK(val == Approx(vmad_sq));
54 TEST_CASE(
"Coulomb PBC A-A Ewald2D body center",
"[hamiltonian]")
58 const double vmad_bc = -2.7579038;
74 elec.
R[0] = {0.0, 0.0, 0.0};
75 elec.
R[1] = {0.5, 0.5, 0.0};
77 for (
int i=0;i<npart;i++)
84 tspecies(chargeIdx, upIdx) = -1;
85 tspecies(massIdx, upIdx) = 1.0;
94 CHECK(val/npart == Approx(vmad_bc));
97 TEST_CASE(
"Coulomb PBC A-A Ewald2D triangular",
"[hamiltonian]")
101 const double vmad_tri = -1.1061025865191676;
119 elec.
R[0] = {0.0, 0.0, 0.0};
125 tspecies(chargeIdx, upIdx) = -1;
126 tspecies(massIdx, upIdx) = 1.0;
134 CHECK(val == Approx(vmad_tri));
137 TEST_CASE(
"Coulomb PBC A-A Ewald2D honeycomb",
"[hamiltonian]")
141 const double vmad_hon = -1.510964233;
161 elec.
R[0] = {0.0, 0.0, 0.0};
162 elec.
R[1] = {2./3, 1./3, 0.0};
164 for (
int i=0;i<npart;i++)
171 tspecies(chargeIdx, upIdx) = -1;
172 tspecies(massIdx, upIdx) = 1.0;
181 CHECK(val/npart == Approx(vmad_hon));
184 TEST_CASE(
"Coulomb PBC A-A Ewald2D tri. in rect.",
"[hamiltonian]")
189 const double vmad_tri = -1.1061025865191676;
207 elec.
R[0] = {0.0, 0.0, 0.0};
214 tspecies(chargeIdx, upIdx) = -1;
215 tspecies(massIdx, upIdx) = 1.0;
225 CHECK(val == Approx(vmad_tri));
a class that defines a supercell in D-dimensional Euclean space.
void setName(const std::string &aname)
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
size_t getTotalNum() const
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
MakeReturn< UnaryNode< FnSqrt, typename CreateLeaf< Vector< T1, C1 > >::Leaf_t > >::Expression_t sqrt(const Vector< T1, C1 > &l)
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
Tensor< typename BinaryReturn< T1, T2, OpMultiply >::Type_t, D > dot(const AntiSymTensor< T1, D > &lhs, const AntiSymTensor< T2, D > &rhs)
void createSK()
create Structure Factor with PBCs
Custom container for set of attributes for a set of species.
static lr_type this_lr_type
Return_t evaluate(ParticleSet &P) override
Evaluate the local energy contribution of this component.