Bases: sage.rings.ring.Algebra
Create a finite-dimensional -algebra from a multiplication table.
INPUT:
The list table must have the following form: there exists a
finite-dimensional -algebra of degree
with basis
such that the
-th element of table is the
matrix of right multiplication by
with respect to the basis
.
EXAMPLES:
sage: A = FiniteDimensionalAlgebra(GF(3), [Matrix([[1, 0], [0, 1]]), Matrix([[0, 1], [0, 0]])])
sage: A
Finite-dimensional algebra of degree 2 over Finite Field of size 3
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
Finite-dimensional algebra of degree 3 over Rational Field
alias of FiniteDimensionalAlgebraElement
Return self base changed to F.
EXAMPLES:
sage: C = FiniteDimensionalAlgebra(GF(2), [Matrix([1])])
sage: k.<y> = GF(4)
sage: C.base_extend(k)
Finite-dimensional algebra of degree 1 over Finite Field in y of size 2^2
Return a list of the basis elements of self.
EXAMPLES:
sage: A = FiniteDimensionalAlgebra(GF(3), [Matrix([[1, 0], [0, 1]]), Matrix([[0, 1], [0, 0]])])
sage: A.basis()
[e0, e1]
Return the cardinality of self.
EXAMPLES:
sage: A = FiniteDimensionalAlgebra(GF(7), [Matrix([[1, 0], [0, 1]]), Matrix([[0, 1], [2, 3]])])
sage: A.cardinality()
49
sage: B = FiniteDimensionalAlgebra(RR, [Matrix([[1, 0], [0, 1]]), Matrix([[0, 1], [2, 3]])])
sage: B.cardinality()
+Infinity
sage: C = FiniteDimensionalAlgebra(RR, [])
sage: C.cardinality()
1
Return the number of generators of self, i.e., the degree of self over its base field.
EXAMPLES:
sage: A = FiniteDimensionalAlgebra(GF(3), [Matrix([[1, 0], [0, 1]]), Matrix([[0, 1], [0, 0]])])
sage: A.ngens()
2
TESTS:
sage: A = FiniteDimensionalAlgebra(QQ, [Matrix([0])])
sage: a = A(0)
sage: a.parent()
Finite-dimensional algebra of degree 1 over Rational Field
sage: A(1)
Traceback (most recent call last):
...
TypeError: algebra is not unitary
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(17)
17*e0 + 17*e2
Return the -th basis element of self.
EXAMPLES:
sage: A = FiniteDimensionalAlgebra(GF(3), [Matrix([[1, 0], [0, 1]]), Matrix([[0, 1], [0, 0]])])
sage: A.gen(0)
e0
Return the right ideal of self generated by gens.
INPUT:
EXAMPLES:
sage: A = FiniteDimensionalAlgebra(GF(3), [Matrix([[1, 0], [0, 1]]), Matrix([[0, 1], [0, 0]])])
sage: A.ideal(A([1,1]))
Ideal (e0 + e1) of Finite-dimensional algebra of degree 2 over Finite Field of size 3
Return True if self is associative.
EXAMPLES:
sage: A = FiniteDimensionalAlgebra(QQ, [Matrix([[1,0], [0,1]]), Matrix([[0,1],[-1,0]])])
sage: A.is_associative()
True
sage: B = FiniteDimensionalAlgebra(QQ, [Matrix([[1,0,0], [0,1,0], [0,0,1]]), Matrix([[0,1,0], [0,0,0], [0,0,0]]), Matrix([[0,0,1], [0,0,0], [1,0,0]])])
sage: B.is_associative()
False
sage: e = B.basis()
sage: (e[1]*e[2])*e[2]==e[1]*(e[2]*e[2])
False
Return True if self is commutative.
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.is_commutative()
True
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.is_commutative()
False
Return True if the cardinality of self is finite.
EXAMPLES:
sage: A = FiniteDimensionalAlgebra(GF(7), [Matrix([[1, 0], [0, 1]]), Matrix([[0, 1], [2, 3]])])
sage: A.is_finite()
True
sage: B = FiniteDimensionalAlgebra(RR, [Matrix([[1, 0], [0, 1]]), Matrix([[0, 1], [2, 3]])])
sage: B.is_finite()
False
sage: C = FiniteDimensionalAlgebra(RR, [])
sage: C.is_finite()
True
Return True if self has a two-sided multiplicative identity element.
EXAMPLES:
sage: A = FiniteDimensionalAlgebra(QQ, [])
sage: A.is_unitary()
True
sage: B = FiniteDimensionalAlgebra(QQ, [Matrix([[1,0], [0,1]]), Matrix([[0,1], [-1,0]])])
sage: B.is_unitary()
True
sage: C = FiniteDimensionalAlgebra(QQ, [Matrix([[0,0], [0,0]]), Matrix([[0,0], [0,0]])])
sage: C.is_unitary()
False
sage: D = FiniteDimensionalAlgebra(QQ, [Matrix([[1,0], [0,1]]), Matrix([[1,0], [0,1]])])
sage: D.is_unitary()
False
Note
If a finite-dimensional algebra over a field admits a left identity, then this is the unique left identity, and it is also a right identity.
Return True if self is the zero ring.
EXAMPLES:
sage: A = FiniteDimensionalAlgebra(QQ, [])
sage: A.is_zero()
True
sage: B = FiniteDimensionalAlgebra(GF(7), [Matrix([0])])
sage: B.is_zero()
False
Return the list of matrices for left multiplication by the basis elements.
EXAMPLES:
sage: B = FiniteDimensionalAlgebra(QQ, [Matrix([[1,0], [0,1]]), Matrix([[0,1],[-1,0]])])
sage: B.left_table()
[
[1 0] [ 0 1]
[0 1], [-1 0]
]
Compute the maximal ideal of the local algebra self.
Note
self must be unitary, commutative, associative and local (have a unique maximal ideal).
OUTPUT:
EXAMPLES:
sage: A = FiniteDimensionalAlgebra(GF(3), [Matrix([[1, 0], [0, 1]]), Matrix([[0, 1], [0, 0]])])
sage: A.maximal_ideal()
Ideal (0, e1) of Finite-dimensional algebra of degree 2 over Finite Field of size 3
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.maximal_ideal()
Traceback (most recent call last):
...
ValueError: algebra is not local
Return a list consisting of all maximal ideals of self.
EXAMPLES:
sage: A = FiniteDimensionalAlgebra(GF(3), [Matrix([[1, 0], [0, 1]]), Matrix([[0, 1], [0, 0]])])
sage: A.maximal_ideals()
[Ideal (e1) of Finite-dimensional algebra of degree 2 over Finite Field of size 3]
sage: B = FiniteDimensionalAlgebra(QQ, [])
sage: B.maximal_ideals()
[]
Return the number of generators of self, i.e., the degree of self over its base field.
EXAMPLES:
sage: A = FiniteDimensionalAlgebra(GF(3), [Matrix([[1, 0], [0, 1]]), Matrix([[0, 1], [0, 0]])])
sage: A.ngens()
2
Return the multiplicative identity element of self, if it exists.
EXAMPLES:
sage: A = FiniteDimensionalAlgebra(QQ, [])
sage: A.one()
0
sage: B = FiniteDimensionalAlgebra(QQ, [Matrix([[1,0], [0,1]]), Matrix([[0,1], [-1,0]])])
sage: B.one()
e0
sage: C = FiniteDimensionalAlgebra(QQ, [Matrix([[0,0], [0,0]]), Matrix([[0,0], [0,0]])])
sage: C.one()
Traceback (most recent call last):
...
TypeError: algebra is not unitary
Return the primary decomposition of self.
Note
self must be unitary, commutative and associative.
OUTPUT:
EXAMPLES:
sage: A = FiniteDimensionalAlgebra(GF(3), [Matrix([[1, 0], [0, 1]]), Matrix([[0, 1], [0, 0]])])
sage: A.primary_decomposition()
[Morphism from Finite-dimensional algebra of degree 2 over Finite Field of size 3 to Finite-dimensional algebra of degree 2 over Finite Field of size 3 given by matrix [1 0]
[0 1]]
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.primary_decomposition()
[Morphism from Finite-dimensional algebra of degree 3 over Rational Field to Finite-dimensional algebra of degree 1 over Rational Field given by matrix [0]
[0]
[1], Morphism from Finite-dimensional algebra of degree 3 over Rational Field to Finite-dimensional algebra of degree 2 over Rational Field given by matrix [1 0]
[0 1]
[0 0]]
Return the quotient of self by ideal.
INPUT:
OUTPUT:
EXAMPLES:
sage: A = FiniteDimensionalAlgebra(GF(3), [Matrix([[1, 0], [0, 1]]), Matrix([[0, 1], [0, 0]])])
sage: q0 = A.quotient_map(A.zero_ideal())
sage: q0
Morphism from Finite-dimensional algebra of degree 2 over Finite Field of size 3 to Finite-dimensional algebra of degree 2 over Finite Field of size 3 given by matrix
[1 0]
[0 1]
sage: q1 = A.quotient_map(A.ideal(A.gen(1)))
sage: q1
Morphism from Finite-dimensional algebra of degree 2 over Finite Field of size 3 to Finite-dimensional algebra of degree 1 over Finite Field of size 3 given by matrix
[1]
[0]
Return a random element of self.
Optional input parameters are propagated to the random_element method of the underlying VectorSpace.
EXAMPLES:
sage: A = FiniteDimensionalAlgebra(GF(3), [Matrix([[1, 0], [0, 1]]), Matrix([[0, 1], [0, 0]])])
sage: A.random_element() # random
e0 + 2*e1
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.random_element(num_bound=1000) # random
215/981*e0 + 709/953*e1 + 931/264*e2
Return the multiplication table of self, as a list of matrices for right multiplication by the basis elements.
EXAMPLES:
sage: A = FiniteDimensionalAlgebra(GF(3), [Matrix([[1, 0], [0, 1]]), Matrix([[0, 1], [0, 0]])])
sage: A.table()
[
[1 0] [0 1]
[0 1], [0 0]
]