-
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
[cirqflow] Hardcoded qubit placement #5194
[cirqflow] Hardcoded qubit placement #5194
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
cf5e14f
to
051733c
Compare
051733c
to
284cbb7
Compare
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.
Looking good overall. Left a first round of comments.
def draw_placements( | ||
big_graph: nx.Graph, | ||
small_graph: nx.Graph, | ||
small_to_big_mappings: Sequence[Dict], | ||
max_plots: int = 20, | ||
axes: Sequence[plt.Axes] = None, | ||
tilted=True, | ||
bad_placement_callback=None, |
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.
nit: Add type annotation (preferably also to the tilted
argument above)
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.
done; thanks
@@ -107,6 +108,72 @@ def default_topo_node_to_qubit(node: Any) -> cirq.Qid: | |||
return cirq.LineQubit(node) | |||
|
|||
|
|||
class HardcodedQubitPlacer(QubitPlacer): | |||
def __init__( |
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.
nit: Add docstrings to the class, init and other public methods like place_circuit
(if the inherited docstring is not enough).
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.
done, sorry
@tanujkhattar ptal |
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.
LGTM
Automerge cancelled: A status check is failing. |
Add a `QubitPlacer` that takes an explicit mapping in its constructor.
Add a `QubitPlacer` that takes an explicit mapping in its constructor.
Add a `QubitPlacer` that takes an explicit mapping in its constructor.
Add a
QubitPlacer
that takes an explicit mapping in its constructor.