def sum(self, o, *ops): if o.ufl_shape: indices = tuple(Index() for i in range(len(o.ufl_shape))) return ComponentTensor(Sum(*[Indexed(op, indices) for op in ops]), indices) else: return Sum(*ops)
def _slate2gem_add(expr, self): A, B = map(self, expr.children) indices = tuple(make_indices(len(A.shape))) return ComponentTensor(Sum(Indexed(A, indices), Indexed(B, indices)), indices)