def _get_indices_Add(expr):

    inds = list(map(get_indices, expr.args))
    inds, syms = list(zip(*inds))

    # allow broadcast of scalars
    non_scalars = [x for x in inds if x != set()]
    if not non_scalars:
        return set(), {}

    if not all([x == non_scalars[0] for x in non_scalars[1:]]):
        raise IndexConformanceException("Indices are not consistent: %s" % expr)
    if not reduce(lambda x, y: x != y or y, syms):
        symmetries = syms[0]
    else:
        # FIXME: search for symmetries
        symmetries = {}

    return non_scalars[0], symmetries
Determine outer indices of an Add object.
dataset/ETHPy150Open sympy/sympy/sympy/tensor/index_methods.py/_get_indices_Add