def test_4_sgops(self): """Tests the space group finder that returns all the rotation matrices for a lattice. """ from celib.symmetry_module import get_spacegroup result = get_spacegroup(self.lattice, self.atomtypes, self.basis, True, 1e-10) #The FCC lattice has 48 point group operations; we want to check each of them #against the correct values. self.assertEqual(result.sg_op.shape, (3, 3, 48)) #We have to load the correct symmetry operations from file to check against. sgops = path.join(self.fdir, "sgops.dat") with open(sgops) as f: lines = f.readlines() model = self._read_sgopgs(lines, 48) for i in range(48): self.assertTrue( allclose(model[i], result.sg_op[:, :, i]), "\n{}\n{}\n\n{}".format(i, model[i], result.sg_op[:, :, i]))
def test_4_sgops(self): """Tests the space group finder that returns all the rotation matrices for a lattice. """ from celib.symmetry_module import get_spacegroup result = get_spacegroup(self.lattice, self.atomtypes, self.basis, True, 1e-10) # The FCC lattice has 48 point group operations; we want to check each of them # against the correct values. self.assertEqual(result.sg_op.shape, (3, 3, 48)) # We have to load the correct symmetry operations from file to check against. sgops = path.join(self.fdir, "sgops.dat") with open(sgops) as f: lines = f.readlines() model = self._read_sgopgs(lines, 48) for i in range(48): self.assertTrue( allclose(model[i], result.sg_op[:, :, i]), "\n{}\n{}\n\n{}".format(i, model[i], result.sg_op[:, :, i]) )
from celib.symmetry_module import make_primitive, get_spacegroup from numpy import array, reshape a = array([[.5, .5, 0], [0, .5, .5], [.5, 0, .5]]) b = array([1]) c = array([[0], [0], [0]]) result = get_spacegroup(a, b, c, True, 1e-10) print(result.sg_op.flags) for i in range(7): print(result.sg_op[:, :, i]) #result = make_primitive(a, b, c, True, 1e-10)
from celib.symmetry_module import make_primitive, get_spacegroup from numpy import array, reshape a = array([[.5,.5,0],[0,.5,.5],[.5,0,.5]]) b = array([1]) c = array([[0],[0],[0]]) result = get_spacegroup(a, b, c, True, 1e-10) print(result.sg_op.flags) for i in range(7): print(result.sg_op[:,:,i]) #result = make_primitive(a, b, c, True, 1e-10)