예제 #1
0
def zmatrix_atom_ordering(geo, ts_bnds=()):
    """ z-matrix atom ordering
    """
    syms = automol.geom.symbols(geo)
    if len(syms) == 1:
        idxs = (0, )
    else:
        x2m = _pyx2z.from_geometry(geo, ts_bnds=ts_bnds)
        idxs = _pyx2z.zmatrix_atom_ordering(x2m)
    return idxs
예제 #2
0
def zmatrix_torsion_coordinate_names(geo, ts_bnds=()):
    """ z-matrix torsional coordinate names
    """
    syms = automol.geom.symbols(geo)
    if len(syms) == 1:
        names = ()
    else:
        x2m = _pyx2z.from_geometry(geo, ts_bnds=ts_bnds)
        names = _pyx2z.zmatrix_torsion_coordinate_names(x2m)

        zma = _pyx2z.to_zmatrix(x2m)
        name_dct = automol.zmatrix.standard_names(zma)
        names = tuple(map(name_dct.__getitem__, names))
    return names
예제 #3
0
def zmatrix(geo, ts_bnds=()):
    """ geometry => z-matrix
    """
    syms = automol.geom.symbols(geo)
    if len(syms) == 1:
        key_mat = [[None, None, None]]
        name_mat = [[None, None, None]]
        val_dct = {}
        zma = create.zmatrix.from_data(syms, key_mat, name_mat, val_dct)
    else:
        x2m = _pyx2z.from_geometry(geo, ts_bnds=ts_bnds)
        zma = _pyx2z.to_zmatrix(x2m)
    zma = automol.zmatrix.standard_form(zma)
    return zma
예제 #4
0
파일: zmat.py 프로젝트: sjklipp/autochem
def zmatrix_atom_ordering(geo, ts_bnds=()):
    """ Generate a dictionary which maps the order of atoms from the input
        molecular geometry to the order of atoms of the resulting Z-Matrix
        that is generated by the 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))
        :rtype: dict[int: int]
    """

    symbs = geom_symbols(geo)
    if len(symbs) == 1:
        idxs = {0: 0}
    else:
        x2m = _pyx2z.from_geometry(geo, ts_bnds=ts_bnds)
        idxs = _pyx2z.zmatrix_atom_ordering(x2m)

    return idxs
예제 #5
0
파일: zmat.py 프로젝트: sjklipp/autochem
def zmatrix_x2z(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 = geom_symbols(geo)
        key_mat = [[None, None, None]]
        val_mat = [[None, None, None]]
        zma = create.zmat.from_data(symbs, key_mat, val_mat)
    else:
        x2m = _pyx2z.from_geometry(geo, ts_bnds=ts_bnds)
        zma = _pyx2z.to_zmatrix(x2m)
    zma = standard_form(zma)

    return zma
예제 #6
0
파일: zmat.py 프로젝트: sjklipp/autochem
def zmatrix_torsion_coordinate_names(geo, ts_bnds=()):
    """ Generate a list of torsional coordinates using x2z interface. These
        names corresond to the Z-Matrix generated using the same algorithm.

        :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))
        :rtype: tuple(str)
    """

    symbs = geom_symbols(geo)
    if len(symbs) == 1:
        names = ()
    else:
        x2m = _pyx2z.from_geometry(geo, ts_bnds=ts_bnds)
        names = _pyx2z.zmatrix_torsion_coordinate_names(x2m)

        zma = _pyx2z.to_zmatrix(x2m)
        name_dct = standard_names(zma)
        names = tuple(map(name_dct.__getitem__, names))

    return names