Status: Accepted
Owner: jochen.voss
Labels: Type-Defect Priority-Medium

New issue 1421 by jochen.voss: QRdecomposition fails for some matrices
http://code.google.com/p/sympy/issues/detail?id=1421

Hello,

on the current git version of sympy I got a strange failure of the
Matrix.QRdecomposition method:

===========================================================================
In [1]: A = Matrix([[1,1],[1,1.01]])

In [2]: A.QRdecomposition()
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)

/Users/voss/sympy/<ipython console> in <module>()

/Users/voss/sympy/sympy/matrices/matrices.py in QRdecomposition(self)
     966             R[j,j] = tmp.norm()
     967             Q[:,j] = tmp / R[j,j]
--> 968             assert Q[:,j].norm() == 1
     969             for i in range(j):
     970                 R[i,j] = Q[:,i].dot(self[:,j])

AssertionError:
===========================================================================

This seems not to be a problem with the conditioning of A, since it works
in the following case (which has a worse conditioning):

===========================================================================
In [3]: A = Matrix([[1,1],[1,1.001]])

In [4]: A.QRdecomposition()
Out[4]:
⎛⎡  ⎽⎽⎽                    ⎤                              ⎞
⎜⎢╲╱ 2                     ⎥  ⎡  ⎽⎽⎽              ⎽⎽⎽    ⎤⎟
⎜⎢─────  -0.707106781186548⎥, ⎢╲╱ 2      1.0005⋅╲╱ 2     ⎥⎟
⎜⎢  2                      ⎥  ⎢                          ⎥⎟
⎜⎢                         ⎥  ⎣  0    0.00070710678118647⎦⎟
⎜⎢  ⎽⎽⎽                    ⎥                              ⎟
⎜⎢╲╱ 2                     ⎥                              ⎟
⎜⎢─────  0.707106781186548 ⎥                              ⎟
⎝⎣  2                      ⎦                              ⎠
===========================================================================

I hope this helps,
Jochen

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to