# Why can't I find exponential of a "complex256" matrix?  The following script gives me a error - ValueError: invalid type: complex256. However, this works with complex128. Is there a way to make expm work with complex256?

import scipy
a=scipy.matrix([[1,0],[0,1]],dtype='complex256')
scipy.linalg.expm(a)

edit retag close merge delete

Sort by » oldest newest most voted

This is really not a Sage question...

Nonetheless, a quick glance at the source reveals that it just isn't implemented.

if A.dtype == 'float64' or A.dtype == 'complex128':
if A_L1 < 1.495585217958292e-002:
elif A_L1 < 2.539398330063230e-001:
elif A_L1 < 9.504178996162932e-001:
elif A_L1 < 2.097847961257068e+000:
else:
maxnorm = 5.371920351148152
n_squarings = max(0, int(ceil(log2(A_L1 / maxnorm))))
A = A / 2**n_squarings
elif A.dtype == 'float32' or A.dtype == 'complex64':
if A_L1 < 4.258730016922831e-001:
elif A_L1 < 1.880152677804762e+000:
else:
maxnorm = 3.925724783138660
n_squarings = max(0, int(ceil(log2(A_L1 / maxnorm))))
A = A / 2**n_squarings
else:
raise ValueError("invalid type: "+str(A.dtype))

more