BloqExample#
qualtran.BloqExample
View source on GitHub
|
An instantiation of a bloq and its metadata.
qualtran.BloqExample(
func,
name,
bloq_cls,
generalizer=attr_dict['generalizer'].default,
docstring=attr_dict['docstring'].default
)
In particular, this class wraps a callable that returns a bloq instantiation with explicit attribute values.
Consider using the decorator @bloq_example to construct a BloqExample from a function.
Args
funcThe function that returns the bloq instantiation. Calling the
BloqExampleinstance will call this function.nameA name for the bloq instantiation.
bloq_clsThe
Bloqclass that this instantiation is an instance of.generalizerPassed to
get_bloq_counts_graphcalls for bloq-counts equivalence checking.docstringAn optional one-line description of the example.
Attributes
Methods#
make
make() -> _BloqType
Make the bloq.
__call__
__call__() -> _BloqType
This class is callable: it will make the bloq.
This makes the bloq_example decorator make sense: we wrap a function, so this
callable should do the same thing when called.
__ne__
__ne__(
other
)
Check equality and either forward a NotImplemented or return the result negated.
__eq__
__eq__(
other
)
Method generated by attrs for class BloqExample.
View source on GitHub