예제 #1
0
 $CONTRL SCFTYP=RHF RUNTYP=GRADIENT MPLEVL=2 $END
 $SYSTEM MWORDS=500 MEMDDI=500 $END
-$CONTRL EXETYP=CHECK $END
 $CONTRL MAXIT=200 $END
-$STATPT OPTTOL=1.0E-5 $END
-$STATPT NSTEP=300 $END
-$DFT NTHE=36 NPHI=72 $END
 $SCF DIRSCF=.T. $END
 $BASIS GBASIS=N311 NGAUSS=6 NDFUNC=2 NPFUNC=2 DIFFSP=.T. DIFFS=.T. $END
 $GUESS GUESS=HUCKEL $END
 $DATA
--Cartesian coordinates with C1 symmetry as follows:
C1
"""

calculator = EFT_calculator()
calculator.setup()
# Please change the following code to whatever needed to generate the input
# coordinates files
# Please make sure to carry the id number along with the results
root = 'pdbRQ.dat'
if not os.path.exists(root): os.mkdir(root)


def mol2mol_init(ele):
    mol = [[i, 0.0, 0.0, 0.0] for i in ele]
    return mol


size = 200
folder_id = 0
예제 #2
0
        pdb = open("%s/eft.%s.pdb" % (folder, idx), "w")
        pdb.write(coors)
        pdb.close()
        file_count += 1


if __name__ == '__main__':
    if len(sys.argv) < 2:
        print("\n       Usage:#0 figname.png [datfilename.dat err_cutoff]\n")
        sys.exit()
    figname = sys.argv[1]  # a output fig name
    databaseName = sys.argv[2]

    t0 = time()
    cc = Classical_calculator()
    if os.path.exists(databaseName):
        print("loaded a old database")
        calculator = EFT_calculator(databaseName)
    else:
        print("created a new mesh")
        calculator = EFT_calculator()
    if len(sys.argv) == 4:
        error_cutoff = float(sys.argv[3])
        print("set cutoff as %f" % (error_cutoff))
        calculator.fill_grid(cc, databaseName, error_cutoff)
    t1 = time()
    print('took %.1f s to fill the grid' % (t1 - t0))
    test_random_set()
    #randomSample()
    grids_conf()
예제 #3
0
    #    print -de, name

    # make a plot
    _, axarr = plt.subplots(1, 3)
    p = np.corrcoef(e0, e1)[0, 1]
    print "Energy: p =", p
    axarr[0].scatter(e0, e1)
    axarr[0].text(0, 0, 'p=%.4f' % p)
    p = np.corrcoef(fce0, fce1)[0, 1]
    print "Force: p =", p
    axarr[1].scatter(fce0, fce1)
    axarr[1].text(0, 0, 'p=%.4f' % p)
    p = np.corrcoef(trq0, trq1)[0, 1]
    print "Torque: p =", p
    axarr[2].scatter(trq0, trq1)
    axarr[2].text(0, 0, 'p=%.4f' % p)
    plt.savefig('corr.png')


if __name__ == '__main__':
    order = 3
    calculator = EFT_calculator(order)
    t0 = time()
    cc = Classical_calculator()
    #calculator.setup('grid_data.txt')
    calculator.setup()
    calculator.fill_grid(cc)
    t1 = time()
    print 'took %.1f s to fill the grid' % (t1 - t0)
    test_random_set()
예제 #4
0
 $CONTRL SCFTYP=RHF RUNTYP=GRADIENT MPLEVL=2 $END
 $SYSTEM MWORDS=500 MEMDDI=500 $END
-$CONTRL EXETYP=CHECK $END
 $CONTRL MAXIT=200 $END
-$STATPT OPTTOL=1.0E-5 $END
-$STATPT NSTEP=300 $END
-$DFT NTHE=36 NPHI=72 $END
 $SCF DIRSCF=.T. $END
 $BASIS GBASIS=N311 NGAUSS=6 NDFUNC=2 NPFUNC=2 DIFFSP=.T. DIFFS=.T. $END
 $GUESS GUESS=HUCKEL $END
 $DATA
--Cartesian coordinates with C1 symmetry as follows:
C1
"""

calculator = EFT_calculator()
calculator.setup()
# Please change the following code to whatever needed to generate the input
# coordinates files
# Please make sure to carry the id number along with the results
root = 'conf.dat'
if not os.path.exists(root): os.mkdir(root)


def mol2mol_init(ele):
    mol = [[i, 0.0, 0.0, 0.0] for i in ele]
    return mol


