예제 #1
0
def _mod_class(class_typ, rxn_info):
    """ Create the object containing the full description of the
        reaction class, including its type, spin state, and whether
        it is a radical-radical combination.

        :param class_typ: reaction class type
        :type class_typ: str
        :param rxn_info: ???
        :tpye rxn_info: ???
    """

    # Set the spin of the reaction to high/low
    _fake_class = (class_typ, '', '', False)
    if automol.par.need_spin_designation(_fake_class):
        ts_mul = rinfo.value(rxn_info, 'tsmult')
        high_mul = rinfo.ts_mult(rxn_info, rxn_mul='high')
        _spin = 'high-spin' if ts_mul == high_mul else 'low-spin'
    else:
        _spin = ''

    # Determine if it iss intersystem crossing
    # rxn_muls = rinfo.value(rxn_info, 'mult')
    # is_isc = automol.reac.intersystem_crossing(rxn_muls)

    return automol.par.reaction_class_from_data(
        class_typ, _spin, rinfo.radrad(rxn_info), False)
예제 #2
0
파일: tsk.py 프로젝트: Auto-Mech/mechdriver
def skip_task(tsk, spc_dct, spc_name, thy_dct, es_keyword_dct, save_prefix):
    """ Determine if an electronic structure task should be skipped based on
        various parameters.

        :param spc_dct: species dictionary
        :type spc_dct: dictionary
        :param spc_name: name of species
        :type spc_name: string
        :rtype: bool
    """

    # Initialize skip to be false
    skip = False

    # Set theory info needed to find information
    ini_method_dct = thy_dct.get(es_keyword_dct['inplvl'])
    ini_thy_info = tinfo.from_dct(ini_method_dct)

    # Perform checks
    if 'ts' in spc_name:
        # Skip all tasks except find_ts
        # if rad-rad TS
        if tsk not in ('find_ts', 'rpath_scan'):  # generalize to other rpath
            rxn_info = spc_dct[spc_name]['rxn_info']
            ts_mul = rinfo.value(rxn_info, 'tsmult')
            high_ts_mul = rinfo.ts_mult(rxn_info, rxn_mul='high')
            if rinfo.radrad(rxn_info) and ts_mul != high_ts_mul:
                skip = True
                ioprinter.info_message(
                    f'Skipping task because {spc_name}',
                    'is a low-spin radical radical reaction')
    else:
        spc_natoms = len(automol.inchi.geometry(spc_dct[spc_name]['inchi']))
        if spc_natoms == 1:
            # Skip all tasks except init_geom and conf_energy
            # if species is an atom
            if tsk not in ('init_geom', 'conf_energy'):
                skip = True
                ioprinter.info_message('Skipping task for an atom...',
                                       newline=1)
        else:
            # Skip all tasks except ini_geom
            # if (non-TS) species is unstable (zrxn found (i.e. is not None))
            if tsk != 'init_geom':
                instab, path = filesys.read.instability_transformation(
                    spc_dct, spc_name, ini_thy_info, save_prefix)

                skip = (instab is not None)
                if skip:
                    ioprinter.info_message(
                        f'Found instability file at path {path}', newline=1)
                    ioprinter.info_message(
                        'Skipping task for unstable species...', newline=1)

    return skip
예제 #3
0
def _mod_class(class_typ, rxn_info):
    """ Create the object containing the full description of the
        reaction class, including its type, spin state, and whether
        it is a radical-radical combination.

        :param class_typ: reaction class type
        :type class_typ: str
        :param rxn_info: ???
        :tpye rxn_info: ???
    """

    # Set the spin of the reaction to high/low
    if automol.par.need_spin_designation(class_typ):
        ts_mul = rinfo.value(rxn_info, 'tsmult')
        high_mul = rinfo.ts_mult(rxn_info, rxn_mul='high')
        _spin = 'high-spin' if ts_mul == high_mul else 'low-spin'
    else:
        _spin = ''

    return automol.par.reaction_class_from_data(class_typ, _spin,
                                                rinfo.radrad(rxn_info))
예제 #4
0
def remove_radrad_ts(obj_queue, spc_dct):
    """ Remove TSs who have no information from the queue and
        include them in the missing data lists
    """

    ioprinter.info_message(
        'Removing low-spin radical-radical TS from queue...\n')

    new_queue = ()
    for obj in obj_queue:
        if 'ts_' in obj:
            rxn_info = spc_dct[obj]['rxn_info']
            ts_mul = rinfo.value(rxn_info, 'tsmult')
            high_ts_mul = rinfo.ts_mult(rxn_info, rxn_mul='high')
            if rinfo.radrad(rxn_info) and ts_mul != high_ts_mul:
                ioprinter.info_message(f'Removing {obj} from queue.')
            else:
                new_queue += (obj, )
        else:
            new_queue += (obj, )

    return new_queue
예제 #5
0
def skip_task(spc_dct, spc_name):
    """ Should this task be skipped?
    :param spc_dct: species dictionary
    :type spc_dct: dictionary
    :param spc_name: name of species
    :type spc_name: string

    :rtype skip: boolean
    """
    skip = False

    # It should be skipped if its radical radical
    if 'ts' in spc_name:
        rxn_info = spc_dct[spc_name]['rxn_info']
        ts_mul = rinfo.value(rxn_info, 'tsmult')
        high_ts_mul = rinfo.ts_mult(rxn_info, rxn_mul='high')
        if rinfo.radrad(rxn_info) and ts_mul != high_ts_mul:
            skip = True
            ioprinter.info_message(
                'Skipping task because {} is a low-spin radical radical reaction'
                .format(spc_name))
    return skip
예제 #6
0
def _mod_class(cls, rxn_info):
    """ append additional info to the class
    """

    full_cls_str = ''

    # Determine the string for radical radical reactions
    radrad = rinfo.radrad(rxn_info)
    radrad_str = 'radical-radical' if radrad else ''
    full_cls_str += radrad_str

    # Set the spin of the reaction to high/low
    if 'addition' in cls or 'absraction' in cls:
        ts_mul = rinfo.value(rxn_info, 'tsmult')
        high_mul = rinfo.ts_mult(rxn_info, rxn_mul='high')
        spin_str = 'high-spin' if ts_mul == high_mul else 'low-spin'
        full_cls_str += ' ' + spin_str
    else:
        spin_str = ''

    # Add the class label
    full_cls_str += ' ' + cls

    return full_cls_str