1 | initial version |
Like this maybe
sage: A = algebras.Free(QQ, 'abc')
sage: elt = 4 * A.monomial(Word('abc')) + 6*A.monomial(Word('a'))
sage: data = [(w.to_word(), cf) for w, cf in elt]
sage: A.sum_of_terms((w[1:] + w[:1], cf) for w, cf in data)
6*a + 4*b*c*a