# [Maxima] matrix 2-norm and associated matrix condition number

Barton Willis willisb at unk.edu
Thu Apr 26 12:11:06 CDT 2007

```No, Maxima doesn't have an alternative to your function. Suggestions:

(1) replace transpose(A).A  with transpose(conjugate(A).A.

(2) replace sort with lmax.  The sort function sorts explicit numbers
(things like 1.3 and 2/3) from least to greatest (I think), but it
doesn't sort things like sqrt(3), %pi, 42... from least to greatest.
So your sort function may return the wrong eigenvalue.

For matrices larger that 3 x 3, it's unlikely that your function will
work.  If you are interested in floating point, maybe you could
use eigens_by_jacobi. Also, there is a recently added function (not
sure of its name) for numerical eigenvalue problems that should be
faster than eigens_by_jacobi.

Barton

maxima-bounces at math.utexas.edu wrote on 04/26/2007 10:39:00 AM:

> Dear experts,
>
> AFAIK maxima currently has no matrix 2-norm and no matrix condition
> number based on
> 2-norm.
> In teaching the 2-norm/2-condition sometimes matters.
>
> So I wrote simple beginners implementations of both concepts:
>
> load("linearalgebra");
>
> mat_norm2(A) := sqrt(last(sort(eigenvalues(transpose(A).A)[1])));
> mat_norm2(matrix([3,-1],[-1,3]));  --> 4
>
>
> mat_cond2(A) := mat_norm2(invert(A))*mat_norm2(A)\$
> mat_cond2(matrix([3,-1],[-1,3]));  --> 2
>
> It works for me (and for some little tests), but I wonder if someone
> has written
> 'alternative' Maxima functions using other or better math or maxima
concepts.
> Any hints are very welcome.
>
> --
> HTH  Wolfgang
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
```

More information about the Maxima mailing list