#2719 Matrix invert() behaviour

None
closed
nobody
None
5
2015-01-18
2014-04-10
Paul
No

Sometime after 5.29.1, the behaviour of invert() changed for the worse, as shown by the examples below. It is particularly bad when the elements of the matrix are complex. In my toy examples, the output is at least delivered, but for slightly more complicated matrices (e.g. 4x4 complex), the newer maxima hangs.

I have looked through the bug list and discussion list but (surprisingly) couldn't see any reference to a recent-ish problem with invert(), or complex numbers.

Perhaps this is not a bug, and the behaviour of invert() in the new maxima can be controlled to do what the old maxima did. If so, I am happy to be corrected. As it stands, I find all maximas from 5.30 onwards unusable.

[p: ~/cfiles/pdev/polcal/maxima]> maxima-5.29.1
Maxima 5.29.1 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.10 (a.k.a. GCL)
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) declare(u,complex)$
(%i2) declare(v,complex)$
(%i3) declare(w,complex)$
(%i4) declare(z,complex)$
(%i5) R: matrix([a,b],[c,d])$
(%i6) C: matrix([u,v],[w,z])$
(%i7) iR: invert(R);
                         [      d             b     ]
                         [  ---------   - --------- ]
                         [  a d - b c     a d - b c ]
(%o7)                    [                          ]
                         [       c           a      ]
                         [ - ---------   ---------  ]
                         [   a d - b c   a d - b c  ]
(%i8) iC: invert(C);
                         [      z             v     ]
                         [  ---------   - --------- ]
                         [  u z - v w     u z - v w ]
(%o8)                    [                          ]
                         [       w           u      ]
                         [ - ---------   ---------  ]
                         [   u z - v w   u z - v w  ]
(%i9)

[p: ~/cfiles/pdev/polcal/maxima]> maxima-5.33.0
Maxima 5.33.0 http://maxima.sourceforge.net
using Lisp GNU Common Lisp (GCL) GCL 2.6.10 (a.k.a. GCL)
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) declare(u,complex)$
(%i2) declare(v,complex)$
(%i3) declare(w,complex)$
(%i4) declare(z,complex)$
(%i5) R: matrix([a,b],[c,d])$
(%i6) C: matrix([u,v],[w,z])$
(%i7) iR: invert(R);
                      [     b c                        ]
                      [ ----------- + 1                ]
                      [        b c                     ]
                      [ a (d - ---)                    ]
                      [         a               b      ]
                      [ ---------------  - ----------- ]
                      [        a                  b c  ]
(%o7)                 [                    a (d - ---) ]
                      [                            a   ]
                      [                                ]
                      [         c              1       ]
                      [  - -----------      -------    ]
                      [           b c           b c    ]
                      [    a (d - ---)      d - ---    ]
                      [            a             a     ]
