Skip to content

Conversation

@smitsanghavi
Copy link
Collaborator

Not doing this caused an issue where the JSON was parsed without issue but when using the object, certain methods would break since they expected an np.array and got a list.

Example: #3645 (comment)

Dynamic typing strikes again!

@smitsanghavi smitsanghavi requested review from a team, cduck and vtomole as code owners January 15, 2021 02:09
@google-cla google-cla bot added the cla: yes Makes googlebot stop complaining. label Jan 15, 2021
@balopat balopat added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jan 15, 2021
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jan 15, 2021
@CirqBot CirqBot merged commit dd96690 into quantumlib:master Jan 15, 2021
@CirqBot CirqBot removed automerge Tells CirqBot to sync and merge this PR. (If it's running.) front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. labels Jan 15, 2021
copy.gamma = gamma.copy()
copy.v = v.copy()
copy.s = s.copy()
copy.G = np.array(G.copy())
Copy link
Collaborator

Choose a reason for hiding this comment

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

You can remove the copy. This can be just np.array(G) which copies by default. [otherwise, you should be using np.asarray, which doesn't copy]

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks, I'll send out a follow up PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Makes googlebot stop complaining.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants