Example #1
0
def zmatrix_with_conversion_info(geo, ts_bnds=()):
    """ Generate a corresponding Z-Matrix for a molecular geometry
        using internal autochem procedures.

        :param geo: molecular geometry
        :type geo: automol geometry data structure
        :param ts_bnds: keys for the breaking/forming bonds in a TS
        :type ts_bnds: tuple(frozenset(int))
        :returns: automol Z-Matrix data structure, Z-Matrix atom ordering, and
            a dictionary mapping linear atoms onto their associated dummy atoms
    """

    if ts_bnds:
        raise NotImplementedError

    if is_atom(geo):
        symbs = symbols(geo)
        key_mat = [[None, None, None]]
        val_mat = [[None, None, None]]
        zma = automol.zmat.base.from_data(symbs, key_mat, val_mat)
        zma_keys = [0]
        dummy_key_dct = {}
    else:
        geo, dummy_key_dct = insert_dummies_on_linear_atoms(geo)
        gra = connectivity_graph(geo)
        bnd_keys = tuple(dummy_key_dct.items())
        ord_dct = {k: 0 for k in bnd_keys}
        gra = automol.graph.add_bonds(gra, bnd_keys, ord_dct=ord_dct)
        vma, zma_keys = automol.graph.vmat.vmatrix(gra)
        geo = from_subset(geo, zma_keys)
        zma = automol.zmat.base.from_geometry(vma, geo)

    return zma, zma_keys, dummy_key_dct
Example #2
0
def external_symmetry_factor(geo):
    """ Obtain the external symmetry factor for a geometry using x2z interface
        which determines the initial symmetry factor and then divides by the
        enantiomeric factor.

        :param geo: molecular geometry
        :type geo: automol geometry data structure
        :rtype: float
    """

    if is_atom(geo):
        ext_sym_fac = 1.
    else:
        oriented_geom = _pyx2z.to_oriented_geometry(geo)
        ext_sym_fac = oriented_geom.sym_num()
        if oriented_geom.is_enantiomer():
            ext_sym_fac *= 0.5

    return ext_sym_fac
Example #3
0
def x2z_zmatrix(geo, ts_bnds=()):
    """ Generate a corresponding Z-Matrix for a molecular geometry
        using x2z interface.

        :param geo: molecular geometry
        :type geo: automol geometry data structure
        :param ts_bnds: keys for the breaking/forming bonds in a TS
        :type ts_bnds: tuple(frozenset(int))
    """

    if is_atom(geo):
        symbs = automol.geom.base.symbols(geo)
        key_mat = [[None, None, None]]
        val_mat = [[None, None, None]]
        zma = automol.zmat.base.from_data(symbs, key_mat, val_mat)
    else:
        x2m = _pyx2z.from_geometry(geo, ts_bnds=ts_bnds)
        zma = _pyx2z.to_zmatrix(x2m)
    zma = automol.zmat.base.standard_form(zma)

    return zma