Esempio n. 1
0
def values(zma, angstrom=False, degree=False):
    """ coordinate values, by coordinate name
    """
    vma, val_dct = zma

    # post-processing for unit convertions
    dist_names = _v_.distance_names(vma)
    ang_names = _v_.angle_names(vma)
    orig_val_dct = val_dct

    val_dct = {}
    for name, val in orig_val_dct.items():
        if angstrom and name in dist_names:
            val *= qcc.conversion_factor('bohr', 'angstrom')
        if degree and name in ang_names:
            val *= qcc.conversion_factor('radian', 'degree')
        val_dct[name] = val
    return val_dct
Esempio n. 2
0
def from_geometry(vma, geo):
    """ determine z-matrix from v-matrix and geometry
    """
    assert _v_.symbols(vma) == automol.geom.symbols(geo)
    val_dct = {}
    coo_dct = _v_.coordinates(vma, multi=False)
    dist_names = _v_.distance_names(vma)
    cent_names = _v_.central_angle_names(vma)
    dih_names = _v_.dihedral_angle_names(vma)
    for name, coo in coo_dct.items():
        if name in dist_names:
            val_dct[name] = automol.geom.distance(geo, *coo)
        elif name in cent_names:
            val_dct[name] = automol.geom.central_angle(geo, *coo)
        elif name in dih_names:
            val_dct[name] = automol.geom.dihedral_angle(geo, *coo)

    zma = automol.create.zmatrix.from_data(
        symbols=_v_.symbols(vma), key_matrix=_v_.key_matrix(vma),
        name_matrix=_v_.name_matrix(vma), values=val_dct)
    return zma
Esempio n. 3
0
def distance_names(zma):
    """ distance coordinate names
    """
    return _v_.distance_names(var_(zma))