Improving the running speed...
Is it possible to get faster running if one applies a kind of multiprocessing
to the example below?
L = Permutations(10)
K = factorial(10)
C = matrix(ZZ, 0, K)
d = []
for k in range(1, 10):
B = Arrangements([1 .. 10], k)
A = matrix(ZZ, [[all(p[i - 1] == u for i, u in zip(ii, uu))
for p in L] for ii in B for uu in B])
C = C.stack(A)
d.append(N-C.rank())
return d
The matrix
A
has size $\left(\frac{10!}{(10-k)!}\right)^2\times 10!$. For example, when $k=9$, it has $10!^3\approx 2^{65}$ elements, and there is no way you can fit it into memoryThank you.