convert sage complex matrix into numpy matrix
asked 2013-05-06 13:45:13 -0500
This post is a wiki. Anyone with karma >750 is welcome to improve it.
I want to convert a sage matrix with complex elements to a numpy (scipy) matrix. Then I want to manipulate the resulting matrix with commands from linalg.
I have some problem. For example consider the following lines
m=matrix([[I,2],[3,4]]) import numpy npm=numpy.array(m) from numpy import linalg linalg.eig(npm)
the result is an error:
... TypeError: function not supported for these types, and can't coerce safely to supported types
why does it not work?
('Sage Version 5.8, Release Date: 2013-03-15' on osx 10.6.8)