Exemple #1
0
def restart():
	for n in ['aminopentane2_opt2']:
		os.system('cp gaussian/bind3_'+n+'.chk gaussian/bind3_'+n+'.1.chk')
		if n[-1]=='1':
			gaussian.job([], 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'.1', 'Opt=Restart', procs=1)
		elif n[-1]=='2':
			gaussian.job([], 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'.1', 'Opt=Restart SCRF(Solvent=n-Hexane)', procs=1)
Exemple #2
0
def job(atoms, name, previous_job=None):
	
	route = 'SP SCRF(Solvent=Acetone) guess=read SCF=QC'
	i = 1
	while os.path.isfile('gaussian/'+name+'.log'):
		name = name[:-1] + str(i)
		i = i+1
	gaussian.job(atoms, 'HSEH1PBE/LANL2DZ', 'long', name, route, previous=previous_job)
	return name
Exemple #3
0
def job(atoms, name, previous_job=None):

    route = 'SP SCRF(Solvent=Acetone) guess=read SCF=QC'
    i = 1
    while os.path.isfile('gaussian/' + name + '.log'):
        name = name[:-1] + str(i)
        i = i + 1
    gaussian.job(atoms,
                 'HSEH1PBE/LANL2DZ',
                 'long',
                 name,
                 route,
                 previous=previous_job)
    return name
Exemple #4
0
def restart():
    for n in ['aminopentane2_opt2']:
        os.system('cp gaussian/bind3_' + n + '.chk gaussian/bind3_' + n +
                  '.1.chk')
        if n[-1] == '1':
            gaussian.job([],
                         'M062X/aug-cc-pVDZ',
                         'batch',
                         'bind3_' + n + '.1',
                         'Opt=Restart',
                         procs=1)
        elif n[-1] == '2':
            gaussian.job([],
                         'M062X/aug-cc-pVDZ',
                         'batch',
                         'bind3_' + n + '.1',
                         'Opt=Restart SCRF(Solvent=n-Hexane)',
                         procs=1)
Exemple #5
0
def minimize():
    #for f in ['propanenitrile', 'butanenitrile', 'pentanenitrile', 'hexanenitrile', 'aminopropane2', 'aminobutane2', 'aminopentane2', 'aminohexane2', 'hexane2', 'methane']:
    for f in [
            'hcn34', 'cyanoacetylene34', 'acrylonitrile34', 'cyanoallene34',
            'acetonitrile34', 'hc5n34'
    ]:
        atoms = utils.Molecule(f + '.arc').atoms
        gaussian.job(atoms,
                     'M062X/aug-cc-pVDZ',
                     'batch',
                     f + '_0',
                     'Opt',
                     procs=1)
        gaussian.job(atoms,
                     'M062X/aug-cc-pVDZ',
                     'batch',
                     f + '_1',
                     'Opt SCRF(Solvent=n-Hexane)',
                     procs=1)
Exemple #6
0
def job(atoms, name, previous_job=None):
	
	route = 'SP SCRF(Solvent=Butanal) SCF=(QC,maxcycles=2000)'
	i = 1
	while os.path.isfile('gaussian/'+name+'.log'):
		name = name[:-1] + str(i)
		i = i+1

	elements = [a.element.replace('-Bq', '') for a in atoms]
	
	

	if 'H' in elements and 'I' in elements:
		gaussian.job(atoms, 'HSEH1PBE/GenECP', 'batch', name, route, previous=previous_job, extra_section='''H C O 0\ncc-pVDZ\n****
Pb 0\nSDD\n****
I 0\nDef2TZVP\n****

Pb 0\nSDD
I 0\nDef2TZVP\n\n''')
	elif 'Pb' in elements:
		gaussian.job(atoms, 'HSEH1PBE/GenECP', 'batch', name, route, previous=previous_job, extra_section='''Pb 0\nSDD\n****
I 0\nDef2TZVP\n****

Pb 0\nSDD
I 0\nDef2TZVP\n\n''')
	else:
		gaussian.job(atoms, 'HSEH1PBE/cc-pVDZ', 'batch', name, route, previous=previous_job)
	return name
Exemple #7
0
def job(atoms, name, previous_job=None):

    route = 'SP SCRF(Solvent=Acetone) guess=read SCF=QC'
    i = 1
    while os.path.isfile('gaussian/' + name + '.log'):
        name = name[:-1] + str(i)
        i = i + 1

    elements = [a.element.replace('-Bq', '') for a in atoms]

    if 'H' in elements and 'Cl' in elements:
        gaussian.job(atoms,
                     'HSEH1PBE/GenECP',
                     'long',
                     name,
                     route,
                     previous=previous_job,
                     extra_section='''H C O Cl 0\ncc-pVDZ\n****
Pb 0\nSDD\n****

Pb 0\nSDD\n\n''')
    elif 'Pb' in elements:
        gaussian.job(atoms,
                     'HSEH1PBE/GenECP',
                     'long',
                     name,
                     route,
                     previous=previous_job,
                     extra_section='''Cl 0\ncc-pVDZ\n****
Pb 0\nSDD\n****

Pb 0\nSDD\n\n''')
    else:
        gaussian.job(atoms,
                     'HSEH1PBE/cc-pVDZ',
                     'long',
                     name,
                     route,
                     previous=previous_job)
    return name
