Issue 229 in mpmath: Determinant and inverse calculation is wrong

3 views
Skip to first unread message

mpm...@googlecode.com

unread,
Aug 18, 2012, 12:34:45 AM8/18/12
to mpmath...@googlegroups.com
Status: New
Owner: ----

New issue 229 by Sameer.G...@gmail.com: Determinant and inverse calculation
is wrong
http://code.google.com/p/mpmath/issues/detail?id=229

I have a complex 2X2 matrix for which I'd like to calculate the
determinant. mpmath's det function gives a determinant of zero even though
the matrix is non-singular. We can get the correct value by multiplying
term-by-term.

What steps will reproduce the problem?
#========================
from __future__ import division
import numpy as np
import sympy.mpmath as mpmath

m3 = np.matrix([[ 5.18895807e-12 +0.00000000e+00j,
1.92716917e+11 +0.00000000e+00j],
[ 0.00000000e+00 -1.93643371e-11j,
0.00000000e+00 -5.16413237e+10j]])
m = mpmath.matrix(m3)
print np.linalg.det(m3)
print mpmath.det(m)
print m[0,0]*m[1,1]- m[1,0]*m[0,1]
#========================


What is the expected output? What do you see instead?

The output is :
3.4638706823j
0
(0.0 + 3.46387068230212j)

Expected output:
3.4638706823j
(0.0 + 3.46387068230212j)
(0.0 + 3.46387068230212j)

What version of the product are you using? On what operating system?
0.17, ubuntu

Please provide any additional information below.

The same problem occurs when trying to calculate the inverse of the matrix.



Reply all
Reply to author
Forward
0 new messages