### Navigation

- index
- modules |
- next |
- previous |
- Algebras »

# Free algebra elements

AUTHORS:

- David Kohel (2005-09)

TESTS:

    sage: R.<x,y> = FreeAlgebra(QQ,2)
    sage: x == loads(dumps(x))
    True
    sage: x*y
    x*y
    sage: (x*y)^0
    1
    sage: (x*y)^3
    x*y*x*y*x*y

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

  Bases: `sage.structure.element.AlgebraElement`, `sage.combinat.free_module.CombinatorialFreeModuleElement`

  A free algebra element.

  `to_pbw_basis`()

    Return `self` in the Poincare-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] + 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]

### Navigation

- index
- modules |
- next |
- previous |
- Algebras »