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

Unary iteration: nth_operation_callgraph for more subclasses #844

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mpharrigan
Copy link
Collaborator

This speeds up gate counting from a couple seconds to a couple hundred milliseconds on the hubbard model example.

Comment on lines +109 to +111
def nth_operation_callgraph(self, **selection_regs_name_to_val) -> Set['BloqCountT']:
selection_idx = tuple(selection_regs_name_to_val[reg.name] for reg in self.selection_regs)
return {(_cirq_gate_to_bloq(self.nth_gate(*selection_idx)), 1)}
Copy link
Collaborator

Choose a reason for hiding this comment

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

The self.target_gate and self.nth_gate should be controlled gates here and below.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this would be a good opportunity to revisit these gates, use the new controlled infrastructure, create a bloq example and fix whatever is failing.

@mpharrigan
Copy link
Collaborator Author

This is a proof of principle for investigating #825. I'll make as draft and "contributions welcome" if someone wants to take this on fully

@mpharrigan
Copy link
Collaborator Author

Has this been done?

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

Successfully merging this pull request may close these issues.

2 participants