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

Make expm work for more data types #3051

Closed
kcrisman opened this issue Nov 10, 2013 · 3 comments
Closed

Make expm work for more data types #3051

kcrisman opened this issue Nov 10, 2013 · 3 comments
Labels

Comments

@kcrisman
Copy link

This originally came up at this ask.sagemath question.

import scipy 
a=scipy.matrix([[1,0],[0,1]],dtype='complex256')
scipy.linalg.expm(a)
<snip>
ValueError: invalid type: complex256

And indeed the code only allows float64, float32, complex64, or complex128.

This is an enhancement request, since presumably the numerical analysis needed to correctly deal with this is nontrivial!

@argriffing
Copy link
Contributor

Ignoring the numerical analysis I would have guessed that this might work for the newer expm, but I guess not.
TypeError: unsupported operand type(s) for *: 'numpy.float128' and 'long'
I'm not sure what that error means. Can we not multiply numpy float128 and python integers together?

@argriffing
Copy link
Contributor

I want to say that this is a numpy problem.

>>> np.__version__
'1.7.1'
>>> np.array(42, dtype='float128') * long(42)
1764.0
>>> np.array(42, dtype='float128') * 1000111000111000111000111
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for *: 'numpy.float128' and 'long'

I think the float128 is still exotic and not completely supported by numpy in the same way that the smaller data types are supported. For example see this 2011 mailing list post. I'm not sure how many if any of those problems have been fixed in the numpy development version.

@rgommers
Copy link
Member

Same for float96. So close this issue and open a numpy one?

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

No branches or pull requests

3 participants