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)
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
def count(zma): """ the number of z-matrix rows (number of atoms or dummy atoms) """ return vmat.count(zma)