-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Remove numpy<1.24 restriction from requirements.txt #6149
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
Remove numpy<1.24 restriction from requirements.txt #6149
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to update, but do we want to change proper_repr
so that it produces valid reprs with the new numpy version?
"input_states = [(a, b, 0) for a, b in itertools.product([0, 1], repeat=2)]\n", | ||
"output_states = [(a, b, a & b) for a, b, _ in input_states]\n", | ||
"\n", | ||
"\n", | ||
"for inp, out in zip(input_states, output_states):\n", | ||
" result = cirq.Simulator().simulate(c2, initial_state=inp)\n", | ||
" result = cirq.Simulator(dtype=np.complex128).simulate(c2, initial_state=inp)\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thet test started failing for Windows because of precision issues. I didn't dig very deep on whether it's something related to the new release or whether the test was flaky in the first place (probably more likely) so I just increased the precision and it seems to work fine.
The relevant statements in the cell below, that depend on the precision, are:
"inds, = np.where(abs(result.final_state_vector) > 1e-8)\n",
"assert len(inds) == 1\n",
Fixes #5967