get_flame_graph_data#

Get the flame graph data for visualizing T-costs distribution of a sequence of bloqs.

For each bloq in the input, this will do a DFS ordering over all edges in the DAG and add an entry corresponding to each leaf node in the call graph. The string representation added for a leaf node encodes the entire path taken from the root node to the leaf node and is repeated a number of times that’s equivalent to the weight of that path. Thus, the length of the output would be roughly equal to the number of T-gates in the Bloq and can be very high. If you want to limit the output size, consider specifying a keep predicate where the leaf nodes are higher level Bloqs with a larger T-count weight.

bloqs

Bloqs to plot the flame graph for

file_path

If specified, the output is stored at the file.

keep

A predicate to determine the leaf nodes in the call graph. The flame graph would use these Bloqs as leaf nodes and thus would not contain decompositions for these nodes.

**kwargs

Additional arguments to be passed to bloq.call_graph, like generalizers etc.