get_bloq_callee_counts#
View source on GitHub
|
Get the direct callees of a bloq and the number of times they are called.
qualtran.resource_counting.get_bloq_callee_counts(
bloq: 'Bloq',
generalizer: Optional[Union['GeneralizerT', Sequence['GeneralizerT']]] = None,
ssa: Optional[qualtran.resource_counting.SympySymbolAllocator] = None,
ignore_decomp_failure: bool = True
) -> List[qualtran.resource_counting.BloqCountT]
This calls bloq.build_call_graph() with the correct configuration options.
Args
bloqThe bloq.
generalizerIf provided, run this function on each callee to consolidate attributes that do not affect resource estimates. If the callable returns
None, the bloq is omitted from the counts graph. If a sequence of generalizers is provided, each generalizer will be run in order.ssaA sympy symbol allocator that can be provided if one already exists in your computation.
ignore_decomp_failureIf set to True, failing to find callees will be returned as an empty list. Otherwise, raise the
DecomposeNotImplementedErrororDecomposeTypeErrorcausing the failure.
View source on GitHub