Example #1
0
    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
Example #2
0
    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