3

The below matrix matrix is clearly invertible modulo 3.

But Maxima returns false when I try to obtain its inverse.

0 1
1 1

What is wrong here?

 M: matrix([0,1],[1,1]);

 zn_invert_by_lu(M,3 );

According to doc:

zn_invert_by_lu (matrix, p)

Uses the technique of LU-decomposition to compute the modular inverse of matrix over (Z/pZ). p must be a prime and matrix invertible. zn_invert_by_lu returns false if matrix is not invertible.

Name
  • 339
  • 2
  • 18
  • 2
    Thanks for reporting the problem. This is a bug in the LU decomposition code. I'm investigating it. My first guess is that the code makes an assumption which is false for modular arithmetic, but I'll keep looking to see exactly what it is. One thing is that the permutation matrix appears to be incorrect; something else for me to look at. – Robert Dodier Aug 02 '21 at 16:38
  • 1
    RobertDodier: Thank you for maintaining Maxima, your efforts is a great service to the scientific community. – Name Aug 02 '21 at 18:23
  • 1
    The bug you reported has been fixed by Volker van Nek. A somewhat related bug was fixed by yours truly and I created some test cases for zn_determinant and zn_invert_by_lu. These changes are in Git now and will be included in the next (5.46) release. – Robert Dodier Aug 09 '21 at 06:12

0 Answers0