Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a bug in computing the inverse of the matrix #3249

Closed
pdenapo mannequin opened this issue May 17, 2008 · 3 comments
Closed

a bug in computing the inverse of the matrix #3249

pdenapo mannequin opened this issue May 17, 2008 · 3 comments

Comments

@pdenapo
Copy link
Mannequin

pdenapo mannequin commented May 17, 2008

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'

Component: linear algebra

Issue created by migration from https://trac.sagemath.org/ticket/3249

@pdenapo pdenapo mannequin assigned williamstein May 17, 2008
@sagetrac-mabshoff sagetrac-mabshoff mannequin added this to the sage-3.0.2 milestone May 18, 2008
@pdenapo
Copy link
Mannequin Author

pdenapo mannequin commented May 19, 2008

comment:2

Note that there are two different problems here.

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

@pdenapo
Copy link
Mannequin Author

pdenapo mannequin commented May 21, 2008

comment:3

See also #2256 (same problem)

@pdenapo
Copy link
Mannequin Author

pdenapo mannequin commented May 27, 2008

comment:4

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant