Skip to content

Commit

Permalink
update the band structure test to use a grid that avoids high symmetr…
Browse files Browse the repository at this point in the history
…y points, to avoid issues with slightly different eigenvectors coming out when Eigen is used with OMP threads
  • Loading branch information
jcoulter12 committed Oct 16, 2023
1 parent dc51466 commit 4b5c1a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/band_structure_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ TEST(FullBandStructureTest, BandStructureStorage) {
//------------end setup-----------//

Eigen::Vector3i qMesh;
qMesh << 10, 10, 10;
qMesh << 7, 7, 7;
Points points(crystal, qMesh);

bool withVelocities = true;
Expand All @@ -38,6 +38,7 @@ TEST(FullBandStructureTest, BandStructureStorage) {
int ik = 7;
auto ikIndex = WavevectorIndex(ik);
Point point = bandStructure.getPoint(ik);
// set up phonon band quantities from direct diag
auto tup1 = phononH0.diagonalize(point);
auto ensT = std::get<0>(tup1);
auto eigenVectorsT = std::get<1>(tup1);
Expand All @@ -48,7 +49,8 @@ TEST(FullBandStructureTest, BandStructureStorage) {
bandStructure.getPhEigenvectors(ikIndex);
auto velocities = bandStructure.getVelocities(ikIndex);

// now we check the difference
// now we check the difference between direct diag and
// bandstructure calculation
double x1 = (ens - ensT).norm();
ASSERT_NEAR(x1, 0.,1e-14);

Expand Down

0 comments on commit 4b5c1a1

Please sign in to comment.