Implement symmetry preserving summations which take care of the associative property. See this paper for details: https://www.sciencedirect.com/science/article/pii/S0045793018308399