def __init__(self, job_name, molecule, job_type, basis_set, method, scf_print=3, scf_final_print=3, scf_convergence=8, scf_save_matrices=1): """QChemSCFJob constructor. Args: job_name (str): name of the job molecue (Molecule object): molecule job should be done on (geometry etc.) basis_set (str): name of the basis to be used method (str): evaluation mathod (e.g. B3LYP) scf_convergence (int): convergence criterium (diff of energies must be lower 10^scf_convergence) scf_print (int): print level for every scf step scf_final_print (int): print level for final scf step """ self._job_name = job_name self._molecule = molecule self._job_type = job_type self._rem_array = qc.rem_array() self._rem_array.method(method) self._rem_array.basis(basis_set) self._rem_array.scf_convergence(str(scf_convergence)) self._rem_array.scf_print(str(scf_print)) self._rem_array.scf_final_print(str(scf_final_print)) self._rem_array.scf_save_matrices(str(scf_save_matrices))
# pyQChem script for a AIMD follow-up with reduced basis set size # # AWH/RM 2015 import pyQChem as qc # First, read all N geometries from aimd outputfile a = qc.read('aimd_small.out') aa = a.list_of_jobs[1] # Second, create the template myrem = qc.rem_array() myrem.jobtype('sp') 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()
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)
# # This makes a simple list of jobs from xyz files and runs Q-Chem on all the jobs # # MBG (2/2014) # 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)
O 2.271787 -1.668771 -2.587410 H 1.328156 -1.800266 -2.490761 H 2.384794 -1.339543 -3.467573 O -0.518887 -1.685783 -2.053795 H -0.969013 -2.442055 -1.705471 H -0.524180 -1.044938 -1.342263 """ xf=open("4water.xyz",'w') xf.write(xyz) xf.close() import pyQChem as pq #make the rem array rem1=pq.rem_array() rem1.basis("6-31++G**") rem1.exchange("hf") rem1.thresh("14") 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")