[Numpy-discussion] invert() with complex arrays

Konrad Hinsen hinsen at cnrs-orleans.fr
Wed Aug 29 10:13:52 EDT 2001


> > > Is there any way to get invert() to work with complex arrays?
> > 
> > If you mean LinearAlgebra.inverse(), it should work with complex arrays,
> > although I haven't checked that for a long time.
>
> I tested a small matrix and got an error, but I will try again, since
> with my luck it was singular :)

No need to take chances:

   >>> from Numeric import *
   >>> from LinearAlgebra import inverse
   >>> a = 1.j*array([[1., 0.], [0., 1.]])
   >>> a
   array([[ 0.+1.j,  0.+0.j],
	  [ 0.+0.j,  0.+1.j]])
   >>> inverse(a)
   array([[ 0.-1.j,  0.+0.j],
	  [ 0.+0.j,  0.-1.j]])

So it works for at least one complex matrix. :-)

Konrad.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                            | E-Mail: hinsen at cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24
Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais
-------------------------------------------------------------------------------




More information about the NumPy-Discussion mailing list