Free algebra quotient elements

AUTHORS:
  • William Stein (2011-11-19): improved doctest coverage to 100%

  • David Kohel (2005-09): initial version

class sage.algebras.free_algebra_quotient_element.FreeAlgebraQuotientElement(A, x)[source]

Bases: AlgebraElement

Create the element x of the FreeAlgebraQuotient A.

EXAMPLES:

sage: H, (i,j,k) = sage.algebras.free_algebra_quotient.hamilton_quatalg(ZZ)
sage: sage.algebras.free_algebra_quotient.FreeAlgebraQuotientElement(H, i)
i
sage: a = sage.algebras.free_algebra_quotient.FreeAlgebraQuotientElement(H, 1); a
1
sage: a in H
True
>>> from sage.all import *
>>> H, (i,j,k) = sage.algebras.free_algebra_quotient.hamilton_quatalg(ZZ)
>>> sage.algebras.free_algebra_quotient.FreeAlgebraQuotientElement(H, i)
i
>>> a = sage.algebras.free_algebra_quotient.FreeAlgebraQuotientElement(H, Integer(1)); a
1
>>> a in H
True
vector()[source]

Return underlying vector representation of this element.

EXAMPLES:

sage: H, (i,j,k) = sage.algebras.free_algebra_quotient.hamilton_quatalg(QQ)
sage: ((2/3)*i - j).vector()
(0, 2/3, -1, 0)
>>> from sage.all import *
>>> H, (i,j,k) = sage.algebras.free_algebra_quotient.hamilton_quatalg(QQ)
>>> ((Integer(2)/Integer(3))*i - j).vector()
(0, 2/3, -1, 0)
sage.algebras.free_algebra_quotient_element.is_FreeAlgebraQuotientElement(x)[source]

EXAMPLES:

sage: H, (i,j,k) = sage.algebras.free_algebra_quotient.hamilton_quatalg(QQ)
sage: sage.algebras.free_algebra_quotient_element.is_FreeAlgebraQuotientElement(i)
doctest:warning...
DeprecationWarning: The function is_FreeAlgebraQuotientElement is deprecated;
use 'isinstance(..., FreeAlgebraQuotientElement)' instead.
See https://github.com/sagemath/sage/issues/38184 for details.
True
>>> from sage.all import *
>>> H, (i,j,k) = sage.algebras.free_algebra_quotient.hamilton_quatalg(QQ)
>>> sage.algebras.free_algebra_quotient_element.is_FreeAlgebraQuotientElement(i)
doctest:warning...
DeprecationWarning: The function is_FreeAlgebraQuotientElement is deprecated;
use 'isinstance(..., FreeAlgebraQuotientElement)' instead.
See https://github.com/sagemath/sage/issues/38184 for details.
True

Of course this is testing the data type:

sage: sage.algebras.free_algebra_quotient_element.is_FreeAlgebraQuotientElement(1)
False
sage: sage.algebras.free_algebra_quotient_element.is_FreeAlgebraQuotientElement(H(1))
True
>>> from sage.all import *
>>> sage.algebras.free_algebra_quotient_element.is_FreeAlgebraQuotientElement(Integer(1))
False
>>> sage.algebras.free_algebra_quotient_element.is_FreeAlgebraQuotientElement(H(Integer(1)))
True