QR algorithms in Python

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. Matfunc's QR decomposition only works for real matrices. This problem came up two years ago on this same discussion panel, and Konrad Hinsen recommended that the user download PyLapack from ftp://dirac.cnrs-orleans.fr/pub/ I cannot compile PyLapack because I get this problem: [analytis@toomey Modules]$ python2 compile.py Copy Misc/Makefile.pre.in from the Python distribution to this directory and try again. make: Makefile.pre.in: No such file or directory make: *** No rule to make target `Makefile.pre.in'. Stop. make: *** No targets specified and no makefile found. Stop. [analytis@toomey Modules]$ I think the Makefile searched for is one from an earlier version of Numeric (the tar file is 2yrs old). Any suggestions? Cheers, James

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

import scipy exceptions.ImportError: /usr/lib/python2.2/site-packages/scipy/linalg/flapack.so : undefined symbol: sgesdd_ exceptions.ImportError: /usr/lib/python2.2/site-packages/scipy/linalg/_flinalg.s o: undefined symbol: dlaswp_ Traceback (most recent call last): File "<stdin>", line 1, in ? File "/tmp/SciPyTest/linux2/lib/python2.2/site-packages/scipy/__init__.py",
Dear Pearu, SciPy's linalg modules are just what I need. However, I get the following problem on importing SciPy: [analytis@toomey analytis]$ python2 Python 2.2 (#1, Apr 12 2002, 15:29:57) [GCC 2.96 20000731 (Red Hat Linux 7.2 2.96-109)] on linux2 Type "help", "copyright", "credits" or "license" for more information. li ne 42, in ? File "/usr/lib/python2.2/site-packages/scipy/special/__init__.py", line 328, i n ? import orthogonal File "/usr/lib/python2.2/site-packages/scipy/special/orthogonal.py", line 59, in ? from scipy.linalg import eig File "/tmp/SciPyTest/linux2/lib/python2.2/site-packages/scipy/linalg/__init__. py", line 40, in ? File "/tmp/SciPyTest/linux2/lib/python2.2/site-packages/scipy/linalg/basic.py" , line 17, in ? ImportError: /usr/lib/python2.2/site-packages/scipy/linalg/calc_lwork.so: undefi ned symbol: ieeeck_
I am running standard Red Hat 7.3 with a smp kernel, on a dual-processor PIII. Is there anything I should watch out for (compiler issues perhaps)? I appreciate the help! Cheers, James On Monday 12 Aug 2002 9:04 am, Pearu Peterson wrote:
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

James G Analytis schrieb:
Dear Pearu, SciPy's linalg modules are just what I need. However, I get the following problem on importing SciPy:
ATLAS is also required. http://math-atlas.sourceforge.net/ Nils
import scipy exceptions.ImportError: /usr/lib/python2.2/site-packages/scipy/linalg/flapack.so : undefined symbol: sgesdd_ exceptions.ImportError: /usr/lib/python2.2/site-packages/scipy/linalg/_flinalg.s o: undefined symbol: dlaswp_ Traceback (most recent call last): File "<stdin>", line 1, in ? File "/tmp/SciPyTest/linux2/lib/python2.2/site-packages/scipy/__init__.py",
[analytis@toomey analytis]$ python2 Python 2.2 (#1, Apr 12 2002, 15:29:57) [GCC 2.96 20000731 (Red Hat Linux 7.2 2.96-109)] on linux2 Type "help", "copyright", "credits" or "license" for more information. li ne 42, in ? File "/usr/lib/python2.2/site-packages/scipy/special/__init__.py", line 328, i n ? import orthogonal File "/usr/lib/python2.2/site-packages/scipy/special/orthogonal.py", line 59, in ? from scipy.linalg import eig File "/tmp/SciPyTest/linux2/lib/python2.2/site-packages/scipy/linalg/__init__. py", line 40, in ? File "/tmp/SciPyTest/linux2/lib/python2.2/site-packages/scipy/linalg/basic.py" , line 17, in ? ImportError: /usr/lib/python2.2/site-packages/scipy/linalg/calc_lwork.so: undefi ned symbol: ieeeck_
I am running standard Red Hat 7.3 with a smp kernel, on a dual-processor PIII. Is there anything I should watch out for (compiler issues perhaps)? I appreciate the help! Cheers, James
On Monday 12 Aug 2002 9:04 am, Pearu Peterson wrote:
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
------------------------------------------------------- This sf.net email is sponsored by: Dice - The leading online job board for high-tech professionals. Search and apply for tech jobs today! http://seeker.dice.com/seeker.epl?rel_code1 _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion

James G Analytis <james.analytis@physics.ox.ac.uk> writes:
I cannot compile PyLapack because I get this problem:
[analytis@toomey Modules]$ python2 compile.py Copy Misc/Makefile.pre.in from the Python distribution to this directory and try again. make: Makefile.pre.in: No such file or directory
The old module compilation procedure via Makefile.pre.in does not exist any more in Python 2.2. If and when I find the time, I'll write a distutils script for PyLapack. Konrad. -- ------------------------------------------------------------------------------- Konrad Hinsen | E-Mail: hinsen@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 -------------------------------------------------------------------------------
participants (4)
-
James G Analytis
-
Konrad Hinsen
-
Nils Wagner
-
Pearu Peterson