AMLab-Amsterdam / lie_learn

Computations involving Lie groups and harmonic analysis
MIT License
190 stars 47 forks source link

Error in "pinchon_hoggan.make_c2b" #17

Closed Gabri95 closed 1 month ago

Gabri95 commented 4 years ago

Hi,

I incurred in an error with pinchon_hoggan.make_c2b.

Using Python 3.6 the code

import numpy as np
angles = np.random.randn(4, 2)
lie_learn.representations.SO3.pinchon_hoggan.pinchon_hoggan import make_c2b
make_c2b(np.asarray([1, 2, 3]))

gives the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "lie_learn/representations/SO3/pinchon_hoggan/pinchon_hoggan.pyx", line 247, in lie_learn.representations.SO3.pinchon_hoggan.pinchon_hoggan.make_c2b
TypeError: 'float' object cannot be interpreted as an integer

I guess it is because the variable k is converted to float at line 23 and so is 2 * k + 1, while the range function at line 247 expects an int.

Best, Gabriele