Subalgebra( A, gens )
returns the subalgebra of the algebra A generated by the elements in the list gens.
gap> a:= [ [ 1, 0 ], [ 0, 0 ] ];;
gap> b:= [ [ 0, 0 ], [ 0, 1 ] ] ;;
gap> alg:= Algebra( Rationals, [ a, b ] );;
gap> alg.name:= "alg";;
gap> s:= Subalgebra( alg, [ a ] );
Subalgebra( alg, [ [ [ 1, 0 ], [ 0, 0 ] ] ] )
gap> s = alg;
false
gap> s:= UnitalSubalgebra( alg, [ a ] );
UnitalSubalgebra( alg, [ [ [ 1, 0 ], [ 0, 0 ] ] ] )
gap> s = alg;
true
Note that Subalgebra, UnitalSubalgebra, AsSubalgebra and
AsUnitalSubalgebra are the only functions in which the name
Subalgebra does not refer to the mathematical terms subalgebra and
superalgebra but to the implementation of algebras as subalgebras and
parent algebras.
GAP 3.4.4