예제 #1
0
def to_oriented_geometry(geo):
    """ obtain an oriented x2z molecule object from a geometry
    """
    _mg = pyx2z.MolecGeom()
    for sym, xyz in geo:
        _atm = pyx2z.Atom(sym)
        _atm[0], _atm[1], _atm[2] = xyz
        _mg.push_back(_atm)
    orient_mg = pyx2z.MolecOrient(_mg)
    return orient_mg
예제 #2
0
def test__Atom___getitem__():
    """ test pyx2z.Atom.__getitem__() and __setitem()
    """
    a = pyx2z.Atom('C', 13)
    a[0] = 1.0
    a[1] = 1.1
    a[2] = 1.2
    assert numpy.allclose(a[0], 1.0)
    assert numpy.allclose(a[1], 1.1)
    assert numpy.allclose(a[2], 1.2)
예제 #3
0
def from_geometry(geo):
    """ x2z molecule object from a geometry
    """
    _mg = pyx2z.MolecGeom()
    for sym, xyz in geo:
        _atm = pyx2z.Atom(sym)
        _atm[0], _atm[1], _atm[2] = xyz
        _mg.push_back(_atm)
    _ps = pyx2z.PrimStruct(_mg)
    x2m = pyx2z.MolecStruct(_ps)
    return x2m
예제 #4
0
def from_geometry(geo, ts_bnds=()):
    """ x2z molecule object from a geometry
    """
    _mg = pyx2z.MolecGeom()
    for sym, xyz in geo:
        _atm = pyx2z.Atom(sym)
        _atm[0], _atm[1], _atm[2] = xyz
        _mg.push_back(_atm)

    ts_bnds = list(map(list, ts_bnds))
    x2m = pyx2z.MolecStruct(_mg, ts_bnds)
    return x2m
예제 #5
0
def to_oriented_geometry(geo):
    """ Generate an oriented x2z molecule object from a geometry.

        :param geo: molecular geometry
        :type geo: automol geometry data structure
        :rtype: x2z molecule object
    """

    _mg = pyx2z.MolecGeom()
    for sym, xyz in geo:
        _atm = pyx2z.Atom(sym)
        _atm[0], _atm[1], _atm[2] = xyz
        _mg.push_back(_atm)
    orient_mg = pyx2z.MolecOrient(_mg)

    return orient_mg
예제 #6
0
def from_geometry(geo, ts_bnds=()):
    """ Generate an x2z molecule object from a geometry.

        :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: x2z molecule object
    """

    _mg = pyx2z.MolecGeom()
    for sym, xyz in geo:
        _atm = pyx2z.Atom(sym)
        _atm[0], _atm[1], _atm[2] = xyz
        _mg.push_back(_atm)

    ts_bnds = list(map(list, ts_bnds))
    x2m = pyx2z.MolecStruct(_mg, ts_bnds)

    return x2m
예제 #7
0
def _pyx2z_atom(asymb, xyz):
    ang2bohr = 1.8897259886
    x2zatm = pyx2z.Atom(asymb)
    x2zatm[0], x2zatm[1], x2zatm[2] = numpy.multiply(xyz, ang2bohr)
    return x2zatm
예제 #8
0
def _atom_obj(asymb, xyz):
    _ang2bohr = 1.8897259886
    _a = pyx2z.Atom(asymb)
    _a[0], _a[1], _a[2] = numpy.multiply(xyz, _ang2bohr)
    return _a
예제 #9
0
def test__MolecGeom_push_back():
    """ test pyx2z.MolecGeom.push_back()
    """
    m = pyx2z.MolecGeom()
    m.push_back(pyx2z.Atom('C'))
    assert m.size() == 1