19 TEST_CASE(
"Coulomb PBC A-A Ewald Quasi2D exception",
"[hamiltonian]")
35 elec.
R[0] = {0.0, 0.0, 0.0};
41 tspecies(chargeIdx, upIdx) = -1;
42 tspecies(massIdx, upIdx) = 1.0;
50 TEST_CASE(
"Coulomb PBC A-A Ewald Quasi2D square",
"[hamiltonian]")
54 const double vmad_sq = -1.95013246;
67 elec.
R[0] = {0.0, 0.0, 0.0};
73 tspecies(chargeIdx, upIdx) = -1;
74 tspecies(massIdx, upIdx) = 1.0;
82 CHECK(val == Approx(vmad_sq));
85 TEST_CASE(
"Coulomb PBC A-A Ewald Quasi2D triangular",
"[hamiltonian]")
89 const double vmad_tri = -1.106102587;
108 elec.
R[0] = {0.0, 0.0, 0.0};
114 tspecies(chargeIdx, upIdx) = -1;
115 tspecies(massIdx, upIdx) = 1.0;
123 CHECK(val == Approx(vmad_tri));
126 TEST_CASE(
"Coulomb PBC A-A Ewald Quasi2D staggered square",
"[hamiltonian]")
145 elec.
R[0] = {0.0, 0.0, 0.0};
146 elec.
R[1] = {0.5, 0.5, 0.0};
152 tspecies(chargeIdx, upIdx) = -1;
153 tspecies(massIdx, upIdx) = 1.0;
161 const double zheight[ntest] = {0, 0.1, 0.5, 3.0};
162 const double vmad_sq = -1.95013246;
163 const double vmad_bc = -2.7579038;
164 const double vmad_ref[ntest] = {vmad_bc, -2.4846003745840357, -2.019557388069959, vmad_sq};
166 for (
int itest=0; itest<ntest; itest++)
168 elec.
R[1][2] = zheight[itest];
171 CHECK(val/npart == Approx(vmad_ref[itest]));
175 TEST_CASE(
"Coulomb PBC A-A Ewald Quasi2D staggered square 2x2",
"[hamiltonian]")
194 elec.
R[0] = {0.0, 0.0, 0.0};
195 elec.
R[1] = {1.0, 0.0, 0.0};
196 elec.
R[2] = {0.0, 1.0, 0.0};
197 elec.
R[3] = {1.0, 1.0, 0.0};
198 elec.
R[4] = {0.5, 0.5, 0.0};
199 elec.
R[5] = {1.5, 0.5, 0.0};
200 elec.
R[6] = {0.5, 1.5, 0.0};
201 elec.
R[7] = {1.5, 1.5, 0.0};
207 tspecies(chargeIdx, upIdx) = -1;
208 tspecies(massIdx, upIdx) = 1.0;
216 const double zheight[ntest] = {0, 0.1, 0.5, 3.0};
217 const double vmad_sq = -1.95013246;
218 const double vmad_bc = -2.7579038;
219 const double vmad_ref[ntest] = {vmad_bc, -2.4846003745840357, -2.019557388069959, vmad_sq};
221 for (
int itest=0; itest<ntest; itest++)
223 for (
int i=npart/2;i<npart;i++)
224 elec.
R[i][2] = zheight[itest];
227 CHECK(val/npart == Approx(vmad_ref[itest]));
231 TEST_CASE(
"Coulomb PBC A-A Ewald Quasi2D staggered triangle",
"[hamiltonian]")
254 elec.
R[0] = {0.0, 0.0, 0.0};
255 elec.
R[1] = {2./3, 1./3, 0.0};
257 for (
int i=0;i<npart;i++)
264 tspecies(chargeIdx, upIdx) = -1;
265 tspecies(massIdx, upIdx) = 1.0;
273 const double zheight[ntest] = {0, 0.1, 0.5, 3.0};
274 const double vmad_hon = -1.510964233;
275 const double vmad_tri = -1.106102587;
276 const double vmad_ref[ntest] = {vmad_hon, -1.4193042644, -1.2005504968, vmad_tri};
278 for (
int itest=0; itest<ntest; itest++)
280 elec.
R[1][2] = zheight[itest];
283 CHECK(val/npart == Approx(vmad_ref[itest]));
287 TEST_CASE(
"Coulomb PBC A-A Ewald Quasi2D staggered triangle 2x2",
"[hamiltonian]")
295 const double rs = 10;
313 elec.
R[0] = {0.0, 0.0, 0.0};
314 elec.
R[1] = {0.5, 0.0, 0.0};
315 elec.
R[2] = {0.0, 0.5, 0.0};
316 elec.
R[3] = {0.5, 0.5, 0.0};
317 elec.
R[4] = {0.0, 0.0, 0.0};
318 elec.
R[5] = {0.5, 0.0, 0.0};
319 elec.
R[6] = {0.0, 0.5, 0.0};
320 elec.
R[7] = {0.5, 0.5, 0.0};
321 for (
int i=0;i<npart/2;i++)
323 for (
int i=npart/2;i<npart;i++)
326 for (
int i=0;i<npart;i++)
335 tspecies(chargeIdx, upIdx) = -1;
336 tspecies(massIdx, upIdx) = 1.0;
346 const double vmad_hon = -1.510964233;
347 const double vmad_tri = -1.106102587;
351 for (
int itest=0; itest<ntest; itest++)
353 for (
int i=npart/2;i<npart;i++)
354 elec.
R[i][2] = zheight[itest];
357 CHECK(val/npart == Approx(vmad_ref[itest]));
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
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 ...
for(int i=0;i< size_test;++i) CHECK(Approx(gauss_random_vals[offset_for_rs+i])
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.