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

TypeError: unsupported operand type(s) for /: 'float' and 'Bicomplex' #39

Closed
bacalfa opened this issue Jun 29, 2018 · 3 comments
Closed

Comments

@bacalfa
Copy link

bacalfa commented Jun 29, 2018

The following gives an error:

import numpy as np
import numdifftools as nd

g = lambda x: 1.0/(np.exp(x[0]) + np.cos(x[1]) + 10)

print(nd.Gradient(g, method="multicomplex")([1.0, 2.0]))

If I change the method to "complex", it works fine. Is there a way to use the multicomplex method in this situation and other similar ones?

@pbrod
Copy link
Owner

pbrod commented Jun 29, 2018

I don't get this error:

Python 2.7.14 |Anaconda custom (64-bit)| (default, Oct 15 2017, 03:34:40) [MSC v.1500 64 bit (AMD64)]

In [10]: nd.Gradient(g, method="multicomplex")([1.0, 2.0]) 
Out[10]: array([-0.01796112,  0.00600821])

What version of numdifftools and python are you using?

@bacalfa
Copy link
Author

bacalfa commented Jun 29, 2018

I'm on Windows 7 64-bit.

Python 3.6.5 :: Anaconda custom (64-bit)

numdifftools=0.9.20=py_0

pbrod added a commit that referenced this issue Feb 26, 2020
@pbrod
Copy link
Owner

pbrod commented Feb 26, 2020

Fixed in commit [481caaf] (481caaf).

Closing.

@pbrod pbrod closed this as completed Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants