Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

mpmath matrix commands integers sage vs python

I import mpmath into sage by

import mpmath as mp

then I try to create an identity matrix by

mp.eye(3)

but this does not work, it raises the error

TypeError: could not interpret given arguments

rather I have to tell mpmath that indeed 3 is an integer, so

mp.eye(int(3))

does work. Also raising mpmath matrix M to a power has the same problem

M^3

does not work. Again I have to do

M^(int(3))

why is this the case? can that be circumvented somehow? ("eye(3)" does work in python)