'Return a unique cyclically reduced version of the word.
Examples
>>> from sympy.combinatorics.free_groups import free_group
>>> F, x, y = free_group("x, y")
>>> (x**2*y**2*x**-1).identity_cyclic_reduction()
x*y**2
>>> (x**-3*y**-1*x**5).identity_cyclic_reduction()
x**2*y**-1
References
http://planetmath.org/cyclicallyreduced'

def identity_cyclic_reduction(self):

    word = self.copy()
    group = self.group
    while (not word.is_cyclically_reduced()):
        exp1 = word.exponent_syllable(0)
        exp2 = word.exponent_syllable((-1))
        r = (exp1 + exp2)
        if (r == 0):
            rep = word.array_form[1:(word.number_syllables() - 1)]
        else:
            rep = (((word.generator_syllable(0), (exp1 + exp2)),) + word.array_form[1:(word.number_syllables() - 1)])
        word = group.dtype(rep)
    return word
