I have a loop like
n = 3
M = MatrixSpace(Integers(n),n)
L = []
for m in M:
if condition:
L += [m]
In the case $n=3$, there are $3^{3^2} = 19683$ such matrices in M
, which the computers nowadays can do within a few seconds, but if $n=4$, there are already $4^{4^2} ≈ 4.3\cdot10^9$ matrices in M
to check. Is there a faster way to make this possible, for example by parallelization?