Example #1
0
 def test_replace_gamma_trs(self):
     g = geom.graphene()
     bz = MonkhorstPack(g, [2, 2, 2], trs=False)
     bz_gamma = MonkhorstPack(g, [3, 3, 3], size=[0.5] * 3, trs=True)
     assert len(bz) == 2 ** 3
     bz.replace([0] * 3, bz_gamma)
     assert len(bz) == 2 ** 3 + 3 ** 3 - 3 ** 2 - 1
     assert bz.weight.sum() == pytest.approx(1.)
Example #2
0
 def test_replace_gamma(self):
     g = geom.graphene()
     bz = MonkhorstPack(g, 2, trs=False)
     bz_gamma = MonkhorstPack(g, [2, 2, 2], size=[0.5] * 3, trs=False)
     assert len(bz) == 2**3
     bz.replace([0] * 3, bz_gamma)
     assert len(bz) == 2**3 + 2**3 - 1
     assert bz.weight.sum() == pytest.approx(1.)
     assert np.allclose(bz.copy().k, bz.k)
     assert np.allclose(bz.copy().weight, bz.weight)