Free algebra elements

AUTHORS:

  • David Kohel (2005-09)

class sage.algebras.free_algebra_element.FreeAlgebraElement(A, x)

Bases: sage.modules.with_basis.indexed_element.IndexedFreeModuleElement, sage.structure.element.AlgebraElement

A free algebra element.

to_pbw_basis()

Return self in the Poincaré-Birkhoff-Witt (PBW) basis.

EXAMPLES:

sage: F.<x,y,z> = FreeAlgebra(ZZ, 3)
sage: p = x^2*y + 3*y*x + 2
sage: p.to_pbw_basis()
2*PBW[1] + 3*PBW[y]*PBW[x] + PBW[x^2*y]
 + 2*PBW[x*y]*PBW[x] + PBW[y]*PBW[x]^2
variables()

Return the variables used in self.

EXAMPLES:

sage: A.<x,y,z> = FreeAlgebra(ZZ,3)
sage: elt = x + x*y + x^3*y
sage: elt.variables()
[x, y]
sage: elt = x + x^2 - x^4
sage: elt.variables()
[x]
sage: elt = x + z*y + z*x
sage: elt.variables()
[x, y, z]