def generate_freq_input(qoutfile, qinfile, basis_set="6-311++G*", pcm_dielectric=None, overwrite_inputs=None): """ Parses a QChem output file for ideal structure and then returns a QChem input file for frequency calculations (to determine enthalpy and entropy). :param qoutfile: Absolute path to the QChem output file (.out) :param qinfile: Absolute path to the QChem input file (.in) :return: """ output = QCOutput(qoutfile) if len(output.data.get("molecule_from_optimized_geometry", [])) > 0: mol = output.data["molecule_from_optimized_geometry"] else: try: mol = output.data["molecule_from_last_geometry"] except KeyError: raise RuntimeError("No molecule to use as input") qcinput = FreqSet(mol, basis_set=basis_set, pcm_dielectric=pcm_dielectric, overwrite_inputs=overwrite_inputs) qcinput.write_file(qinfile)
def test_pcm_init(self): test_molecule = QCInput.from_file(os.path.join(test_dir, "new_qchem_files/pcm.qin")).molecule test_FreqSet = FreqSet(molecule=test_molecule, pcm_dielectric=10.0) self.assertEqual( test_FreqSet.rem, { "job_type": "freq", "gen_scfman": "true", "basis": "def2-tzvppd", "max_scf_cycles": "200", "method": "wb97xd", "scf_algorithm": "diis", "xc_grid": "3", "solvent_method": "pcm", "symmetry": "false", "sym_ignore": "true", "resp_charges": "true", }, ) self.assertEqual( test_FreqSet.pcm, { "heavypoints": "194", "hpoints": "194", "radii": "uff", "theory": "cpcm", "vdwscale": "1.1", }, ) self.assertEqual(test_FreqSet.solvent, {"dielectric": 10.0}) self.assertEqual(test_FreqSet.molecule, test_molecule)
def test_smd_init(self): test_molecule = QCInput.from_file( os.path.join(test_dir, "new_qchem_files/pcm.qin")).molecule test_FreqSet = FreqSet(molecule=test_molecule, smd_solvent="water") self.assertEqual( test_FreqSet.rem, { "job_type": "freq", "gen_scfman": "true", "basis": "def2-tzvppd", "max_scf_cycles": "100", "method": "wb97xd", "scf_algorithm": "diis", "xc_grid": "3", "thresh": "14", "s2thresh": "16", "solvent_method": "smd", "ideriv": "1", "symmetry": "false", "sym_ignore": "true", "resp_charges": "true", }, ) self.assertEqual(test_FreqSet.smx, {"solvent": "water"}) self.assertEqual(test_FreqSet.molecule, test_molecule)
def test_init(self): test_molecule = QCInput.from_file(os.path.join(test_dir, "new_qchem_files/pcm.qin")).molecule test_FreqSet = FreqSet(molecule=test_molecule) self.assertEqual( test_FreqSet.rem, { "job_type": "freq", "gen_scfman": "true", "basis": "def2-tzvppd", "max_scf_cycles": "200", "method": "wb97xd", "scf_algorithm": "diis", "xc_grid": "3", "symmetry": "false", "sym_ignore": "true", "resp_charges": "true", }, ) self.assertEqual(test_FreqSet.pcm, {}) self.assertEqual(test_FreqSet.solvent, {}) self.assertEqual(test_FreqSet.molecule, test_molecule)