Let $X$ be a finite set of integers.
Question: Is there a fast way to obtain all symmetric $n \times n$ matrices with entries in $X$ in GAP?
I try to obtain this set of matrices for example for $n=5$ and $X= \{-1,0,1 \}$ but I get "Error, reached the pre-set memory limit" using GAP. So I wonder whether there is a quick way to obtain such matrices that might be possible also for $n=5$ ($n=4$ takes some minutes).
Symmetric matrices form a vector space and you can use vector space functionality to construct them. E.g. for $n=2$ and the field with $3$ elements:
You can use this enumerator
elike a list, but it uses far less memory. Converting from finite field to integer entries will be easy.