def _get_indices_Mul(expr, return_dummies=False):
 inds = list(map(get_indices, expr.args))
 (inds, syms) = list(zip(*inds))
 inds = list(map(list, inds))
 inds = list(reduce((lambda x, y: (x + y)), inds))
 (inds, dummies) = _remove_repeated(inds)
 symmetry = {}
 for s in syms:
  for pair in s:
   if (pair in symmetry):
    symmetry[pair] *= s[pair]
   else:
    symmetry[pair] = s[pair]
 if return_dummies:
  return (inds, symmetry, dummies)
 else:
  return (inds, symmetry)

def _get_indices_Mul ( expr , return_dummies = False ) : inds = list ( map ( get_indices , expr . args ) ) ( inds , syms ) = list ( zip ( * inds ) ) inds = list ( map ( list , inds ) ) inds = list ( reduce ( ( lambda x , y : ( x + y ) ) , inds ) ) ( inds , dummies ) = _remove_repeated ( inds ) symmetry = { } for s in syms : for pair in s : if ( pair in symmetry ) : symmetry [ pair ] *= s [ pair ] else : symmetry [ pair ] = s [ pair ] if return_dummies : return ( inds , symmetry , dummies ) else : return ( inds , symmetry )
determine the outer indices of a mul object .