Esempio n. 1
0
    def setUp(self):
        from pygmin.potentials.rigid_bodies.molecule import Molecule, setupLWOTP
        from pygmin.potentials.rigid_bodies.sandbox import RBSandbox
        from pygmin.potentials.lj import LJ
        from pygmin.optimize import lbfgs_py as quench

        #set up system
        nmol = 5
        self.nmol = nmol
        otp = setupLWOTP()
        #set up a list of molecules
        mols = [otp for i in range(nmol)]
        # define the interaction matrix for the system.
        # for LWOTP there is only one atom type, so this is trivial
        lj = LJ()
        interaction_matrix = [[lj]]
        #set up the RBSandbox object
        mysys = RBSandbox(mols, interaction_matrix)
        self.pot = mysys
        self.nsites = mysys.nsites

        self.permlist = [range(nmol)]

        self.coords1 = testmindist.randomCoordsAA(nmol)
        ret = quench(self.coords1, self.pot.getEnergyGradient)
        self.coords1 = ret[0]
Esempio n. 2
0
 def setUp(self):
     from pygmin.potentials.rigid_bodies.molecule import Molecule, setupLWOTP
     from pygmin.potentials.rigid_bodies.sandbox import RBSandbox
     from pygmin.potentials.lj import LJ
     from pygmin.optimize import lbfgs_py as quench
     
     #set up system
     nmol = 5
     self.nmol = nmol
     otp = setupLWOTP()
     #set up a list of molecules
     mols = [otp for i in range(nmol)]
     # define the interaction matrix for the system.
     # for LWOTP there is only one atom type, so this is trivial
     lj = LJ()
     interaction_matrix = [[lj]]
     #set up the RBSandbox object
     mysys = RBSandbox(mols, interaction_matrix)
     self.pot = mysys
     self.nsites = mysys.nsites
 
     self.permlist = [range(nmol)]
     
     self.coords1 = testmindist.randomCoordsAA(nmol)
     ret = quench(self.coords1, self.pot.getEnergyGradient)
     self.coords1 = ret[0]
Esempio n. 3
0
def test_LWOTP(nmol=5):
    from pygmin.potentials.rigid_bodies.molecule import Molecule, setupLWOTP
    from pygmin.potentials.rigid_bodies.sandbox import RBSandbox
    from pygmin.potentials.lj import LJ
    from pygmin.optimize import lbfgs_py as quench

    printlist = []

    #set up system
    otp = setupLWOTP()
    #set up a list of molecules
    mols = [otp for i in range(nmol)]
    # define the interaction matrix for the system.
    # for LWOTP there is only one atom type, so this is trivial
    lj = LJ()
    interaction_matrix = [[lj]]
    #set up the RBSandbox object
    mysys = RBSandbox(mols, interaction_matrix)
    nsites = mysys.nsites

    permlist = [range(nmol)]

    #define initial coords
    coords1 = randomCoords(nmol)
    printlist.append((coords1.copy(), "very first"))
    #quench X1
    ret = quench(coords1, mysys.getEnergyGradient)
    coords1 = ret[0]

    #define initial coords2
    coords2 = randomCoords(nmol)
    printlist.append((coords2.copy(), "very first"))
    #quench X2
    ret = quench(coords2, mysys.getEnergyGradient)
    coords2 = ret[0]
    coords2in = coords2.copy()

    printlist.append((coords1.copy(), "after quench"))
    printlist.append((coords2.copy(), "after quench"))

    print "******************************"
    print "testing for OTP not isomer"
    print "******************************"
    d, c1new, c2new = test(coords1, coords2, mysys, permlist)

    print "******************************"
    print "testing for OTP ISOMER"
    print "******************************"
    coords1 = coords2in.copy()
    coords2 = c2new.copy()
    #try to reverse the permutations and symmetry operations we just applied
    test(coords1, coords2, mysys, permlist)
Esempio n. 4
0
def test_LWOTP(nmol = 5):
    from pygmin.potentials.rigid_bodies.molecule import Molecule, setupLWOTP
    from pygmin.potentials.rigid_bodies.sandbox import RBSandbox
    from pygmin.potentials.lj import LJ
    from pygmin.optimize import lbfgs_py as quench

    printlist = []
    
    #set up system
    otp = setupLWOTP()
    #set up a list of molecules
    mols = [otp for i in range(nmol)]
    # define the interaction matrix for the system.
    # for LWOTP there is only one atom type, so this is trivial
    lj = LJ()
    interaction_matrix = [[lj]]
    #set up the RBSandbox object
    mysys = RBSandbox(mols, interaction_matrix)
    nsites = mysys.nsites

    permlist = [range(nmol)]

    #define initial coords
    coords1 = randomCoords(nmol)
    printlist.append( (coords1.copy(), "very first"))
    #quench X1
    ret = quench( coords1, mysys.getEnergyGradient)
    coords1 = ret[0]
    
    #define initial coords2
    coords2 = randomCoords(nmol)
    printlist.append( (coords2.copy(), "very first"))
    #quench X2
    ret = quench( coords2, mysys.getEnergyGradient)
    coords2 = ret[0]
    coords2in = coords2.copy()
    
    printlist.append((coords1.copy(), "after quench"))
    printlist.append((coords2.copy(), "after quench"))

    print "******************************"
    print "testing for OTP not isomer"
    print "******************************"
    d, c1new, c2new = test(coords1, coords2, mysys, permlist)
    
    print "******************************"
    print "testing for OTP ISOMER"
    print "******************************"
    coords1 = coords2in.copy()
    coords2 = c2new.copy()
    #try to reverse the permutations and symmetry operations we just applied 
    test(coords1, coords2, mysys, permlist)
Esempio n. 5
0
 def createSystem(self):
     import pygmin.potentials.lj as lj
     from pygmin.potentials.rigid_bodies.molecule import setupLWOTP
     from pygmin.potentials.rigid_bodies.sandbox import RBSandbox
     #setup otp molecule
     otp = setupLWOTP()
     #set up interactions between sites
     potential = lj.LJ()
     interaction_matrix = [[potential]]
     #set up system
     mols = [otp for i in range(self.nmol)]
     mysys = RBSandbox(mols, interaction_matrix)
     return mysys