def test_to_from_dict(self): op = SymmOp([[3, -2, -1, 0.5], [-1, 0, 0, 12. / 13], [0, 0, 1, 0.5 + 1e-7], [0, 0, 0, 1]]) magop = MagSymmOp.from_symmop(op, -1) magop2 = MagSymmOp.from_dict(magop.as_dict()) self.assertEqual(magop2.time_reversal, -1) self.assertEqual(magop2.as_xyzt_string(), '3x-2y-z+1/2, -x+12/13, z+1/2, -1')
def test_xyzt_string(self): xyzt_strings = [ 'x, y, z, +1', 'x, y, z, -1', '-y+1/2, x+1/2, x+1/2, +1' ] for xyzt_string in xyzt_strings: op = MagSymmOp.from_xyzt_string(xyzt_string) xyzt_string_out = op.as_xyzt_string() self.assertEqual(xyzt_string, xyzt_string_out) op = SymmOp([[3, -2, -1, 0.5], [-1, 0, 0, 12. / 13], [0, 0, 1, 0.5 + 1e-7], [0, 0, 0, 1]]) magop = MagSymmOp.from_symmop(op, -1) magop_str = magop.as_xyzt_string() self.assertEqual(magop.time_reversal, -1) self.assertEqual(magop_str, '3x-2y-z+1/2, -x+12/13, z+1/2, -1')
def test_xyzt_string(self): xyzt_strings = ['x, y, z, +1', 'x, y, z, -1', '-y+1/2, x+1/2, x+1/2, +1'] for xyzt_string in xyzt_strings: op = MagSymmOp.from_xyzt_string(xyzt_string) xyzt_string_out = op.as_xyzt_string() self.assertEqual(xyzt_string, xyzt_string_out) op = SymmOp([[3, -2, -1, 0.5], [-1, 0, 0, 12. / 13], [0, 0, 1, 0.5 + 1e-7], [0, 0, 0, 1]]) magop = MagSymmOp.from_symmop(op, -1) magop_str = magop.as_xyzt_string() self.assertEqual(magop.time_reversal, -1) self.assertEqual(magop_str, '3x-2y-z+1/2, -x+12/13, z+1/2, -1')