### Navigation

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

# Elements of Finite Algebras

class `sage.algebras.finite_dimensional_algebras.finite_dimensional_algebra_element.``FiniteDimensionalAlgebraElement`(A, elt=None, check=True)

  Bases: `sage.structure.element.AlgebraElement`

  Create an element of a `FiniteDimensionalAlgebra` using a multiplication table.

  INPUT:

  - `A` – a `FiniteDimensionalAlgebra` which will be the parent
  - `elt` – vector, matrix or element of the base field (default: `None`)
  - `check` – boolean (default: `True`); if `False` and `elt` is a matrix, assume that it is known to be the matrix of an element

  If `elt` is a vector, it is interpreted as a vector of coordinates with respect to the given basis of `A`. If `elt` is a matrix, it is interpreted as a multiplication matrix with respect to this basis.

  EXAMPLES:

      sage: A = FiniteDimensionalAlgebra(GF(3), [Matrix([[1,0], [0,1]]), Matrix([[0,1], [0,0]])])
      sage: A(17)
      2*e0
      sage: A([1,1])
      e0 + e1

  `characteristic_polynomial`()

    Return the characteristic polynomial of `self`.

    Note

    This function just returns the characteristic polynomial of the matrix of right multiplication by `self`. This may not be a very meaningful invariant if the algebra is not unitary and associative.

    EXAMPLES:

        sage: B = FiniteDimensionalAlgebra(QQ, [Matrix([[1,0,0], [0,1,0], [0,0,0]]), Matrix([[0,1,0], [0,0,0], [0,0,0]]), Matrix([[0,0,0], [0,0,0], [0,0,1]])])
        sage: B(0).characteristic_polynomial()
        x^3
        sage: b = B.random_element()
        sage: f = b.characteristic_polynomial(); f  # random
        x^3 - 8*x^2 + 16*x
        sage: f(b) == 0
        True

  `inverse`()

    Return the two-sided multiplicative inverse of `self`, if it exists.

    Note

    If an element of a unitary finite-dimensional algebra over a field admits a left inverse, then this is the unique left inverse, and it is also a right inverse.

    EXAMPLES:

        sage: C = FiniteDimensionalAlgebra(QQ, [Matrix([[1,0], [0,1]]), Matrix([[0,1], [-1,0]])])
        sage: C([1,2]).inverse()
        1/5*e0 - 2/5*e1

  `is_invertible`()

    Return `True` if `self` has a two-sided multiplicative inverse.

    Note

    If an element of a unitary finite-dimensional algebra over a field admits a left inverse, then this is the unique left inverse, and it is also a right inverse.

    EXAMPLES:

        sage: C = FiniteDimensionalAlgebra(QQ, [Matrix([[1,0], [0,1]]), Matrix([[0,1], [-1,0]])])
        sage: C([1,2]).is_invertible()
        True
        sage: C(0).is_invertible()
        False

  `is_nilpotent`()

    Return `True` if `self` is nilpotent.

    EXAMPLES:

        sage: C = FiniteDimensionalAlgebra(QQ, [Matrix([[1,0], [0,1]]), Matrix([[0,1], [0,0]])])
        sage: C([1,0]).is_nilpotent()
        False
        sage: C([0,1]).is_nilpotent()
        True

        sage: A = FiniteDimensionalAlgebra(QQ, [Matrix([0])])
        sage: A([1]).is_nilpotent()
        True

  `is_zerodivisor`()

    Return `True` if `self` is a left or right zero-divisor.

    EXAMPLES:

        sage: C = FiniteDimensionalAlgebra(QQ, [Matrix([[1,0], [0,1]]), Matrix([[0,1], [0,0]])])
        sage: C([1,0]).is_zerodivisor()
        False
        sage: C([0,1]).is_zerodivisor()
        True

  `left_matrix`()

    Return the matrix for multiplication by `self` from the left.

    EXAMPLES:

        sage: C = FiniteDimensionalAlgebra(QQ, [Matrix([[1,0,0], [0,0,0], [0,0,0]]), Matrix([[0,1,0], [0,0,0], [0,0,0]]), Matrix([[0,0,0], [0,1,0], [0,0,1]])])
        sage: C([1,2,0]).left_matrix()
        [1 0 0]
        [0 1 0]
        [0 2 0]

  `matrix`()

    Return the matrix for multiplication by `self` from the right.

    EXAMPLES:

        sage: B = FiniteDimensionalAlgebra(QQ, [Matrix([[1,0,0], [0,1,0], [0,0,0]]), Matrix([[0,1,0], [0,0,0], [0,0,0]]), Matrix([[0,0,0], [0,0,0], [0,0,1]])])
        sage: B(5).matrix()
        [5 0 0]
        [0 5 0]
        [0 0 5]

  `minimal_polynomial`()

    Return the minimal polynomial of `self`.

    EXAMPLES:

        sage: B = FiniteDimensionalAlgebra(QQ, [Matrix([[1,0,0], [0,1,0], [0,0,0]]), Matrix([[0,1,0], [0,0,0], [0,0,0]]), Matrix([[0,0,0], [0,0,0], [0,0,1]])])
        sage: B(0).minimal_polynomial()
        x
        sage: b = B.random_element()
        sage: f = b.minimal_polynomial(); f  # random
        x^3 + 1/2*x^2 - 7/16*x + 1/16
        sage: f(b) == 0
        True

  `vector`()

    Return `self` as a vector.

    EXAMPLES:

        sage: B = FiniteDimensionalAlgebra(QQ, [Matrix([[1,0,0], [0,1,0], [0,0,0]]), Matrix([[0,1,0], [0,0,0], [0,0,0]]), Matrix([[0,0,0], [0,0,0], [0,0,1]])])
        sage: B(5).vector()
        (5, 0, 5)

### Navigation

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