示例#1
0
    def _determine_inversion(self, permlist):
        x = np.array(self.atom_positions).flatten()
        xi = -x
        exact = ExactMatchAtomicCluster(permlist=permlist, can_invert=False)

        for rot, invert in exact.standard_alignments(x, xi):
            if exact.check_match(x, xi, rot, invert):
                self.inversion = exact._last_checked_rotation
                return
示例#2
0
def testlj75(): # pragma: no cover
    import numpy as np
    coords = np.genfromtxt("tests/coords.lj75.gmin")
    from pele.mindist import ExactMatchAtomicCluster
    
    permlist = [list(range(75))]
    match = ExactMatchAtomicCluster(permlist=permlist, can_invert=True)
    calculator = PointGroupOrderCluster(match)
    pgorder = calculator(coords)
    print(pgorder)
示例#3
0
 def _determine_rotational_symmetry(self, permlist):
     x = np.array(self.atom_positions).flatten()
     exact = ExactMatchAtomicCluster(permlist=permlist, can_invert=False)
     for rot, invert in exact.standard_alignments(x, x):
         if exact.check_match(x, x, rot, invert):
             rot = exact._last_checked_rotation
             exists = False
             for rot2 in self.symmetries:
                 if np.linalg.norm(rot2 - rot) < 1e-6:
                     exists = True
                     break
             if not exists:
                 self.symmetries.append(rot)
示例#4
0
    def test1(self):
        d = os.path.dirname(__file__)
        fname = os.path.join(d, "coords.lj75.gmin.xyz")
        xyz = read_xyz(open(fname, "r"))
        coords = xyz.coords.reshape(-1)
        print fname
        self.assertEqual(coords.size, 75 * 3)

        permlist = [range(75)]
        match = ExactMatchAtomicCluster(permlist=permlist, can_invert=True)
        calculator = PointGroupOrderCluster(match)
        pgorder = calculator(coords)
        #        print pgorder

        self.assertEqual(pgorder, 20)
示例#5
0
    def test1(self):
        d = os.path.dirname(__file__)
        dbfname = os.path.join(d, "lj75_very_small_pathsample.sqlite")

        from pele.systems import LJCluster
        natoms = 75
        system = LJCluster(natoms)
        db = system.create_database(dbfname, createdb=False)

        permlist = [range(natoms)]

        ts_min = list(db.minima()) + list(db.transition_states())

        for m in ts_min:
            match = ExactMatchAtomicCluster(permlist=permlist, can_invert=True)
            calculator = PointGroupOrderCluster(match)
            pgorder = calculator(m.coords)
            self.assertEqual(pgorder, m.pgorder)
示例#6
0
    def test1(self):
        from pele.systems import LJCluster
        natoms = 13
        system = LJCluster(natoms)
        db = system.create_database()
        bh = system.get_basinhopping(db)
        bh.setPrinting(ostream=None)
        while db.minima()[0].energy > -44.3:
            bh.run(10)

        m = db.minima()[0]
        permlist = [range(natoms)]
        match = ExactMatchAtomicCluster(permlist=permlist, can_invert=True)
        calculator = PointGroupOrderCluster(match)
        pgorder = calculator(m.coords)
        #        print pgorder

        self.assertEqual(pgorder, 120)
示例#7
0
 def get_compare_exact(self, **kwargs):
     """this function quickly determines whether two clusters are identical
     given translational, rotational and permutational symmeties
     """
     permlist = self.get_permlist()
     return ExactMatchAtomicCluster(permlist=permlist, **kwargs)
示例#8
0
 def get_compare_exact(self, **kwargs):
     permlist = self.get_permlist()
     return ExactMatchAtomicCluster(permlist=permlist, **kwargs)
示例#9
0
 def setUp(self):
     self.natoms = 11
     self.system = LJCluster(self.natoms)
     self.match = ExactMatchAtomicCluster(
         permlist=self.system.get_permlist(), can_invert=True)
示例#10
0
 def get_compare_exact(self, **kwargs):
     permlist = [range(self.natoms)]
     return ExactMatchAtomicCluster(permlist=permlist, **kwargs)