You're absolutely right! This *sucks* -- it seems like nothing we
have ever wrapped in Linbox is right at first. Hopefully the issue is
that somehow the algorithm is only supposed to be probabilistic, and
we're just misusing it in sage (quite possible).
Anyway, Clement Pernet will be at Sage Days next week, and we'll sort this out.
Many thanks for brining this to our attention!
This is now:
The minpoly algorithm used depends on which method you are using from
LinBox of course but,
If you use the solution "minpoly" you will get the blackbox algorithm
(just like if you specify "minpoly(pol, mat, Method::Blackbox())")
then (since sept 2008 and 1.1.6) we will end up using an extension field
to compute the minpoly (on my machine it will be GF(3^10)) and then
I e.g. got the following result for one try (the algorithm is still
probabilistic, but has a much larger success rate, roughly around 1/3^10):
> 99993 minimal Polynomials are x^2 +x, 3 minimal polynomial are x+1, 4
minimal polynomials are x
Now for a so small matrix it could be better to use a dense version,
which can be called by "minpoly(pol,mat,Method::Elimination())".
If i am correct this dense version is also probabilistic (choice of the
Krylov non-zero vector) and therefore should also pick vectors from an
extension.
This is not the case in 1.1.6.
Clément can you confirm this ? If so it should be easy to fix, the same
way we fixed Wiedemann.
For your example matrix in some of the cases, when vectors [1,1], and
[2,2] are chosen the Krylov space has rank 1, whereas for other non zero
vectors it has rank 2 and
thus the dense minbpoly will be x^2+x or x+1 ...
btw, the returned polynomial is always a factor of the true polynomial,
therefore to get a 1/3^{10k} probability of success it will be
sufficient to perform the lcm of k runs.
Best,
--
Jean-Guillaume Dumas.
____________________________________________________________________
Jean-Guill...@imag.fr Tél.: +33 476 514 866
Université Joseph Fourier, Grenoble I. Fax.: +33 476 631 263
Laboratoire Jean Kuntzmann, Mathématiques Appliquées et Informatique
51, avenue des Mathématiques. LJK/IMAG - BP53. 38041 Grenoble FRANCE
http://ljk.imag.fr/membres/Jean-Guillaume.Dumas
____________________________________________________________________
Ouch. (In sage the default for *everything* is proof=True.) Is there any
easier way to prove correctness of the minpoly (this is a basic exact
linear algebra question)? At the least I could factor Pi_1 first
before substituting in A.
William
Therefore in practice, I am afraid that for small finite fields blas
based lcm of non extended minpoly's then blas based evaluation of Pi_1
at A might be the best for a large range of dense matrix sizes.
> At the least I could factor Pi_1 first
> before substituting in A.
>
yes good idea (and storing the lcm'ed components too might prove also
useful).
I missed this discussion.
So I confirm, that we are using the Krylov based dense minpoly that
returns a probabilistic minpoly, and I'm the one to blame for not taking
care of this.
So far, I don't know of any better certificate for minpoly than checking
Pmin(A) = 0 (improved by using the factors, as William pointed out).
I'm also thinking of Danilevskii's elimination: although it could be
viewed as a Krylov method, it does not use any randomization, so could
it always give the whole minpoly ?
As for the use of extensions, the dense method imposes restrictions on
the size of the field (in order to use the BLAS). So this might be a
severe limiting factor.
I'm willing to sort this pb out at Sage Days 16 next week.
Clément
Jean-Guillaume Dumas a écrit :
> I'm also thinking of Danilevskii's elimination: although it could be
> viewed as a Krylov method, it does not use any randomization, so could
> it always give the whole minpoly ?
I checked that this does not solve our pb: Danilevskii's alg is
deterministic for charpoly but still can choose bad vectors for minpoly.
A conter-example is
[1 1]
[0 1]
for which Danilevskii's alg implicitly uses the first column vector
[1]
[0]
which only produces the factor X-1 of the minpoly
Clément