20 TEST_CASE(
"kcontainer at gamma in 3D",
"[longrange]")
23 const double alat = 1.0;
24 const double blat = 2 * M_PI / alat;
28 const std::vector<int> nks = {6, 18, 26};
35 for (
int ik = 0; ik < kcs.size(); ik++)
37 const double kc = kcs[ik] + 1
e-6;
41 const int mxk = klists.
kpts.size();
42 int gvecs[26][3] = {{-1, 0, 0}, {0, -1, 0}, {0, 0, -1}, {0, 0, 1}, {0, 1, 0}, {1, 0, 0}, {-1, -1, 0},
43 {-1, 0, -1}, {-1, 0, 1}, {-1, 1, 0}, {0, -1, -1}, {0, -1, 1}, {0, 1, -1}, {0, 1, 1},
44 {1, -1, 0}, {1, 0, -1}, {1, 0, 1}, {1, 1, 0}, {-1, -1, -1}, {-1, -1, 1}, {-1, 1, -1},
45 {-1, 1, 1}, {1, -1, -1}, {1, -1, 1}, {1, 1, -1}, {1, 1, 1}};
47 for (
int ik = 0; ik < mxk; ik++)
49 for (
int ldim = 0; ldim < ndim; ldim++)
51 CHECK(klists.
kpts[ik][ldim] == gvecs[ik][ldim]);
57 TEST_CASE(
"kcontainer at twist in 3D",
"[longrange]")
60 const double alat = 1.0;
61 const double blat = 2 * M_PI / alat;
64 const double kc = blat + 1
e-6;
78 twist = {-0.5, 0, 0.5};
80 int gvecs[3][3] = {{0, 0, -1}, {1, 0, -1}, {1, 0, 0}};
82 for (
int ik = 0; ik < klists.
kpts.size(); ik++)
83 for (
int ldim = 0; ldim < ndim; ldim++)
84 CHECK(klists.
kpts_cart[ik][ldim] == Approx(blat * (twist[ldim] + gvecs[ik][ldim])));
87 TEST_CASE(
"kcontainer at gamma in 2D",
"[longrange]")
90 const double alat = 1.0;
91 const double blat = 2 * M_PI / alat;
94 const std::vector<double> kcs = {blat,
std::sqrt(2) * blat, 2 * blat};
95 const std::vector<int> nks = {4, 8, 12};
102 for (
int ik = 0; ik < kcs.size(); ik++)
104 const double kc = kcs[ik] + 1
e-6;
108 const int mxk = klists.
kpts.size();
110 {-1, 0, 0}, {0, -1, 0}, {0, 1, 0}, {1, 0, 0}, {-1, -1, 0}, {-1, 1, 0},
111 {1, -1, 0}, {1, 1, 0}, {-2, 0, 0}, {0, -2, 0}, {0, 2, 0}, {2, 0, 0},
114 for (
int ik = 0; ik < mxk; ik++)
116 for (
int ldim = 0; ldim < ndim; ldim++)
118 CHECK(klists.
kpts[ik][ldim] == gvecs[ik][ldim]);
127 const double alat = 1.0;
128 const double blat = 2 * M_PI / alat;
131 const double kc = blat + 1
e-6;
153 twist = {-0.5, 0.5, 0};
a class that defines a supercell in D-dimensional Euclean space.
std::vector< PosType > kpts_cart
K-vector in Cartesian coordinates.
helper functions for EinsplineSetBuilder
TEST_CASE("complex_helper", "[type_traits]")
CrystalLattice< OHMMS_PRECISION, OHMMS_DIM > lattice
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 }))
void updateKLists(const ParticleLayout &lattice, RealType kc, unsigned ndim, const PosType &twist=PosType(), bool useSphere=true)
k points sorted by the |k| excluding |k|=0
std::vector< TinyVector< int, DIM > > kpts
K-vector in reduced coordinates.