def jobCdft(self): self.rem.add('CDFT', 'True') self.rem.add('SCF_PRINT', 'True') self.cdft_arr = qc._unsupported_array("cdft") self.cdft_arr.add_line("1") self.cdft_arr.add_line("1 1 2 s") self.job_arr_list.append(self.cdft_arr) atoms = copy.copy(self.out.list_of_atoms) first_two = [atoms[0][0], atoms[1][0]] last_two = [atoms[-2][0], atoms[-1][0]] if first_two != ['O', 'O'] and last_two == ['O', 'O']: atoms.insert(0, atoms.pop()) atoms.insert(0, atoms.pop()) xyz = qc.cartesian(atom_list=atoms) self.mol = qc.mol_array(xyz) self.mol.charge(self.charge) self.mol.multiplicity(self.mult)
myrem.exchange('hf') myrem.basis('sto-3g') myrem.scf_algorithm('rca_diis') #myrem.max_rca_cycles('10') #myrem.thresh_rca_switch('7') myrem.scf_guess('sad') myrem.scf_convergence('9') myrem.thresh('14') myrem.incfock('0') myrem.incdft('0') #myrem.max_scf_cycles('500') #myrem.symmetry('false') #myrem.sym_ignore('true') myrem.mem_total('16000') myrem.mem_static('4000') # Add rem_array myfile = qc.inputfile() myfile.add(myrem) # Add geometry array mygeo = qc.mol_array(aa.aimd.geometries[0]) myfile.add(mygeo) # Finally, create each inputfile and write it to disk for i, k in enumerate(aa.aimd.geometries): mygeo = qc.mol_array(k) myfile.add(mygeo) filename = str(i) + ".inp" myfile.write(filename)
def __init__(self, infile,charge=0,mult=1,jobtype='opt',basis='6-31+g*',method='tpssh', \ geom_read=False, nametrunc=True, bond_cons = None, infodump=False): self.jobdict = {'sp':self.jobSp, 'opt':self.jobOpt, 'fq':self.jobFreq, 'sopt':self.jobSopt, \ 'cube':self.jobCube, 'constr':self.jobConstrainedOpt, 'fixbonds':self.jobFixedBondOpt, \ 'cdft':self.jobCdft, \ } # self.bond_cons = [[2,5,con_N_x],[3,4,con_N_x],[2,3,con_N_y],[4,5,con_N_y]] self.bond_cons = bond_cons self.info_dump = infodump # self.free_atom = ['Fe','O'] self.free_atom = ['O'] self.job_arr_list = [] self.charge = charge self.mult = mult self.jobtype = jobtype self.pcm_arr = None self.sol_arr = None self.plot_arr = None #if nametrunc == True: self.name = (infile.split('.')[0]).split('_')[0] #else: self.name = infile.split('.')[0] splinfile = infile.split('/') if len(splinfile) == 1: self.path = '' else: self.path = '/'.join(splinfile[:-1]) + '/' if nametrunc == True: self.name = (splinfile[-1].split('.')[0]).split('_')[0] else: self.name = (splinfile[-1].split('.'))[0] print(splinfile) print(splinfile[-1]) print(self.name) print(self.charge) print(self.mult) self.out = qc.read(infile) self.rem = qc.rem_array() self.rem.basis(basis) self.rem.method(method) self.rem.thresh("14") self.rem.add('mem_total', '4096') self.rem.add('mem_static', '256') self.rem.add('max_scf_cycles', '500') # self.rem.add('scf_convergence','7') # self.rem.add('scf_algorithm','diis_gdm') ##For these metal-centered systems self.rem.add('unrestricted', 'true') # if self.mult == '1': ## I didn't find that this worked at all for any of the metal-macrocycle systems # self.rem.add("scf_guess_mix", "1") # self.rem.add("scf_guess", "gwh") if geom_read: self.mol = qc.mol_array() self.mol.geometry("read") self.rem.add('scf_guess', 'read') else: if infile.split('.')[-1] == 'out': # self.mol=qc.mol_array(self.out.opt.geometries[-1]) self.mol = qc.mol_array(self.out.general.final_geometry) # self.mol = qc.mol_array(self.out.general.initial_geometry) else: xyz = qc.cartesian(atom_list=self.out.list_of_atoms) self.mol = qc.mol_array(xyz) self.mol.charge(charge) self.mol.multiplicity(mult)
import pyQChem as qc #generate rem array, cartesian object, mol array, and job via standard procedure (see input demos) rem = qc.rem_array() rem.basis("sto-3g") rem.jobtype("opt") xyz = qc.cartesian() xyz.add_atom() xyz.add_atom("H", "0", "0", ".74") molec = qc.mol_array(xyz) job = qc.inputfile() job.add(rem) job.add(molec) #run job with name "h2" making h2.in h2.sh, and h2.out job.run(name="h2") #read in output out = qc.read("h2.out") out.opt.info() #let's approximate how much this has changed #grab first geometry start = out.opt.geometries[0] #grab last geometry end = out.opt.geometries[-1] #Print statistics for geometric distortions print "\n\nApproximate change between starting and ending geometries by two metrics:\n"
import pyQChem as qc import os #make a generic rem array rem = qc.rem_array() rem.basis("sto-3g") rem.exchange("hf") #make a list of jobs job_list = [] #for all xyzs in a database, create and append the job to the list for i in os.popen("ls ../../databases/a24/*.xyz").read().splitlines(): #make the jobs job = qc.inputfile() #give job a name job.runinfo.name = i.split('/')[-1].replace(".xyz", "") #read the xyz xyz = qc.read(i) #append the molecule and rem array job.add(qc.mol_array(xyz)) job.add(rem) job_list.append(job) # run all jobs in list using 12 workers qc.queue(job_list, num_workers=12)
import pyQChem as qc import os #make a generic rem array rem=qc.rem_array() rem.basis("sto-3g") rem.exchange("hf") #make a list of jobs job_list=[] #for all xyzs in a database, create and append the job to the list for i in os.popen("ls ../../databases/a24/*.xyz").read().splitlines(): #make the jobs job=qc.inputfile() #give job a name job.runinfo.name=i.split('/')[-1].replace(".xyz","") #read the xyz xyz=qc.read(i) #append the molecule and rem array job.add(qc.mol_array(xyz)) job.add(rem) job_list.append(job) # run all jobs in list using 12 workers qc.queue(job_list,num_workers=12)
rem1.scf_convergence("10") from copy import deepcopy rem2=deepcopy(rem1) rem2.scf_guess("fragmo") #make a rem_frgm array rem_frgm=pq.rem_frgm_array() rem_frgm.thresh("7") rem_frgm.scf_convergence("3") #make objects for holding the molecular geometries xyz=pq.read("4water.xyz") frag=pq.fragment(atom_list=xyz.list_of_atoms) #make molecule array from cartesian object mol1=pq.mol_array(xyz) mol2=pq.mol_array(frag) #make input object and write to disk job1=pq.inputfile() job1.add(rem1) job1.add(mol1) job2=pq.inputfile() job2.add(rem2) job2.rem.scf_guess("fragmo") job2.add(rem_frgm) job2.add(mol2) job=pq.multifile() job.add(job1)
import pyQChem as qc #generate rem array, cartesian object, mol array, and job via standard procedure (see input demos) rem=qc.rem_array() rem.basis("6-31g") rem.jobtype("sp") rem.method("adc(2)") rem.ee_singlets("[2,0,0,0,0,2,0,0]") xyz=qc.cartesian() xyz.add_atom() xyz.add_atom("H","0","0",".74") molec=qc.mol_array(xyz) job=qc.inputfile() job.add(rem) job.add(molec) #run job with name "h2" making h2.in h2.sh, and h2.out job.run(name="h2") #read in output out=qc.read("h2.out") out.adc.info() #let's compute the excitation energies between the excited states print "\nExcitation energies between excited states:" for i in range(0,len(out.adc.list_of_excited_states)-1): es1 = out.adc.list_of_excited_states[i] for j in range(i + 1,len(out.adc.list_of_excited_states)): es2 = out.adc.list_of_excited_states[j] print("{0:10s} -> {1:10s}: {2:12.6f}".format(es1.term_symbol, es2.term_symbol,es2.energy - es1.energy))
# import pyQChem as qc #make the rem array and fill it rem=qc.rem_array() rem.basis("sto-3g") rem.jobtype("opt") #make the cartesian object and fill it xyz=qc.cartesian() xyz.add_atom() #defaults to H at origin xyz.add_atom("H","0","0",".74") #make molecule array from cartesian object molec=qc.mol_array(xyz) #assemble the job from the arrays job1=qc.inputfile() job1.add(rem) job1.add(molec) #write it to file job1.write("h2.in") #make another rem to do the second job rem2=qc.deepcopy(rem) rem2.jobtype("freq") #define the molecule array as "READ" so we grab the right geometry molec2=qc.mol_array()