(%i8) iC: invert(C);
(%o8) matrix([(realpart(u) (1 - (realpart(v)
 (((realpart(u) imagpart(w) - imagpart(u) realpart(w))
 (- imagpart(z) + (imagpart(v) (realpart(u) realpart(w)
                                      2              2
 + imagpart(u) imagpart(w)))/(realpart (u) + imagpart (u))
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
          2              2
/(realpart (u) + imagpart (u)) - ((realpart(u) realpart(w)
 + imagpart(u) imagpart(w)) (realpart(z)
   realpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
          2              2
/(realpart (u) + imagpart (u))) - imagpart(v)
 (- ((realpart(u) imagpart(w) - imagpart(u) realpart(w))
 (realpart(z) - (realpart(v) (realpart(u) realpart(w)
                                      2              2
 + imagpart(u) imagpart(w)))/(realpart (u) + imagpart (u))
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
          2              2
/(realpart (u) + imagpart (u)) - ((realpart(u) realpart(w)
 + imagpart(u) imagpart(w)) (- imagpart(z)
   imagpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 + ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
          2              2
/(realpart (u) + imagpart (u))))/(expt(realpart(z)
   realpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------, 2)
                             2              2
                     realpart (u) + imagpart (u)
 + expt(imagpart(z)
   imagpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 - ---------------------------------------------------------------, 2)))
                             2              2
                     realpart (u) + imagpart (u)
 - (imagpart(u) (imagpart(v) (((realpart(u) imagpart(w)
 - imagpart(u) realpart(w)) (- imagpart(z)
   imagpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 + ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
          2              2
/(realpart (u) + imagpart (u)) - ((realpart(u) realpart(w)
 + imagpart(u) imagpart(w)) (realpart(z)
   realpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
          2              2
/(realpart (u) + imagpart (u))) + realpart(v)
 (- ((realpart(u) imagpart(w) - imagpart(u) realpart(w))
 (realpart(z) - (realpart(v) (realpart(u) realpart(w)
                                      2              2
 + imagpart(u) imagpart(w)))/(realpart (u) + imagpart (u))
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
          2              2
/(realpart (u) + imagpart (u)) - ((realpart(u) realpart(w)
 + imagpart(u) imagpart(w)) (- imagpart(z)
   imagpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 + ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
          2              2
/(realpart (u) + imagpart (u)))))/(expt(realpart(z)
   realpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------, 2)
                             2              2
                     realpart (u) + imagpart (u)
 + expt(imagpart(z)
   imagpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 - ---------------------------------------------------------------, 2)))
                             2              2
                     realpart (u) + imagpart (u)
          2              2
/(realpart (u) + imagpart (u)) + (%i (- imagpart(u)
 (1 - (realpart(v) (((realpart(u) imagpart(w) - imagpart(u) realpart(w))
 (- imagpart(z)
   imagpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 + ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
          2              2
/(realpart (u) + imagpart (u)) - ((realpart(u) realpart(w)
 + imagpart(u) imagpart(w)) (realpart(z)
   realpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
          2              2
/(realpart (u) + imagpart (u))) - imagpart(v)
 (- ((realpart(u) imagpart(w) - imagpart(u) realpart(w))
 (realpart(z) - (realpart(v) (realpart(u) realpart(w)
                                      2              2
 + imagpart(u) imagpart(w)))/(realpart (u) + imagpart (u))
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
          2              2
/(realpart (u) + imagpart (u)) - ((realpart(u) realpart(w)
 + imagpart(u) imagpart(w)) (- imagpart(z)
   imagpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 + ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
          2              2
/(realpart (u) + imagpart (u))))/(expt(realpart(z)
   realpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------, 2)
                             2              2
                     realpart (u) + imagpart (u)
 + expt(imagpart(z)
   imagpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 - ---------------------------------------------------------------, 2)))
                             2              2
                     realpart (u) + imagpart (u)
 - (realpart(u) (imagpart(v) (((realpart(u) imagpart(w)
 - imagpart(u) realpart(w)) (- imagpart(z)
   imagpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 + ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
          2              2
/(realpart (u) + imagpart (u)) - ((realpart(u) realpart(w)
 + imagpart(u) imagpart(w)) (realpart(z)
   realpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
          2              2
/(realpart (u) + imagpart (u))) + realpart(v)
 (- ((realpart(u) imagpart(w) - imagpart(u) realpart(w))
 (realpart(z) - (realpart(v) (realpart(u) realpart(w)
                                      2              2
 + imagpart(u) imagpart(w)))/(realpart (u) + imagpart (u))
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
          2              2
/(realpart (u) + imagpart (u)) - ((realpart(u) realpart(w)
 + imagpart(u) imagpart(w)) (- imagpart(z)
   imagpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 + ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
          2              2
/(realpart (u) + imagpart (u)))))/(expt(realpart(z)
   realpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------, 2)
                             2              2
                     realpart (u) + imagpart (u)
 + expt(imagpart(z)
   imagpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 - ---------------------------------------------------------------, 2))))
                             2              2
                     realpart (u) + imagpart (u)
          2              2
/(realpart (u) + imagpart (u)), (realpart(u)
 (imagpart(v) (- imagpart(z) + (imagpart(v)
 (realpart(u) realpart(w) + imagpart(u) imagpart(w)))
          2              2
/(realpart (u) + imagpart (u))
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------)
                             2              2
                     realpart (u) + imagpart (u)
 - realpart(v) (realpart(z)
   realpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
 + imagpart(u) (- imagpart(v) (realpart(z)
   realpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------)
                             2              2
                     realpart (u) + imagpart (u)
 - realpart(v) (- imagpart(z)
   imagpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 + ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------)))
                             2              2
                     realpart (u) + imagpart (u)
           2              2
/((realpart (u) + imagpart (u)) (expt(realpart(z)
   realpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------, 2)
                             2              2
                     realpart (u) + imagpart (u)
 + expt(imagpart(z)
   imagpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 - ---------------------------------------------------------------, 2)))
                             2              2
                     realpart (u) + imagpart (u)
 + (%i (realpart(u) (- imagpart(v) (realpart(z)
   realpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------)
                             2              2
                     realpart (u) + imagpart (u)
 - realpart(v) (- imagpart(z)
   imagpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 + ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
 - imagpart(u) (imagpart(v) (- imagpart(z)
   imagpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 + ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------)
                             2              2
                     realpart (u) + imagpart (u)
 - realpart(v) (realpart(z)
   realpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))))
                             2              2
                     realpart (u) + imagpart (u)
           2              2
/((realpart (u) + imagpart (u)) (expt(realpart(z)
   realpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------, 2)
                             2              2
                     realpart (u) + imagpart (u)
 + expt(imagpart(z)
   imagpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 - ---------------------------------------------------------------, 2)))], 
                             2              2
                     realpart (u) + imagpart (u)
[(((realpart(u) imagpart(w) - imagpart(u) realpart(w))
 (- imagpart(z) + (imagpart(v) (realpart(u) realpart(w)
                                      2              2
 + imagpart(u) imagpart(w)))/(realpart (u) + imagpart (u))
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
          2              2
/(realpart (u) + imagpart (u)) - ((realpart(u) realpart(w)
 + imagpart(u) imagpart(w)) (realpart(z)
   realpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
          2              2
/(realpart (u) + imagpart (u)))/(expt(realpart(z)
   realpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------, 2)
                             2              2
                     realpart (u) + imagpart (u)
 + expt(imagpart(z)
   imagpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 - ---------------------------------------------------------------, 2))
                             2              2
                     realpart (u) + imagpart (u)
 + (%i (- ((realpart(u) imagpart(w) - imagpart(u) realpart(w))
 (realpart(z) - (realpart(v) (realpart(u) realpart(w)
                                      2              2
 + imagpart(u) imagpart(w)))/(realpart (u) + imagpart (u))
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
          2              2
/(realpart (u) + imagpart (u)) - ((realpart(u) realpart(w)
 + imagpart(u) imagpart(w)) (- imagpart(z)
   imagpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 + ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
          2              2
/(realpart (u) + imagpart (u))))/(expt(realpart(z)
   realpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------, 2)
                             2              2
                     realpart (u) + imagpart (u)
 + expt(imagpart(z)
   imagpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 - ---------------------------------------------------------------, 2)), 
                             2              2
                     realpart (u) + imagpart (u)
               realpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
(realpart(z) - ---------------------------------------------------------------
                                         2              2
                                 realpart (u) + imagpart (u)
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------)
                             2              2
                     realpart (u) + imagpart (u)
/(expt(realpart(z)
   realpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------, 2)
                             2              2
                     realpart (u) + imagpart (u)
 + expt(imagpart(z)
   imagpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 - ---------------------------------------------------------------, 2))
                             2              2
                     realpart (u) + imagpart (u)
 - (%i (imagpart(z)
   imagpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 - ---------------------------------------------------------------))
                             2              2
                     realpart (u) + imagpart (u)
/(expt(realpart(z)
   realpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   imagpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 + ---------------------------------------------------------------, 2)
                             2              2
                     realpart (u) + imagpart (u)
 + expt(imagpart(z)
   imagpart(v) (realpart(u) realpart(w) + imagpart(u) imagpart(w))
 - ---------------------------------------------------------------
                             2              2
                     realpart (u) + imagpart (u)
   realpart(v) (realpart(u) imagpart(w) - imagpart(u) realpart(w))
 - ---------------------------------------------------------------, 2))])
                             2              2
                     realpart (u) + imagpart (u)
(%i9)

N.B. The release notes for 5.30.0 do not inspire confidence:

Maxima 5.30 change log
...
* package linearalgebra(??): revise mat_function
* ??: revise functions jordan, JF, diag
...
Bug fixes:
...
2528: imagpart etc. wrong when var declared real and complex
...

Discussion

  • Paul
    Paul
    2014-04-13

    I now see that this post in the discussion forum is relevant.

    I will try load(invert); and report back.

     
  • Paul
    Paul
    2014-04-17

    Ok, load(invert); solves the problem.

    I will leave this as an open bug, because the default behaviour is still broken.

     
  • Barton Willis
    Barton Willis
    2014-06-03

    Fixed by commit 707110a2b8e172cc20213b5c223b7f62364e1de2 :

    %i6) invert(matrix([a,b],[c,d]));

    (%o6) matrix([(bc/(a(d-bc/a))+1)/a,-b/(a(d-b*c/a))],
    [-c/(a(d-bc/a)),1/(d-b*c/a)])
    (%i7) invert(matrix([u,v],[w,x]));

    (%o7) matrix([(vw/(u(x-vw/u))+1)/u,-v/(u(x-v*w/u))],
    [-w/(u(x-vw/u)),1/(x-v*w/u)])

     
  • Barton Willis
    Barton Willis
    2014-06-03

    • status: open --> closed