Esempio n. 1
0
    def test_equivalence_to_spacegroup(self):

        # first 230 magnetic space groups have same symmetry operations
        # as normal space groups, so should give same orbits

        labels = ["Fm-3m", "Pnma", "P2/c", "P-1"]

        points = [[0, 0, 0], [0.5, 0, 0], [0.11, 0.22, 0.33]]

        for label in labels:
            sg = SpaceGroup(label)
            msg = MagneticSpaceGroup(label)
            self.assertEqual(sg.crystal_system, msg.crystal_system)
            for p in points:
                pp_sg = np.array(sg.get_orbit(p))
                pp_msg = np.array(msg.get_orbit(p, 0)[0])  # discarding magnetic moment information
                pp_sg = pp_sg[np.lexsort(np.transpose(pp_sg)[::-1])]  # sorting arrays so we can compare them
                pp_msg = pp_msg[np.lexsort(np.transpose(pp_msg)[::-1])]
                self.assertTrue(np.allclose(pp_sg, pp_msg))
Esempio n. 2
0
    def test_equivalence_to_spacegroup(self):

        # first 230 magnetic space groups have same symmetry operations
        # as normal space groups, so should give same orbits

        labels = ["Fm-3m", "Pnma", "P2/c", "P-1"]

        points = [[0, 0, 0],
                  [0.5, 0, 0],
                  [0.11, 0.22, 0.33]]

        for label in labels:
            sg = SpaceGroup(label)
            msg = MagneticSpaceGroup(label)
            self.assertEqual(sg.crystal_system, msg.crystal_system)
            for p in points:
                pp_sg = np.array(sg.get_orbit(p))
                pp_msg = np.array(msg.get_orbit(p, 0)[0])  # discarding magnetic moment information
                pp_sg = pp_sg[np.lexsort(np.transpose(pp_sg)[::-1])]  # sorting arrays so we can compare them
                pp_msg = pp_msg[np.lexsort(np.transpose(pp_msg)[::-1])]
                self.assertTrue(np.allclose(pp_sg, pp_msg))
Esempio n. 3
0
 def test_get_orbit(self):
     sg = SpaceGroup("Fm-3m")
     p = np.random.randint(0, 100 + 1, size=(3,)) / 100
     self.assertLessEqual(len(sg.get_orbit(p)), sg.order)
Esempio n. 4
0
 def test_get_orbit(self):
     sg = SpaceGroup("Fm-3m")
     p = np.random.randint(0, 100 + 1, size=(3, )) / 100
     self.assertLessEqual(len(sg.get_orbit(p)), sg.order)
Esempio n. 5
0
 def test_get_orbit(self):
     sg = SpaceGroup("Fm-3m")
     p = np.random.random_integers(0, 100, size=(3,))
     p /= 100
     self.assertLessEqual(len(sg.get_orbit(p)), sg.order)
Esempio n. 6
0
 def test_get_orbit(self):
     sg = SpaceGroup("Fm-3m")
     p = np.random.random_integers(0, 100, size=(3, ))
     p /= 100
     self.assertLessEqual(len(sg.get_orbit(p)), sg.order)