def job(atoms, name, previous_job=None):
	
	route = 'SP SCRF(Solvent=Acetone) guess=read SCF=QC'
	i = 1
	while os.path.isfile('gaussian/'+name+'.log'):
		name = name[:-1] + str(i)
		i = i+1

	elements = [a.element.replace('-Bq','') for a in atoms]

	if 'H' in elements and 'Cl'  in elements:
		gaussian.job(atoms, 'HSEH1PBE/GenECP', 'long', name, route, previous=previous_job, extra_section='''H C O Cl 0\ncc-pVDZ\n****
Pb 0\nSDD\n****

Pb 0\nSDD\n\n''')
	elif 'Pb' in elements:
		gaussian.job(atoms, 'HSEH1PBE/GenECP', 'long', name, route, previous=previous_job, extra_section='''Cl 0\ncc-pVDZ\n****
Pb 0\nSDD\n****

Pb 0\nSDD\n\n''')
	else:
		gaussian.job(atoms, 'HSEH1PBE/cc-pVDZ', 'long', name, route, previous=previous_job)
	return name
def opt():
	gaussian.job( filetypes.parse_xyz('xyz/2_dmf_dma_pbi2_1.xyz'), 'HSEH1PBE/LanL2DZ', 'batch', '2_dmf_dma_pbi2_1', 'opt')
def acetone():
	gaussian.job( [], 'HSEH1PBE/LanL2DZ', 'batch', 'pbi2_1acetone_2', 'opt guess=read geom=(check,newdefinition)', previous='pbi2_1acetone_1')
def optpbi2():
	gaussian.job( [], 'HSEH1PBE/LanL2DZ', 'batch', 'pbi2opt_0', 'opt guess=read geom=(check,newdefinition)', previous='pbi2')
def d2o():
	for step in range(3,4):
		gaussian.job( filetypes.parse_xyz('xyz/pbi2_d2o_%d.xyz' % step), 'HSEH1PBE/LanL2DZ', 'batch', 'pbi2_d2o_%d' % step, 'opt guess=read geom=(read,newdefinition)', previous='')
def opt_acetone():
	#gaussian.job( filetypes.parse_xyz('xyz/acetone.xyz'), 'PM6', 'batch', 'acetone_pm6', 'Opt')
	gaussian.job([], 'HSEH1PBE/LanL2DZ', 'batch', 'acetone', 'Opt guess=read geom=(check,newdefinition)', previous='acetone_pm6')
def opt2():
	gaussian.job( filetypes.parse_xyz('xyz/DMSO.xyz'), 'HSEH1PBE/LanL2DZ', 'batch', 'DMSO', 'Opt')
def dmso():
	for step in range(7):
		gaussian.job( filetypes.parse_xyz('xyz/4_dp_%d.xyz' % step), 'HSEH1PBE/LanL2DZ', 'batch', '4_dp_%d' % step, 'opt')
def opt1():
	gaussian.job( filetypes.parse_xyz('xyz/3_2_2_dmf_dma_pbi2_7.xyz'), 'HSEH1PBE/LanL2DZ', 'batch', 'x_both_3_2_2_dmf_dma_pbi2_7', 'Opt', extra_section='B 13 36 F\nB 13 29 F\nA 13 36 29 F\nA 36 13 29F')
	gaussian.job( filetypes.parse_xyz('xyz/3_1_2_dmf_dma_pbi2_7.xyz'), 'HSEH1PBE/LanL2DZ', 'batch', 'x_both_3_1_2_dmf_dma_pbi2_7', 'Opt', extra_section='B 13 36 F\nB 13 29 F\nA 13 36 29 F\nA 36 13 29F')
	gaussian.job( filetypes.parse_xyz('xyz/3_3_1_dmf_dma_pbi2_7.xyz'), 'HSEH1PBE/LanL2DZ', 'batch', 'x_both_3_3_1_dmf_dma_pbi2_7', 'Opt', extra_section='B 13 36 F\nB 13 29 F\nA 13 36 29 F\nA 36 13 29F')
	gaussian.job( filetypes.parse_xyz('xyz/3_2_2_dmf_dma_pbi2_7.xyz'), 'HSEH1PBE/LanL2DZ', 'batch', 'x_n_3_2_2_dmf_dma_pbi2_7', 'Opt', extra_section='B 13 29 F\nA 13 29 36 F\nA 29 13 36F')
	gaussian.job( filetypes.parse_xyz('xyz/3_1_2_dmf_dma_pbi2_7.xyz'), 'HSEH1PBE/LanL2DZ', 'batch', 'x_n_3_1_2_dmf_dma_pbi2_7', 'Opt', extra_section='B 13 29 F\nA 13 29 36 F\nA 29 13 36F')
	gaussian.job( filetypes.parse_xyz('xyz/3_2_2_dmf_dma_pbi2_7.xyz'), 'HSEH1PBE/LanL2DZ', 'batch', 'x_i_3_2_2_dmf_dma_pbi2_7', 'Opt', extra_section='B 13 36 F\nA 13 29 36 F\nA 29 13 36F')
	gaussian.job( filetypes.parse_xyz('xyz/3_1_2_dmf_dma_pbi2_7.xyz'), 'HSEH1PBE/LanL2DZ', 'batch', 'x_i_3_1_2_dmf_dma_pbi2_7', 'Opt', extra_section='B 13 36 F\nA 13 29 36 F\nA 29 13 36F')
	gaussian.job( filetypes.parse_xyz('xyz/3_3_1_dmf_dma_pbi2_7.xyz'), 'HSEH1PBE/LanL2DZ', 'batch', 'x_i_3_3_1_dmf_dma_pbi2_7', 'Opt', extra_section='B 13 36 F\nA 13 29 36 F\nA 29 13 36F')
