Let $X$ be a finite set of $n \times n$-matrices over a field $K$. Let $A_X$ be the $K$-algebra of $n \times n$-matrices $Y$ with $YS=SY$ for all $S \in X$.
Question: Is there a quick way to obtain the K-algebra $A_X$ for a given set of matrices $X$ in GAP?
If it helps we can assume that $K$ is a finite field (but filtering all elements takes too long) and that all matrices in $X$ have integer entries.
I am also interested whether there is a quick way in Magma (and whether this is quicker than in GAP).
You are asking for the endomorphisms of the module describes by the matrix action from $X$. Over a finite field, you can get a basis of this ring using the MeatAxe as: