Menu

#4763 invert(matrix([1])), scalarmatrixp:all causes Lisp error

None
open
nobody
5
2026-06-10
2026-06-10
No
(%i1) invert(matrix([1])), scalarmatrixp:all;

Maxima encountered a Lisp error:

 The value
   1
 is not of type
   LIST

Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.

Discussion

  • David Scherfgen

    David Scherfgen - 2026-06-10
    • status: open --> not-a-bug
     
  • David Scherfgen

    David Scherfgen - 2026-06-10

    Oops, matrix([1]) becomes 1, so it's calling invert(1).

     
  • Stavros Macrakis

    • status: not-a-bug --> open
     
  • Stavros Macrakis

    Even though invert(matrix([1])), scalarmatrixp:all simplifies to 1, this is still a bug because Maxima functions should never give Lisp errors.

    Arguably, too, if scalarmatrixp is simplifying the matrix to a scalar, then invert(x) should return 1/x for a scalar x to be consistent.

    Also, the definition of invert says "invert(<M>) is equivalent to <M>^^-1", and x^^-1 => 1/x for scalar x. I suppose you could argue that the definition is restricted to matrices M, but I think that's quibbling.

     

    Last edit: Stavros Macrakis 2026-06-10

Log in to post a comment.

Auth0 Logo