cirq.draw_placements

Draw a visualization of placements from small_graph onto big_graph using Matplotlib.

Used in the notebooks

Used in the tutorials

The entire big_graph will be drawn with default blue colored nodes. small_graph nodes and edges will be highlighted with a red color.

big_graph A larger graph to draw with blue colored nodes.
small_graph A smaller, sub-graph to highlight with red nodes and edges.
small_to_big_mappings A sequence of mappings from small_graph nodes to big_graph nodes.
max_plots To prevent an explosion of open Matplotlib figures, we only show the first max_plots plots.
axes Optional list of matplotlib Axes to contain the drawings.
tilted Whether to draw gridlike graphs in the ordinary cartesian or tilted plane.
bad_placement_callback If provided, we check that the given mappings are valid. If not, this callback is called. The callback should accept ax and i keyword arguments for the current axis and mapping index, respectively.