It seems that the fix for bug #2183 introduced a new bug causing eigenvectors() to miss some eigenvectors:
Maxima branch_5_37_base_17_gce242fd http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.12
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) M: matrix([1, 1, 0], [0, 1, 0], [0, 0, 2]);
[ 1 1 0 ]
[ ]
(%o1) [ 0 1 0 ]
[ ]
[ 0 0 2 ]
(%i2) eigenvectors(M);
(%o2) [[[1, 2], [2, 1]], [[[1, 0, 0]]]]
The eigenvector [0, 0, 1] is missing. After reverting commit dcd222b (I'm not suggesting this is the right fix), the correct output is given:
(%i2) eigenvectors(M);
(%o2) [[[1, 2], [2, 1]], [[[1, 0, 0]], [[0, 0, 1]]]]
I agree that the patch for bug #2183 seems to be the cause of the issue. As an experiment, I suggest eliminating (or commenting out) the line
and replacing it with the line
in the patched file "eigen.mac". In my limited testing, that change seemed to fix things for me.
This certainly looks like the correct fix to me. (I also checked that it fixes my example, but haven't done extensive tests.)
Re:
count:apply("+",multiplicities), I'm pretty sure that's incorrect. In the loop at line 121 in share/matrix/eigen.mac,index1is supposed to be an index for the eigenvalues and multiplicities, which are the same length. I'm pretty sure that it can't be right to assign anything other thanlength(multiplicities)(as it is at present).I have a different patch which I am working on. I'll try to update this report soon.
My suggestion of
count:apply("+",multiplicities)was based on a cursory examination of the code in the #2183 patch only. From the standpoint of not changing code that was in place prior to #2183, I believe my suggestion was correct. With that being said, my current thinking is that a better solution is to keepcount:length(multiplicities)and eliminatecount:mi(count-part(multiplicities,index1)+1)in line 122.Last edit: Mike 2016-05-18
Fixed by commit 3e4e107. Closing this report.