Exemple #17
0
def minimize():
	#for f in ['propanenitrile', 'butanenitrile', 'pentanenitrile', 'hexanenitrile', 'aminopropane2', 'aminobutane2', 'aminopentane2', 'aminohexane2', 'hexane2', 'methane']:
	for f in ['hcn34', 'cyanoacetylene34', 'acrylonitrile34', 'cyanoallene34', 'acetonitrile34', 'hc5n34']:
		atoms = utils.Molecule(f+'.arc').atoms
		gaussian.job(atoms, 'M062X/aug-cc-pVDZ', 'batch', f+'_0', 'Opt', procs=1)
		gaussian.job(atoms, 'M062X/aug-cc-pVDZ', 'batch', f+'_1', 'Opt SCRF(Solvent=n-Hexane)', procs=1)
Exemple #18
0
def binding():
    #for n in ['propanenitrile', 'butanenitrile', 'pentanenitrile', 'hexanenitrile', 'aminopropane2', 'aminobutane2', 'aminopentane2', 'aminohexane2', 'hexane2', 'methane', 'hcn2', 'cyanoacetylene2', 'acrylonitrile2', 'cyanoallene2', 'acetonitrile2', 'hc5n2']:
    for n in ['aminobutane2']:

        contents = open('lammps/bind3_' + n + '.log').read()

        opls_binding_e = float(
            re.search('\n1\s+(\S+)\s+Loop time of', contents).group(1))

        atoms = filetypes.parse_xyz('bind3_' + n + '.xyz')

        #opt0: use B97D
        #gaussian.job(atoms, 'B97D/TZVP/Fit', 'batch', 'bind3_'+n+'_opt0', 'Opt=Cartesian', procs=1)

        #opt1: use M062X
        #os.system('cp gaussian/bind3_'+n+'_opt0.chk gaussian/bind3_'+n+'_opt1.chk')
        #gaussian.job([], 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt1', 'Opt=Cartesian Geom=AllCheck Guess=Read', procs=1)
        #opt2: M062X with solvent
        #os.system('cp gaussian/bind3_'+n+'_opt0.chk gaussian/bind3_'+n+'_opt2.chk')
        #gaussian.job([], 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt2', 'Opt=Cartesian Geom=AllCheck Guess=Read SCRF(Solvent=n-Hexane)', procs=1)
        '''
		jlist = subprocess.Popen('jlist', shell=True, stdout=subprocess.PIPE).communicate()[0]
		if ' bind3_'+n+'_opt1 ' not in jlist and ' bind3_'+n+'_opt1.1 ' not in jlist and gaussian.parse_atoms('gaussian/bind3_'+n+'_opt1.log') is None and (not os.path.isfile('gaussian/bind3_'+n+'_opt1.1.log') or gaussian.parse_atoms('gaussian/bind3_'+n+'_opt1.1.log') is None):
			os.system('cp gaussian/bind3_'+n+'_opt1.chk gaussian/bind3_'+n+'_opt1.1.chk')
			#gaussian.job([], 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt1.1', 'Opt=Restart', procs=1)
			#gaussian.job([], 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt1.1', 'Opt=Cartesian Geom=AllCheck Guess=Read', procs=1)
			print 'bind3_'+n+'_opt1.1'
		if ' bind3_'+n+'_opt2 ' not in jlist and ' bind3_'+n+'_opt2.1 ' not in jlist and gaussian.parse_atoms('gaussian/bind3_'+n+'_opt2.log') is None and (not os.path.isfile('gaussian/bind3_'+n+'_opt2.1.log') or gaussian.parse_atoms('gaussian/bind3_'+n+'_opt2.1.log') is None):
			os.system('cp gaussian/bind3_'+n+'_opt2.chk gaussian/bind3_'+n+'_opt2.1.chk')
			#gaussian.job([], 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt2.1', 'Opt=Restart SCRF(Solvent=n-Hexane)', procs=1)
			#gaussian.job([], 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt2.1', 'Opt=Cartesian Geom=AllCheck Guess=Read SCRF(Solvent=n-Hexane)', procs=1)
			print 'bind3_'+n+'_opt2.1'
		continue
		'''

        #Find BSSE without solvent (on opt1)
        #os.system('cp gaussian/'+n+'_0.chk gaussian/bind3_'+n+'_opt1a.chk')
        #os.system('cp gaussian/'+n+'_0.chk gaussian/bind3_'+n+'_opt1b.chk')
        #os.system('cp gaussian/bind3_'+n+'_opt1.chk gaussian/bind3_'+n+'_opt1a_Bq.chk')
        #os.system('cp gaussian/bind3_'+n+'_opt1.chk gaussian/bind3_'+n+'_opt1b_Bq.chk')
        #os.system('cp gaussian/bind3_'+n+'_opt1.1.chk gaussian/bind3_'+n+'_opt1a_Bq.chk')
        #os.system('cp gaussian/bind3_'+n+'_opt1.1.chk gaussian/bind3_'+n+'_opt1b_Bq.chk')
        try:
            atoms = gaussian.parse_atoms('gaussian/bind3_' + n + '_opt1.1.log',
                                         check_convergence=False)[1]
        except:
            atoms = gaussian.parse_atoms('gaussian/bind3_' + n + '_opt1.log',
                                         check_convergence=False)[1]
        #gaussian.job(atoms[ : len(atoms)/2 ], 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt1a', 'Guess=Read', procs=1)
        #gaussian.job(atoms[ len(atoms)/2 : ], 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt1b', 'Guess=Read', procs=1)
        atoms_a = copy.deepcopy(atoms)
        for a in atoms_a[:len(atoms) / 2]:
            a.element = a.element + '-Bq'
        #gaussian.job(atoms_a, 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt1a_Bq', 'Guess=Read', procs=1)
        for a in atoms[len(atoms) / 2:]:
            a.element = a.element + '-Bq'
        #gaussian.job(atoms, 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt1b_Bq', 'Guess=Read', procs=1)

        #Find BSSE with solvent (on opt2)
        #os.system('cp gaussian/'+n+'_1.chk gaussian/bind3_'+n+'_opt2a.chk')
        #os.system('cp gaussian/'+n+'_1.chk gaussian/bind3_'+n+'_opt2b.chk')
        #os.system('cp gaussian/bind3_'+n+'_opt2.chk gaussian/bind3_'+n+'_opt2a_Bq.chk')
        #os.system('cp gaussian/bind3_'+n+'_opt2.chk gaussian/bind3_'+n+'_opt2b_Bq.chk')
        #os.system('cp gaussian/bind3_'+n+'_opt2.1.chk gaussian/bind3_'+n+'_opt2a_Bq.chk')
        #os.system('cp gaussian/bind3_'+n+'_opt2.1.chk gaussian/bind3_'+n+'_opt2b_Bq.chk')
        try:
            atoms = gaussian.parse_atoms('gaussian/bind3_' + n + '_opt2.1.log',
                                         check_convergence=False)[1]
        except:
            atoms = gaussian.parse_atoms('gaussian/bind3_' + n + '_opt2.log',
                                         check_convergence=False)[1]
        #gaussian.job(atoms[ : len(atoms)/2 ], 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt2a', 'Guess=Read SCRF(Solvent=n-Hexane)', procs=1)
        #gaussian.job(atoms[ len(atoms)/2 : ], 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt2b', 'Guess=Read SCRF(Solvent=n-Hexane)', procs=1)
        atoms_a = copy.deepcopy(atoms)
        for a in atoms_a[:len(atoms) / 2]:
            a.element = a.element + '-Bq'
        gaussian.job(atoms_a,
                     'M062X/aug-cc-pVDZ',
                     'batch',
                     'bind3_' + n + '_opt2a_Bq',
                     'Guess=Read SCRF(Solvent=n-Hexane)',
                     procs=1)
        for a in atoms[len(atoms) / 2:]:
            a.element = a.element + '-Bq'
        #gaussian.job(atoms, 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt2b_Bq', 'Guess=Read SCRF(Solvent=n-Hexane)', procs=1)

        continue

        #atoms = atoms[ : len(atoms)/2 ]
        #atoms = atoms[ len(atoms)/2 : ]

        #for a in atoms[ len(atoms)/2 : ]:
        #	a.element = a.element + '-Bq'

        #gaussian.job(atoms, 'M062X/cc-pVDZ', 'batch', n+'_sp4', 'SP', procs=1) #sp0 is pair, sp1,sp2 are single, sp3,sp4 with ghost atoms

        os.system('cp gaussian/' + n + '_sp0.chk gaussian/' + n + '_scrf0.chk')
        gaussian.job(atoms,
                     'M062X/aug-cc-pVDZ',
                     'batch',
                     n + '_scrf0',
                     'SP SCRF(Solvent=n-Hexane) Guess=Read',
                     procs=1)  #scrf0, scrf1, scrf2
        atoms1 = copy.deepcopy(atoms)
        for a in atoms1[:len(atoms) / 2]:
            a.element = a.element + '-Bq'
        os.system('cp gaussian/' + n + '_sp0.chk gaussian/' + n + '_scrf1.chk')
        gaussian.job(atoms1,
                     'M062X/aug-cc-pVDZ',
                     'batch',
                     n + '_scrf1',
                     'SP SCRF(Solvent=n-Hexane) Guess=Read',
                     procs=1)
        atoms2 = copy.deepcopy(atoms)
        for a in atoms2[len(atoms) / 2:]:
            a.element = a.element + '-Bq'
        os.system('cp gaussian/' + n + '_sp0.chk gaussian/' + n + '_scrf2.chk')
        gaussian.job(atoms2,
                     'M062X/aug-cc-pVDZ',
                     'batch',
                     n + '_scrf2',
                     'SP SCRF(Solvent=n-Hexane) Guess=Read',
                     procs=1)

        #pair = gaussian.parse_atoms('gaussian/'+n+'_sp0.log')[0]
        #single = gaussian.parse_atoms('gaussian/'+n+'_sp1.log')[0]

        #print n, opls_binding_e, 627.5*(pair - single*2)
        '''
def dmf2():
	for step in range(9):
		gaussian.job( filetypes.parse_xyz('xyz/3_dmf_dma_pbi2_%d.xyz' % step), 'HSEH1PBE/LanL2DZ', 'batch', '3_dmf_dma_pbi2_%d' % step, 'opt')
def approach():
	for step in range(10):
		gaussian.job( [], 'HSEH1PBE/LanL2DZ', 'batch', 'pb_n2_%d' % step, 'Opt=ModRedundant Geom=(Checkpoint,NewDefinition)', extra_section='B 2 10 F', previous='pb_n_%d' % step)
		gaussian.job( [], 'HSEH1PBE/LanL2DZ', 'batch', 'pb_i2_%d' % step, 'Opt=ModRedundant Geom=(Checkpoint,NewDefinition)', extra_section='B 10 12 F', previous='pb_i_%d' % step)
		gaussian.job( [], 'HSEH1PBE/LanL2DZ', 'batch', 'pb_both2_%d' % step, 'Opt=ModRedundant Geom=(Checkpoint,NewDefinition)', extra_section='B 2 10 F\nB 10 12 F', previous='pb_both_%d' % step)
def start_stuff():
	for step in range(10):
		gaussian.job( filetypes.parse_xyz('xyz/3_1_1_dmf_dma_pbi2_%d.xyz' % step), 'HSEH1PBE/LanL2DZ', 'batch', 'n_3_1_1_dmf_dma_pbi2_%d' % step, 'Opt=ModRedundant', extra_section='B 13 29 F\nA 13 29 36 F\nA 29 13 36F')
		gaussian.job( filetypes.parse_xyz('xyz/3_1_1_dmf_dma_pbi2_%d.xyz' % step), 'HSEH1PBE/LanL2DZ', 'batch', 'i_3_1_1_dmf_dma_pbi2_%d' % step, 'Opt=ModRedundant', extra_section='B 13 36 F\nA 13 29 36 F\nA 29 13 36F')
		gaussian.job( filetypes.parse_xyz('xyz/3_1_1_dmf_dma_pbi2_%d.xyz' % step), 'HSEH1PBE/LanL2DZ', 'batch', 'both_3_1_1_dmf_dma_pbi2_%d' % step, 'Opt=ModRedundant', extra_section='B 13 36 F\nB 13 29 F\nA 13 36 29 F\nA 36 13 29F')
		gaussian.job( filetypes.parse_xyz('xyz/3_2_1_dmf_dma_pbi2_%d.xyz' % step), 'HSEH1PBE/LanL2DZ', 'batch', 'n_3_2_1_dmf_dma_pbi2_%d' % step, 'Opt=ModRedundant', extra_section='B 13 29 F\nA 13 29 36 F\nA 29 13 36F')
		gaussian.job( filetypes.parse_xyz('xyz/3_2_1_dmf_dma_pbi2_%d.xyz' % step), 'HSEH1PBE/LanL2DZ', 'batch', 'i_3_2_1_dmf_dma_pbi2_%d' % step, 'Opt=ModRedundant', extra_section='B 13 36 F\nA 13 29 36 F\nA 29 13 36F')
		gaussian.job( filetypes.parse_xyz('xyz/3_2_1_dmf_dma_pbi2_%d.xyz' % step), 'HSEH1PBE/LanL2DZ', 'batch', 'both_3_2_1_dmf_dma_pbi2_%d' % step, 'Opt=ModRedundant', extra_section='B 13 36 F\nB 13 29 F\nA 13 36 29 F\nA 36 13 29F')
		gaussian.job( filetypes.parse_xyz('xyz/3_3_1_dmf_dma_pbi2_%d.xyz' % step), 'HSEH1PBE/LanL2DZ', 'batch', 'n_3_3_1_dmf_dma_pbi2_%d' % step, 'Opt=ModRedundant', extra_section='B 13 29 F\nA 13 29 36 F\nA 29 13 36F')
		gaussian.job( filetypes.parse_xyz('xyz/3_3_1_dmf_dma_pbi2_%d.xyz' % step), 'HSEH1PBE/LanL2DZ', 'batch', 'i_3_3_1_dmf_dma_pbi2_%d' % step, 'Opt=ModRedundant', extra_section='B 13 36 F\nA 13 29 36 F\nA 29 13 36F')
		gaussian.job( filetypes.parse_xyz('xyz/3_3_1_dmf_dma_pbi2_%d.xyz' % step), 'HSEH1PBE/LanL2DZ', 'batch', 'both_3_3_1_dmf_dma_pbi2_%d' % step, 'Opt=ModRedundant', extra_section='B 13 36 F\nB 13 29 F\nA 13 36 29 F\nA 36 13 29F')
		gaussian.job( filetypes.parse_xyz('xyz/3_1_2_dmf_dma_pbi2_%d.xyz' % step), 'HSEH1PBE/LanL2DZ', 'batch', 'n_3_1_2_dmf_dma_pbi2_%d' % step, 'Opt=ModRedundant', extra_section='B 13 29 F\nA 13 29 36 F\nA 29 13 36F')
		gaussian.job( filetypes.parse_xyz('xyz/3_1_2_dmf_dma_pbi2_%d.xyz' % step), 'HSEH1PBE/LanL2DZ', 'batch', 'i_3_1_2_dmf_dma_pbi2_%d' % step, 'Opt=ModRedundant', extra_section='B 13 36 F\nA 13 29 36 F\nA 29 13 36F')
		gaussian.job( filetypes.parse_xyz('xyz/3_1_2_dmf_dma_pbi2_%d.xyz' % step), 'HSEH1PBE/LanL2DZ', 'batch', 'both_3_1_2_dmf_dma_pbi2_%d' % step, 'Opt=ModRedundant', extra_section='B 13 36 F\nB 13 29 F\nA 13 36 29 F\nA 36 13 29F')
		gaussian.job( filetypes.parse_xyz('xyz/3_2_2_dmf_dma_pbi2_%d.xyz' % step), 'HSEH1PBE/LanL2DZ', 'batch', 'n_3_2_2_dmf_dma_pbi2_%d' % step, 'Opt=ModRedundant', extra_section='B 13 29 F\nA 13 29 36 F\nA 29 13 36F')
		gaussian.job( filetypes.parse_xyz('xyz/3_2_2_dmf_dma_pbi2_%d.xyz' % step), 'HSEH1PBE/LanL2DZ', 'batch', 'i_3_2_2_dmf_dma_pbi2_%d' % step, 'Opt=ModRedundant', extra_section='B 13 36 F\nA 13 29 36 F\nA 29 13 36F')
		gaussian.job( filetypes.parse_xyz('xyz/3_2_2_dmf_dma_pbi2_%d.xyz' % step), 'HSEH1PBE/LanL2DZ', 'batch', 'both_3_2_2_dmf_dma_pbi2_%d' % step, 'Opt=ModRedundant', extra_section='B 13 36 F\nB 13 29 F\nA 13 36 29 F\nA 36 13 29F')
		gaussian.job( filetypes.parse_xyz('xyz/3_3_2_dmf_dma_pbi2_%d.xyz' % step), 'HSEH1PBE/LanL2DZ', 'batch', 'n_3_3_2_dmf_dma_pbi2_%d' % step, 'Opt=ModRedundant', extra_section='B 13 29 F\nA 13 29 36 F\nA 29 13 36F')
		gaussian.job( filetypes.parse_xyz('xyz/3_3_2_dmf_dma_pbi2_%d.xyz' % step), 'HSEH1PBE/LanL2DZ', 'batch', 'i_3_3_2_dmf_dma_pbi2_%d' % step, 'Opt=ModRedundant', extra_section='B 13 36 F\nA 13 29 36 F\nA 29 13 36F')
		gaussian.job( filetypes.parse_xyz('xyz/3_3_2_dmf_dma_pbi2_%d.xyz' % step), 'HSEH1PBE/LanL2DZ', 'batch', 'both_3_3_2_dmf_dma_pbi2_%d' % step, 'Opt=ModRedundant', extra_section='B 13 36 F\nB 13 29 F\nA 13 36 29 F\nA 36 13 29F')
Exemple #22
0
def binding():
	#for n in ['propanenitrile', 'butanenitrile', 'pentanenitrile', 'hexanenitrile', 'aminopropane2', 'aminobutane2', 'aminopentane2', 'aminohexane2', 'hexane2', 'methane', 'hcn2', 'cyanoacetylene2', 'acrylonitrile2', 'cyanoallene2', 'acetonitrile2', 'hc5n2']:
	for n in ['aminobutane2']:
		
		contents = open('lammps/bind3_'+n+'.log').read()
		
		opls_binding_e = float(re.search('\n1\s+(\S+)\s+Loop time of', contents).group(1))
		
		atoms = filetypes.parse_xyz('bind3_'+n+'.xyz')
		
		#opt0: use B97D
		#gaussian.job(atoms, 'B97D/TZVP/Fit', 'batch', 'bind3_'+n+'_opt0', 'Opt=Cartesian', procs=1)
		
		#opt1: use M062X
		#os.system('cp gaussian/bind3_'+n+'_opt0.chk gaussian/bind3_'+n+'_opt1.chk')
		#gaussian.job([], 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt1', 'Opt=Cartesian Geom=AllCheck Guess=Read', procs=1)
		#opt2: M062X with solvent
		#os.system('cp gaussian/bind3_'+n+'_opt0.chk gaussian/bind3_'+n+'_opt2.chk')
		#gaussian.job([], 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt2', 'Opt=Cartesian Geom=AllCheck Guess=Read SCRF(Solvent=n-Hexane)', procs=1)
		
		'''
		jlist = subprocess.Popen('jlist', shell=True, stdout=subprocess.PIPE).communicate()[0]
		if ' bind3_'+n+'_opt1 ' not in jlist and ' bind3_'+n+'_opt1.1 ' not in jlist and gaussian.parse_atoms('gaussian/bind3_'+n+'_opt1.log') is None and (not os.path.isfile('gaussian/bind3_'+n+'_opt1.1.log') or gaussian.parse_atoms('gaussian/bind3_'+n+'_opt1.1.log') is None):
			os.system('cp gaussian/bind3_'+n+'_opt1.chk gaussian/bind3_'+n+'_opt1.1.chk')
			#gaussian.job([], 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt1.1', 'Opt=Restart', procs=1)
			#gaussian.job([], 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt1.1', 'Opt=Cartesian Geom=AllCheck Guess=Read', procs=1)
			print 'bind3_'+n+'_opt1.1'
		if ' bind3_'+n+'_opt2 ' not in jlist and ' bind3_'+n+'_opt2.1 ' not in jlist and gaussian.parse_atoms('gaussian/bind3_'+n+'_opt2.log') is None and (not os.path.isfile('gaussian/bind3_'+n+'_opt2.1.log') or gaussian.parse_atoms('gaussian/bind3_'+n+'_opt2.1.log') is None):
			os.system('cp gaussian/bind3_'+n+'_opt2.chk gaussian/bind3_'+n+'_opt2.1.chk')
			#gaussian.job([], 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt2.1', 'Opt=Restart SCRF(Solvent=n-Hexane)', procs=1)
			#gaussian.job([], 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt2.1', 'Opt=Cartesian Geom=AllCheck Guess=Read SCRF(Solvent=n-Hexane)', procs=1)
			print 'bind3_'+n+'_opt2.1'
		continue
		'''
		
		#Find BSSE without solvent (on opt1)
		#os.system('cp gaussian/'+n+'_0.chk gaussian/bind3_'+n+'_opt1a.chk')
		#os.system('cp gaussian/'+n+'_0.chk gaussian/bind3_'+n+'_opt1b.chk')
		#os.system('cp gaussian/bind3_'+n+'_opt1.chk gaussian/bind3_'+n+'_opt1a_Bq.chk')
		#os.system('cp gaussian/bind3_'+n+'_opt1.chk gaussian/bind3_'+n+'_opt1b_Bq.chk')
		#os.system('cp gaussian/bind3_'+n+'_opt1.1.chk gaussian/bind3_'+n+'_opt1a_Bq.chk')
		#os.system('cp gaussian/bind3_'+n+'_opt1.1.chk gaussian/bind3_'+n+'_opt1b_Bq.chk')
		try:
			atoms = gaussian.parse_atoms('gaussian/bind3_'+n+'_opt1.1.log', check_convergence=False)[1]
		except:
			atoms = gaussian.parse_atoms('gaussian/bind3_'+n+'_opt1.log', check_convergence=False)[1]
		#gaussian.job(atoms[ : len(atoms)/2 ], 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt1a', 'Guess=Read', procs=1)
		#gaussian.job(atoms[ len(atoms)/2 : ], 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt1b', 'Guess=Read', procs=1)
		atoms_a = copy.deepcopy(atoms)
		for a in atoms_a[ : len(atoms)/2 ]:
			a.element = a.element + '-Bq'
		#gaussian.job(atoms_a, 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt1a_Bq', 'Guess=Read', procs=1)
		for a in atoms[ len(atoms)/2 : ]:
			a.element = a.element + '-Bq'
		#gaussian.job(atoms, 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt1b_Bq', 'Guess=Read', procs=1)
		
		
		#Find BSSE with solvent (on opt2)
		#os.system('cp gaussian/'+n+'_1.chk gaussian/bind3_'+n+'_opt2a.chk')
		#os.system('cp gaussian/'+n+'_1.chk gaussian/bind3_'+n+'_opt2b.chk')
		#os.system('cp gaussian/bind3_'+n+'_opt2.chk gaussian/bind3_'+n+'_opt2a_Bq.chk')
		#os.system('cp gaussian/bind3_'+n+'_opt2.chk gaussian/bind3_'+n+'_opt2b_Bq.chk')
		#os.system('cp gaussian/bind3_'+n+'_opt2.1.chk gaussian/bind3_'+n+'_opt2a_Bq.chk')
		#os.system('cp gaussian/bind3_'+n+'_opt2.1.chk gaussian/bind3_'+n+'_opt2b_Bq.chk')
		try:
			atoms = gaussian.parse_atoms('gaussian/bind3_'+n+'_opt2.1.log', check_convergence=False)[1]
		except:
			atoms = gaussian.parse_atoms('gaussian/bind3_'+n+'_opt2.log', check_convergence=False)[1]
		#gaussian.job(atoms[ : len(atoms)/2 ], 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt2a', 'Guess=Read SCRF(Solvent=n-Hexane)', procs=1)
		#gaussian.job(atoms[ len(atoms)/2 : ], 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt2b', 'Guess=Read SCRF(Solvent=n-Hexane)', procs=1)
		atoms_a = copy.deepcopy(atoms)
		for a in atoms_a[ : len(atoms)/2 ]:
			a.element = a.element + '-Bq'
		gaussian.job(atoms_a, 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt2a_Bq', 'Guess=Read SCRF(Solvent=n-Hexane)', procs=1)
		for a in atoms[ len(atoms)/2 : ]:
			a.element = a.element + '-Bq'
		#gaussian.job(atoms, 'M062X/aug-cc-pVDZ', 'batch', 'bind3_'+n+'_opt2b_Bq', 'Guess=Read SCRF(Solvent=n-Hexane)', procs=1)
		
		continue
		
		#atoms = atoms[ : len(atoms)/2 ]
		#atoms = atoms[ len(atoms)/2 : ]
		
		#for a in atoms[ len(atoms)/2 : ]:
		#	a.element = a.element + '-Bq'
		
		#gaussian.job(atoms, 'M062X/cc-pVDZ', 'batch', n+'_sp4', 'SP', procs=1) #sp0 is pair, sp1,sp2 are single, sp3,sp4 with ghost atoms
		
		os.system('cp gaussian/'+n+'_sp0.chk gaussian/'+n+'_scrf0.chk')
		gaussian.job(atoms, 'M062X/aug-cc-pVDZ', 'batch', n+'_scrf0', 'SP SCRF(Solvent=n-Hexane) Guess=Read', procs=1) #scrf0, scrf1, scrf2
		atoms1 = copy.deepcopy(atoms)
		for a in atoms1[ : len(atoms)/2 ]:
			a.element = a.element + '-Bq'
		os.system('cp gaussian/'+n+'_sp0.chk gaussian/'+n+'_scrf1.chk')
		gaussian.job(atoms1, 'M062X/aug-cc-pVDZ', 'batch', n+'_scrf1', 'SP SCRF(Solvent=n-Hexane) Guess=Read', procs=1)
		atoms2 = copy.deepcopy(atoms)
		for a in atoms2[ len(atoms)/2 : ]:
			a.element = a.element + '-Bq'
		os.system('cp gaussian/'+n+'_sp0.chk gaussian/'+n+'_scrf2.chk')
		gaussian.job(atoms2, 'M062X/aug-cc-pVDZ', 'batch', n+'_scrf2', 'SP SCRF(Solvent=n-Hexane) Guess=Read', procs=1)
		
		#pair = gaussian.parse_atoms('gaussian/'+n+'_sp0.log')[0]
		#single = gaussian.parse_atoms('gaussian/'+n+'_sp1.log')[0]
		
		#print n, opls_binding_e, 627.5*(pair - single*2)
		
		'''