bloq_example#
View source on GitHub
|
Decorator to turn a function into a BloqExample.
qualtran.bloq_example(
_func: Optional[Callable[[], _BloqType]] = None,
*,
generalizer: qualtran.resource_counting.GeneralizerT = (lambda x: x),
**kwargs
) -> Union[Callable[[Callable[[], _BloqType]], BloqExample[_BloqType]],
BloqExample[_BloqType]]
This will set name to the name of the function and bloq_cls according to the return-type
annotation. You can also call the decorator with keyword arguments, which will be passed
through to the BloqExample constructor.
View source on GitHub