I have a set of linear homogeneous equations with 8580 variables. I want to estimate the time Mathematica
takes to solve the system, by solving smaller sets of equations. For example, I can take three equations, apply Reduce
and see the AbsoluteTiming
. Then, I repeat the same thing with four, five, ten etc.. equations and I can fit the execution time of Reduce
with a polynomial or exponential function.
However, the system is very big, only three equations store about 2MB in a text-file and indeed Reduce
takes too much time when applied to only one equation (which instead should be very easy, since it should just resolve on one unknown ). Instead, Solve
is pretty fast but I have some experiences that Solve
does not find all the solutions, so I would like to rely on the algorithms used by Reduce
. For example, you can find one equation here (I am forced to refer to external links, as the output of the system is a messy and wouldn't fit here) that you can save in a file and import with Get
. Using Solve
just takes 0.46
seconds, while Reduce
takes more than 1
minute (then, I aborted the command).
How can I speed up the execution time of Reduce
in a clever way, when dealing with a lot of variables? I guess that a system of homogenous equations in 8580 unknowns is challenging to solve. Any suggestion?
EDIT
I have constructed an explicit example that anyone can run on his/her laptop.
f1[a_, b_] := Det[{\[Lambda][a], \[Lambda][b]}]
generate\[Lambda][] := Module[{},
Clear[\[Lambda]];
\[Lambda][a_] := \[Lambda][a] = 1/RandomInteger[{1, 4}] RandomInteger[{-30, 30}, 2];
Table[\[Lambda][a], {a, 1, 5}];]
func = Sum[Subscript[A, i, j, k, m, n, p] f[i, j] f[k, m] f[n, p], {i, 1, 5}, {j, 1, 5}, {k, 1, 5}, {m, 1, 5}, {n, 1, 5}, {p, 1, 5}];
sys = {};
For[i = 1, i <= 250, i++,
generate\[Lambda][];
AppendTo[sys, (func /. f -> f1)==0]]
The function func
generate the equations of 8000 variables, which are stored in sys
. The variables $A_{i,j,k,m,n,p}$ are the unknowns in terms of which I want to solve the system. For the system I generate, I get a 601486920 bytes system from ByteCount[sys]
. What is the most efficient way to get a solution of this system?
Nullspace
on it. (Hopefully the coefficients of your system are floating point numbers.) $\endgroup$Nullaspace
does not seems to be effecient even for one equation, you can check it with the equation posted in privatebin.net/… $\endgroup$