def x2z_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 = 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
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
def x2z_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 = 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 = automol.zmat.base.standard_names(zma) names = tuple(map(name_dct.__getitem__, names)) return names