Function abelianize() returns a freealg object that is equivalent to its argument under assumption of Abelianness. The symbols are placed in alphabetical order.

abelianize(x)

Arguments

x

A freealg object

Details

Abelianizing a free group element means that the symbols can commute past one another. Abelianization is vectorized.

Value

Returns an object of class freealg.

Author

Robin K. S. Hankin

Note

There is a very similar function in the freegroup package. However, the frab package is the best way to work with the free Abelian group.

Examples


abelianize(as.freealg("ba + 2abbba + 3abAB"))
#> free algebra element algebraically equal to
#> + 3 + 2aabbb + ab

abelianize(.[rfalg(),rfalg()])
#> free algebra element algebraically equal to
#> 0