SympySymbolAllocator#
qualtran.resource_counting.SympySymbolAllocator
View source on GitHub
|
A class that allocates unique sympy symbols for integrating out bloq attributes.
qualtran.resource_counting.SympySymbolAllocator()
When counting, we group bloqs that only differ in attributes that do not affect resource costs. In practice, we do this by replacing bloqs with a version where the offending attributes have been set to an arbitrary (but unique) symbol allocated by this class. We refer to this process as “generalizing”.
Methods#
new_symbol
new_symbol(
prefix: str
) -> sympy.Symbol
Return a unique symbol beginning with _prefix.
View source on GitHub