def freq_fw(self, charge, spin_multiplicity, fw_id_cal, fw_id_db, priority=None, method=None): if not method: if self.large: method = "PBE-D3/6-31+G*" else: method = "B3lYP/6-31+G*" task_type = "vibrational frequency" state_name = self.get_state_name(charge, spin_multiplicity) title = self.molname + " " + state_name + " " + method + " " + task_type exchange, correlation, basis_set, aux_basis, rem_params, method_token, ecp = self. \ get_exchange_correlation_basis_auxbasis_remparams(method, self.mol) if exchange.lower() in ["xygjos"]: rem_params["IDERIV"] = 1 qctask = QcTask(self.mol, charge=charge, spin_multiplicity=spin_multiplicity, jobtype="freq", title=title, exchange=exchange, correlation=correlation, basis_set=basis_set, aux_basis_set=aux_basis, ecp=ecp, rem_params=rem_params) if self.large: qctask.set_scf_algorithm_and_iterations(iterations=100) qcinp = QcInput([qctask]) spec = self.base_spec() spec["qcinp"] = qcinp.as_dict() spec['task_type'] = task_type spec['charge'] = charge spec['spin_multiplicity'] = spin_multiplicity spec['run_tags']['methods'] = method_token spec["qm_method"] = method if priority: spec['_priority'] = priority task_name = self.molname + ' ' + state_name + ' ' + task_type from rubicon.firetasks.qchem.multistep_qchem_task \ import QChemFrequencyDBInsertionTask fw_freq_cal = Firework([QChemTask()], spec=spec, name=task_name, fw_id=fw_id_cal) spec_db = copy.deepcopy(spec) del spec_db['_dupefinder'] spec_db['_allow_fizzled_parents'] = True spec_db['task_type'] = task_type + ' DB Insertion' del spec_db["_trackers"][:2] task_name_db = task_name + " DB Insertion" fw_freq_db = Firework([QChemFrequencyDBInsertionTask()], spec=spec_db, name=task_name_db, fw_id=fw_id_db) return fw_freq_cal, fw_freq_db
def aimd_fw(self, charge, spin_multiplicity, fw_id_cal, fw_id_db, num_steps, time_step, temperature, priority=None, qm_method=None): if not qm_method: qm_method = "B3LYP/6-31+G*" spec = self.base_spec() if priority: spec['_priority'] = priority task_type = "ab initio molecule dynamics" state_name = self.get_state_name(charge, spin_multiplicity) title = self.molname + " " + state_name + " " + qm_method + " " + task_type exchange, correlation, basis_set, aux_basis, rem_params, method_token, ecp = self. \ get_exchange_correlation_basis_auxbasis_remparams(qm_method, self.mol) if rem_params is None: rem_params = dict() rem_params["aimd_method"] = "bomd" rem_params["time_step"] = time_step rem_params["aimd_steps"] = num_steps rem_params["aimd_init_veloc"] = "thermal" rem_params["aimd_temp"] = temperature rem_params["fock_extrap_order"] = 6 rem_params["fock_extrap_points"] = 12 qctask_vac = QcTask(self.mol, charge=charge, spin_multiplicity=spin_multiplicity, jobtype="aimd", title=title, exchange=exchange, correlation=correlation, basis_set=basis_set, aux_basis_set=aux_basis, ecp=ecp, rem_params=rem_params) qctask_vac.set_scf_algorithm_and_iterations(iterations=100) qcinp = QcInput([qctask_vac]) spec["qcinp"] = qcinp.as_dict() spec['task_type'] = task_type spec['charge'] = charge spec['spin_multiplicity'] = spin_multiplicity spec['run_tags']['methods'] = method_token spec['run_tags']['rem_params'] = rem_params spec["qm_method"] = qm_method task_name = self.molname + ' ' + state_name + ' ' + task_type from rubicon.firetasks.qchem.multistep_qchem_task \ import QChemAIMDDBInsertionTask fw_sp_cal = Firework([QChemTask()], spec=spec, name=task_name, fw_id=fw_id_cal) spec_db = copy.deepcopy(spec) del spec_db['_dupefinder'] spec_db['_allow_fizzled_parents'] = True spec_db['task_type'] = task_type + ' DB Insertion' del spec_db["_trackers"][:2] task_name_db = task_name + " DB Insertion" fw_sp_db = Firework([QChemAIMDDBInsertionTask()], spec=spec_db, name=task_name_db, fw_id=fw_id_db) return fw_sp_cal, fw_sp_db
def vacuum_only_sp_fw(self, charge, spin_multiplicity, fw_id_cal, fw_id_db, priority=None, qm_method=None, population_method=None, mixed_basis_generator=None, mixed_aux_basis_generator=None, super_mol_snlgroup_id=None, super_mol_egsnl=None, super_mol_inchi_root=None, ghost_atoms=None, bs_overlap=False): if not qm_method: qm_method = "B3LYP/6-31+G*" spec = self.base_spec() if priority: spec['_priority'] = priority if super_mol_snlgroup_id: from rubicon.workflows.qchem.bsse_wf import BSSEFragment task_type = "bsse {} fragment".format( BSSEFragment.OVERLAPPED if bs_overlap else BSSEFragment. ISOLATED) else: task_type = "vacuum only single point energy" if mixed_basis_generator or mixed_aux_basis_generator: population_method = population_method if population_method else "nbo" task_type = "atomic charge" state_name = self.get_state_name(charge, spin_multiplicity) title = self.molname + " " + state_name + " " + qm_method + " " + task_type title += "\n Gas Phase" exchange, correlation, basis_set, aux_basis, rem_params, method_token, ecp = self. \ get_exchange_correlation_basis_auxbasis_remparams(qm_method, self.mol) if population_method: if not rem_params: rem_params = dict() if population_method.lower() == "nbo": rem_params["nbo"] = 1 elif population_method.lower() == "chelpg": rem_params["chelpg"] = True elif population_method.lower() == "hirshfeld": rem_params["hirshfeld"] = True ga = ghost_atoms if bs_overlap else None qctask_vac = QcTask(self.mol, charge=charge, spin_multiplicity=spin_multiplicity, jobtype="sp", title=title, exchange=exchange, correlation=correlation, basis_set=basis_set, aux_basis_set=aux_basis, ecp=ecp, rem_params=rem_params, ghost_atoms=ga) if (not self.large) and (mixed_basis_generator is None and mixed_aux_basis_generator is None): qctask_vac.set_dft_grid(128, 302) qctask_vac.set_integral_threshold(12) qctask_vac.set_scf_convergence_threshold(8) else: qctask_vac.set_scf_algorithm_and_iterations(iterations=100) qcinp = QcInput([qctask_vac]) spec["qcinp"] = qcinp.as_dict() spec['task_type'] = task_type spec['charge'] = charge spec['spin_multiplicity'] = spin_multiplicity spec['run_tags']['methods'] = method_token spec["qm_method"] = qm_method if super_mol_snlgroup_id: spec["run_tags"]["super_mol_snlgroup_id"] = super_mol_snlgroup_id spec["snlgroup_id"] = super_mol_snlgroup_id spec["egsnl"] = super_mol_egsnl spec["inchi_root"] = super_mol_inchi_root if ghost_atoms: spec["run_tags"]["ghost_atoms"] = sorted(set(ghost_atoms)) from rubicon.workflows.qchem.bsse_wf import BSSEFragment spec["run_tags"][ "bsse_fragment_type"] = BSSEFragment.OVERLAPPED if bs_overlap else BSSEFragment.ISOLATED if mixed_basis_generator: spec["_mixed_basis_set_generator"] = mixed_basis_generator if mixed_aux_basis_generator: spec["_mixed_aux_basis_set_generator"] = mixed_aux_basis_generator task_name = self.molname + ' ' + state_name + ' ' + task_type from rubicon.firetasks.qchem.multistep_qchem_task \ import QChemSinglePointEnergyDBInsertionTask fw_sp_cal = Firework([QChemTask()], spec=spec, name=task_name, fw_id=fw_id_cal) spec_db = copy.deepcopy(spec) del spec_db['_dupefinder'] spec_db['_allow_fizzled_parents'] = True spec_db['task_type'] = task_type + ' DB Insertion' del spec_db["_trackers"][:2] task_name_db = task_name + " DB Insertion" fw_sp_db = Firework([QChemSinglePointEnergyDBInsertionTask()], spec=spec_db, name=task_name_db, fw_id=fw_id_db) return fw_sp_cal, fw_sp_db
def sp_fw(self, charge, spin_multiplicity, fw_id_cal, fw_id_db, solvent_method="ief-pcm", use_vdw_surface=False, solvent="water", priority=None, qm_method=None, population_method=None, task_type_name=None): if not qm_method: qm_method = "B3LYP/6-31+G*" spec = self.base_spec() if priority: spec['_priority'] = priority task_type = task_type_name if task_type_name else "single point energy" state_name = self.get_state_name(charge, spin_multiplicity) title = self.molname + " " + state_name + " " + qm_method + " " + task_type title += "\n Gas Phase" exchange, correlation, basis_set, aux_basis, rem_params, method_token, ecp = self. \ get_exchange_correlation_basis_auxbasis_remparams(qm_method, self.mol) if population_method: if not rem_params: rem_params = dict() if population_method.lower() == "nbo": rem_params["nbo"] = 1 elif population_method.lower() == "chelpg": rem_params["chelpg"] = True qctask_vac = QcTask(self.mol, charge=charge, spin_multiplicity=spin_multiplicity, jobtype="sp", title=title, exchange=exchange, correlation=correlation, basis_set=basis_set, aux_basis_set=aux_basis, ecp=ecp, rem_params=rem_params) if not self.large: qctask_vac.set_dft_grid(128, 302) qctask_vac.set_integral_threshold(12) qctask_vac.set_scf_convergence_threshold(8) else: qctask_vac.set_scf_algorithm_and_iterations(iterations=100) title = " Solution Phase, {}".format(solvent) qctask_sol = QcTask(self.mol, charge=charge, spin_multiplicity=spin_multiplicity, jobtype="sp", title=title, exchange=exchange, correlation=correlation, basis_set=basis_set, aux_basis_set=aux_basis, ecp=ecp, rem_params=rem_params) qctask_sol.set_scf_initial_guess(guess="read") implicit_solvent = self.set_solvent_method(qctask_sol, solvent, solvent_method, use_vdw_surface) qcinp = QcInput([qctask_vac, qctask_sol]) spec["qcinp"] = qcinp.as_dict() spec['task_type'] = task_type spec['charge'] = charge spec['spin_multiplicity'] = spin_multiplicity spec['run_tags']['methods'] = method_token spec["qm_method"] = qm_method spec['implicit_solvent'] = implicit_solvent task_name = self.molname + ' ' + state_name + ' ' + task_type from rubicon.firetasks.qchem.multistep_qchem_task \ import QChemSinglePointEnergyDBInsertionTask fw_sp_cal = Firework([QChemTask()], spec=spec, name=task_name, fw_id=fw_id_cal) spec_db = copy.deepcopy(spec) del spec_db['_dupefinder'] spec_db['_allow_fizzled_parents'] = True spec_db['task_type'] = task_type + ' DB Insertion' del spec_db["_trackers"][:2] task_name_db = task_name + " DB Insertion" fw_sp_db = Firework([QChemSinglePointEnergyDBInsertionTask()], spec=spec_db, name=task_name_db, fw_id=fw_id_db) return fw_sp_cal, fw_sp_db
def geom_fw(self, charge, spin_multiplicity, fw_id_cal, fw_id_db, priority=None, method=None, task_type_prefix=None): task_type = "geometry optimization" if task_type_prefix: task_type = task_type_prefix + " " + task_type state_name = self.get_state_name(charge, spin_multiplicity) if not method: if self.large: method = "PBE-D3/6-31+G*" else: method = "B3lYP/6-31+G*" title = self.molname + " " + state_name + " " + method + " " + task_type exchange, correlation, basis_set, aux_basis, rem_params, method_token, ecp = self. \ get_exchange_correlation_basis_auxbasis_remparams(method, self.mol) qctask = QcTask(self.mol, charge=charge, spin_multiplicity=spin_multiplicity, jobtype="opt", title=title, exchange=exchange, correlation=correlation, basis_set=basis_set, aux_basis_set=aux_basis, ecp=ecp, rem_params=rem_params) if self.large: qctask.set_geom_max_iterations(200) qctask.set_scf_algorithm_and_iterations(iterations=100) qctask.scale_geom_opt_threshold(gradient=1.0, displacement=10.0, energy=10.0) qcinp = QcInput([qctask]) spec = self.base_spec() spec["qcinp"] = qcinp.as_dict() spec['task_type'] = task_type spec['charge'] = charge spec['spin_multiplicity'] = spin_multiplicity spec['run_tags']['methods'] = method_token spec["qm_method"] = method if priority: spec['_priority'] = priority task_name = self.molname + ' ' + state_name + ' ' + task_type from rubicon.firetasks.qchem.multistep_qchem_task \ import QChemGeomOptDBInsertionTask fw_geom_cal = Firework([QChemTask()], spec=spec, name=task_name, fw_id=fw_id_cal) spec_db = copy.deepcopy(spec) del spec_db['_dupefinder'] spec_db['_allow_fizzled_parents'] = True spec_db['task_type'] = task_type + ' DB Insertion' del spec_db["_trackers"][:2] task_name_db = task_name + " DB Insertion" fw_geom_db = Firework([QChemGeomOptDBInsertionTask()], spec=spec_db, name=task_name_db, fw_id=fw_id_db) return fw_geom_cal, fw_geom_db