SympySymbolAllocator#

qualtran.resource_counting.SympySymbolAllocator

A class that allocates unique sympy symbols for integrating out bloq attributes.

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

View source

Return a unique symbol beginning with _prefix.