size = 200
folder_id = 0
예제 #5
0
    err1 = rmse(fce0,fce1)
    q1 = uqi(fce0,fce1)
    err2 = rmse(fce0,fce2)
    q2 = uqi(fce0,fce2)
    axarr[1,0].scatter(fce0, fce1,c='blue')
    axarr[1,0].scatter(fce0, fce2,c='red')
    axarr[1,0].set_xlabel('qF:rmse=%.4f, uqi=%.4f\nmmF:rmse=%.4f, uqi=%.4f'%(err1,q1,err2,q2))
    
    err1 = rmse(trq0,trq1)
    q1 = uqi(trq0,trq1)
    err2 = rmse(trq0,trq2)
    q2 = uqi(trq0,trq2)
    axarr[1,1].scatter(trq0, trq1,c='blue')
    axarr[1,1].scatter(trq0, trq2,c='red')
    axarr[1,1].set_xlabel('qT:rmse=%.4f, uqi=%.4f\nmmT:rmse=%.4f, uqi=%.4f'%(err1,q1,err2,q2))
    plt.savefig('corr.png')


if __name__ == '__main__':
    order = 3
    calculator = EFT_calculator(order)
    t0 = time()
    cc = Classical_calculator()
    #acalculator.setup('grid_data.txt')
    calculator.setup('grid.dat')
    #calculator.fill_grid(cc)
    t1 = time()
    print 'took %.1f s to fill the grid' % (t1 - t0)
    test_random_set(sys.argv[1]) # a file with a list of location of QM .log file

예제 #6
0
    #for i in range(2, 3):
        name = 'test%04d.inp' % i
        coors = load_coordinates(name)
        eft = calculator.eval(coors[:3], coors[3:])
        Ofile.write('%s %12.7f\n'%(name, eft[0]))
        Ofile.flush()
        fout1.write('%s %12.7f %12.7f %12.7f\n'%(name, eft[1], eft[2], eft[3]))
        fout1.flush()
        fout2.write('%s %12.7f %12.7f %12.7f\n'%(name, eft[4], eft[5], eft[6]))
        fout2.flush()
        ener.append(eft[0])
        force.append(eft[1:4])
        torque.append(eft[4:7])
    t1 = time()
    print 'took %.1f s to evaluate the random set' % (t1 - t0)
    Ofile.close()
    fout1.close()
    fout2.close()
    return ener, force, torque


if __name__ == '__main__':
    order = 2
    calculator = EFT_calculator(order)
    t0 = time()
    calculator.setup('grid.dat')
    t1 = time()
    print 'took %.1f s to fill the grid' % (t1 - t0)
    ener, force, torque = test_random_set()

예제 #7
0
#!/usr/bin/env python2
import numpy as np
from eft_calculator import EFT_calculator, Water
import tools
import sys
from time import time

qmLogList = sys.argv[1]
calculator = EFT_calculator()
t1 = time()
calculator.setup()
t2 = time()
calculator.fill_with_QM(qmLogList)
t3 = time()
calculator.grid.save("grid.dat")
t4 = time()
print('took %.1fs, %.1fs, %.1fs s to setup, fill and save' %
      (t2 - t1, t3 - t2, t4 - t3))
예제 #8
0
#!/usr/bin/env python2
import os,sys
from eft_calculator import EFT_calculator

calculator = EFT_calculator('wtr','alc')
#calculator = EFT_calculator('alc','wtr')
calculator.setup()
# Please change the following code to whatever needed to generate the input 
# coordinates files
# Please make sure to carry the id number along with the results
root = calculator.com.frg + '_' + calculator.probe.frg + '.confs.dat'
if not os.path.exists(root):os.mkdir(root)
def mol2mol_init(ele):
    mol = [[i,0.0,0.0,0.0] for i in ele]
    return mol
size = 200
folder_id = 0
file_count = 0
#confs =  calculator.grid.gen_grid_x()
#for idx, coors in calculator.gen_PDB(confs): 
for idx, coors in calculator.gen_PDB(): 
#for id, coors in calculator.gen_atomic_coors(0,10): 
    #print(idx, coors)

    if  file_count%size == 0:
        folder = os.path.join(root,"EFT_%04d"%(folder_id))
        if not os.path.exists(folder):os.mkdir(folder)
        folder_id += 1
    pdb = open("%s/eft.%s.pdb"%(folder,str(idx)),"w")
    pdb.write(coors)
    pdb.close()