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

Adds functionality for viewing and debugging swap networks #1821

Merged
merged 14 commits into from
Jul 17, 2019

Conversation

bryano
Copy link
Collaborator

@bryano bryano commented Jul 16, 2019

No description provided.

@googlebot googlebot added the cla: yes Makes googlebot stop complaining. label Jul 16, 2019
@bryano bryano requested a review from Strilanc July 16, 2019 18:55
Copy link
Contributor

@Strilanc Strilanc left a comment

Choose a reason for hiding this comment

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

This PR could use a better title.

The code LGTM with a few nits.

cirq/contrib/acquaintance/permutation.py Show resolved Hide resolved
cirq/contrib/acquaintance/permutation.py Outdated Show resolved Hide resolved
cirq/contrib/acquaintance/permutation.py Show resolved Hide resolved
@bryano bryano changed the title added permutation utils Adds functionality for viewing and debugging swap networks Jul 16, 2019
def uses_consistent_swap_gate(circuit: circuits.Circuit,
swap_gate: ops.Gate) -> bool:
for op in circuit.all_operations():
gate = ops.op_gate_of_type(op, Type[PermutationGate])
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Any thoughts on how to do the typing here? Mypy doesn't like instantiating a typevar with an abstract class.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I reverted so the tests pass, but if you see a way to use op_gate_of_type that mypy finds acceptable, let me know.

@Strilanc Strilanc added the automerge Tells CirqBot to sync and merge this PR. (If it's running.) label Jul 17, 2019
@CirqBot CirqBot added the front_of_queue_automerge CirqBot uses this label to indicate (and remember) what's being merged next. label Jul 17, 2019
@CirqBot CirqBot merged commit 0165f5c into quantumlib:master Jul 17, 2019
@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 Jul 17, 2019
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.

None yet

4 participants