Free algebra quotient elements - Algebras

Skip to content
Back to top
View this page
Edit this page

# 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)

  Bases: `AlgebraElement`

  Create the element x of the FreeAlgebraQuotient A.

  EXAMPLES:

  Sage

      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

  Python

      >>> 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()

    Return underlying vector representation of this element.

    EXAMPLES:

    Sage

        sage: H, (i,j,k) = sage.algebras.free_algebra_quotient.hamilton_quatalg(QQ)
        sage: ((2/3)*i - j).vector()
        (0, 2/3, -1, 0)

    Python

        >>> 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)

  EXAMPLES:

  Sage

      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

  Python

      >>> 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: sage.algebras.free_algebra_quotient_element.is_FreeAlgebraQuotientElement(1)
      False
      sage: sage.algebras.free_algebra_quotient_element.is_FreeAlgebraQuotientElement(H(1))
      True

  [Python]

      >>> 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