示例#1
0
文件: _zmat.py 项目: sjklipp/autochem
def count(zma):
    """ Obtain the number of rows of the Z-Matrix, which corresponds to
        the number of atoms defined in the Z-Matrix. This includes all
        real and dummy atoms.

        :param zma: Z-Matrix
        :type zma: automol Z-Matrix data structure
        :rtype: int
    """
    return vmat.count(zma)
示例#2
0
def shift_down(zma, vals):
    """
    Build a remdummy list that tells how to shift the groups
    """

    dummy_idxs = sorted(atom_indices(zma, 'X', match=True))
    if dummy_idxs:
        remdummy = [0 for _ in range(count(zma))]
        for dummy in dummy_idxs:
            for idx, _ in enumerate(remdummy):
                if dummy < idx:
                    remdummy[idx] += 1

        vals1 = tuple(val + 1 for val in vals)
        vals2 = tuple(val - remdummy[val - 1] for val in vals1)
        shift_vals = tuple(val - 1 for val in vals2)

    else:
        shift_vals = vals

    return shift_vals
示例#3
0
def count(zma):
    """ the number of z-matrix rows (number of atoms or dummy atoms)
    """
    return vmat.count(zma)