# # file: ass.gap # purpose: functions for associative algberas # created: pasha jan 9 2005 # modified: pasha jan 10 2005 # modification: try to handle infinite-dimensional case # # whether an algebra is square-zero; returns true of false IsSquareZero := function (A) local B, i, j; if Dimension(A) < infinity then B := Basis(A); else # should'n we always check generators instead of basis? B := GeneratorsOfAlgebra (A); fi; for i in [1..Length(B)] do for j in [1..Length(B)] do if B[i]*B[j] <> Zero(A) then return (false); fi; od; od; return (true); end; # returns square-zero algebra over a field K of dimension n SquareZeroAlgebra := function (K, n) return (AlgebraByStructureConstants (K, EmptySCTable (n, Zero(K)))); end; # end of ass.gap