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

VisibleDeprecationWarning from numpy #7

Open
johnzl-777 opened this issue Dec 15, 2021 · 1 comment
Open

VisibleDeprecationWarning from numpy #7

johnzl-777 opened this issue Dec 15, 2021 · 1 comment

Comments

@johnzl-777
Copy link

Note: this is somewhat of a preemptive issue, assuming that the edits from #6 go through

Running:

>>> prog = sf.Program(2)
>>> with prog.context as q:
...     Fock(2) | q[1]
...     BoseHubbardPropagation(H, 1.086, 20) | q

from the Bose Hubbard Demo in the documentation will emit the following warning with numpy v1.21.4

auxillary.py:153: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.

I imagine (naively) that the fix involves inserting that dtype=object argument to the two np.array() calls on line 153:

ladders = np.array(list(np.array(group_list, dtype=object)[:, 1]), dtype=object)[:, :, 1]
@thisac
Copy link

thisac commented Jan 27, 2022

Thanks for bringing this issue to our attention @johnzl-777! We will look into the PR that you've opened and get back to you soon.

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