Opened 13 years ago

Closed 13 years ago

#3249 closed defect (duplicate)

a bug in computing the inverse of the matrix

Reported by: pdenapo Owned by: was
Priority: major Milestone: sage-3.0.3
Component: linear algebra Keywords:
Cc: Merged in:
Authors: Reviewers:
Report Upstream: Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

I was doing the following, when testing the jordan_form method...

sage: A=Matrix(ComplexField(200),[[1,-2],[2,-1]])
sage: jordan=A.jordan_form(transformation=True,subdivide=False)
sage: P=jordan[1]

(P is now the transformation matrix, jordan[1] is the jordan canonical form)

sage: det(P)
1.7320508075688772935274463415058723669428052538103806280558*I

so clearly the matrix P has non zero determinant, as it should, however...

sage: P.inverse()
---------------------------------------------------------------------------
<type 'exceptions.ZeroDivisionError'>     Traceback (most recent call last)

/media/hda2/pablo.new_home/sage/sage-2.10.2/<ipython console> in <module>()

/media/hda2/pablo.new_home/sage/sage-2.10.2/matrix2.pyx in sage.matrix.matrix2.Matrix.inverse (sage/matrix/matrix2.c:19571)()

/media/hda2/pablo.new_home/sage/sage-2.10.2/matrix0.pyx in sage.matrix.matrix0.Matrix.__invert__ (sage/matrix/matrix0.c:12213)()

<type 'exceptions.ZeroDivisionError'>: self is not invertible

The most strange thing is that things depends strongly on the precision used for the complex field...the same computation using 20 bits of precision gives

sage:  A=Matrix(ComplexField(20),[[1,-2],[2,-1]])
sage: jordan=B.jordan_form(transformation=True,subdivide=False)
---------------------------------------------------------------------------
<type 'exceptions.AttributeError'>        Traceback (most recent call last)

/media/hda2/pablo.new_home/sage/sage-2.10.2/<ipython console> in <module>()

/media/hda2/pablo.new_home/sage/sage-2.10.2/matrix2.pyx in sage.matrix.matrix2.Matrix.jordan_form (sage/matrix/matrix2.c:20606)()

<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'is_exact'

Change History (4)

comment:1 Changed 13 years ago by mabshoff

  • Milestone set to sage-3.0.2

comment:2 Changed 13 years ago by pdenapo

Note that there are two different problems here.

The first one seems to be similar to bugs #1132,#3166

comment:3 Changed 13 years ago by pdenapo

See also #2256 (same problem)

comment:4 Changed 13 years ago by pdenapo

  • Resolution set to duplicate
  • Status changed from new to closed

The second issue reported here is fixed by my patch in #3316

Note: See TracTickets for help on using tickets.