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

Work around index-limiting bug in np.einsum #687

Merged
merged 2 commits into from
Jul 17, 2018
Merged

Conversation

Strilanc
Copy link
Contributor

@Strilanc Strilanc commented Jul 16, 2018

Fixes #683

Example that works now:

import cirq
c = cirq.Circuit.from_ops(cirq.H.on_each(cirq.LineQubit.range(13)))
c.to_unitary_matrix()

I like that you can nearly see the individual operations happening, in system monitor, by watching the memory usage:

image

- Just turn on optimize when 26 or more indices
@Strilanc Strilanc requested a review from dabacon July 16, 2018 23:05
@googlebot googlebot added the cla: yes Makes googlebot stop complaining. label Jul 16, 2018
@Strilanc Strilanc changed the title Work around index-limiting bug in np.eisnum Work around index-limiting bug in np.einsum Jul 16, 2018
@Strilanc Strilanc requested review from cduck and maffoo July 17, 2018 01:27
Copy link
Collaborator

@cduck cduck left a comment

Choose a reason for hiding this comment

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

LGTM. Do you have a test for these cases?

@Strilanc
Copy link
Contributor Author

No tests unfortunately; it's too expensive. By the time you have 26 indices you're doing 2^26 work per gate.

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.

3 participants