show_call_graph#
View source on GitHub
|
Display a graph representation of the call graph.
qualtran.drawing.show_call_graph(
item,
/,
*,
max_depth: Optional[int] = None,
agg_gate_counts: Optional[str] = None
) -> None
Args
itemEither a networkx graph or a bloq. If a networkx graph, it should be a “call graph” which is passed verbatim to the graph drawer and the additional arguments to this function are ignored. If it is a bloq, the factory method
GraphvizCallGraph.from_bloq()is used to construct the call graph, compute relevant costs, and display the call graph annotated with the costs.max_depthThe maximum depth (from the root bloq) of the call graph to draw. Note that the cost computations will walk the whole call graph, but only the nodes within this depth will be drawn.
agg_gate_countsOne of ‘factored’, ‘total_t’, ‘t_and_ccz’, or ‘beverland’ to (optionally) aggregate the gate counts. If not specified, the ‘factored’ approach is used where each type of gate is counted individually.
View source on GitHub