-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Conversation
There was a problem hiding this 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.
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]) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
No description provided.