def test_bcc(self): lvs = get_base(self.lc2) target = np.eye(3) np.testing.assert_almost_equal(lvs, target) target = np.eye(3)*2*np.pi rlvs = get_reciprocal_base(self.lc2) np.testing.assert_almost_equal(rlvs, target)
def test_bcc(self): lvs = get_base(self.lc2) target = np.eye(3) np.testing.assert_almost_equal(lvs, target) target = np.eye(3) * 2 * np.pi rlvs = get_reciprocal_base(self.lc2) np.testing.assert_almost_equal(rlvs, target)
def test_hcp(self): lvs = get_base(self.lc1) rlvs = get_reciprocal_base(self.lc1) target_v = np.array([[+0.2950800, -0.1475400, +0.0000000], [+0.0000000, +0.2555468, +0.0000000], [+0.0000000, +0.0000000, +0.4685500]]) target_rv = np.array([[+21.293159, +0.000000, +0.000000], [+12.293611, +24.587222, -0.000000], [-0.000000, -0.000000, +13.409850]]) # test real lattice np.testing.assert_almost_equal(lvs, target_v) # test reciprocal lattice np.testing.assert_almost_equal(rlvs, target_rv, decimal=6)
def test_hcp(self): lvs = get_base(self.lc1) rlvs = get_reciprocal_base(self.lc1) target_v = np.array([ [+0.2950800, -0.1475400, +0.0000000], [+0.0000000, +0.2555468, +0.0000000], [+0.0000000, +0.0000000, +0.4685500]]) target_rv = np.array([ [+21.293159, +0.000000, +0.000000], [+12.293611, +24.587222, -0.000000], [-0.000000, -0.000000, +13.409850]]) # test real lattice np.testing.assert_almost_equal(lvs, target_v) # test reciprocal lattice np.testing.assert_almost_equal(rlvs, target_rv, decimal=6)