[SciPy-dev] Re: [Numpy-discussion] QR algorithms in Python

Pearu Peterson pearu at cens.ioc.ee
Mon Aug 12 04:04:49 EDT 2002


On Mon, 12 Aug 2002, James G Analytis wrote:

> Hi,
> I'm looking for a QR algorithm that can decompose complex matrices. The 
> LinearAlgebra package from Numeric doesn't seem to have it. SciPy's linalg 
> package is still on the way, so I can't use that either. 

Try SciPy's linalg package again (from CVS), the QR functions is working
now:

>>> from scipy import linalg
>>> from Numeric import dot
>>> q,r=linalg.qr([[1,2],[3j,4]])
>>> print q
[[-0.31622777+0.j         -0.78935222-0.52623481j]
 [ 0.        -0.9486833j  -0.1754116 +0.26311741j]]
>>> print r
[[-3.16227766+0.j         -0.63245553+3.79473319j]
 [ 0.        +0.j         -2.28035085+0.j        ]]
>>> print dot(q,r)
[[ 1. +0.00000000e+00j  2. -8.71264866e-16j]
 [ 0. +3.00000000e+00j  4. +3.09051829e-16j]]

Regards,
	Pearu





More information about the SciPy-Dev mailing list