Skip to content

Conversation

tanujkhattar
Copy link
Collaborator

Fixes #5967

@tanujkhattar tanujkhattar requested review from a team, cduck and vtomole as code owners June 21, 2023 20:01
@tanujkhattar tanujkhattar requested a review from maffoo June 21, 2023 20:01
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Contributor

@maffoo maffoo left a 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?

"\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",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change?

Copy link
Collaborator Author

@tanujkhattar tanujkhattar Jun 21, 2023

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",

@tanujkhattar
Copy link
Collaborator Author

@maffoo proper_repr was updated as part of #5991 to produce valid reprs for numpy 1.24

@CirqBot CirqBot added the Size: XS <10 lines changed label Jun 22, 2023
@tanujkhattar tanujkhattar enabled auto-merge (squash) June 22, 2023 21:08
@tanujkhattar tanujkhattar merged commit 6c251a3 into quantumlib:master Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Size: XS <10 lines changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Numpy 1.24 breaks master.
4 participants