query_costs#
View source on GitHub
|
Compute a selection of costs for a bloq and its callees.
qualtran.resource_counting.query_costs(
bloq: 'Bloq',
cost_keys: Iterable[qualtran.resource_counting.CostKey],
generalizer: Optional[Union['GeneralizerT', Sequence['GeneralizerT']]] = None
) -> Dict['Bloq', Dict[CostKey, CostValT]]
This function can be used to annotate a call graph diagram with multiple costs
for each bloq. Specifically, the return value of this function can be used as the
bloq_data argument to GraphvizCallGraph.
Args
bloqThe bloq to seed the cost computation.
cost_keysA sequence of CostKey that specifies which costs to compute.
generalizerIf provided, run this function on each bloq in the call graph to dynamically modify attributes. If the function returns
None, the bloq is ignored in the cost computation. If a sequence of generalizers is provided, each generalizer will be run in order.
View source on GitHub