tequilahub / tequila

A High-Level Abstraction Framework for Quantum Algorithms
MIT License
362 stars 101 forks source link

Fix NumPy float and int #301

Closed erikkjellgren closed 1 year ago

erikkjellgren commented 1 year ago

np.float and np.int does not exist in NumPy anymore.

Code changed to use np.float64 and np.int64.

kottmanj commented 1 year ago

Hi Erik, thanks for contributing! Looks like we forgot some of the np.floats in #287 In order to avoid circular PRs that change the types. Would changing from np.float to just float (instead of np.float64) also suffice? Just to stay consistent with the rest.

erikkjellgren commented 1 year ago

Yes, using float should be fine. Doing dtype=float gives exactly the same as doing dtype=np.float64

kottmanj commented 1 year ago

Perfect! Could you change it in the PR here? Then I can just merge this one.

erikkjellgren commented 1 year ago

I have already pushed the changes.

A little unrelated note. In src/tequila/optimizers/optimizer_phoenics.py line 93 the type used is np.float32, I think this is the only place in the entire Tequila code that np.float32 is used, this could be a typo.

kottmanj commented 1 year ago

True. Thanks for noticing!