BloqExample#

qualtran.BloqExample

An instantiation of a bloq and its metadata.

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.

func

The function that returns the bloq instantiation. Calling the BloqExample instance will call this function.

name

A name for the bloq instantiation.

bloq_cls

The Bloq class that this instantiation is an instance of.

generalizer

Passed to get_bloq_counts_graph calls for bloq-counts equivalence checking.

docstring

An optional one-line description of the example.

bloq_cls

 

docstring

 

generalizer

 

name

 

Methods#

make

View source

Make the bloq.

__call__

View source

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__

Check equality and either forward a NotImplemented or return the result negated.

__eq__

Method generated by attrs for class BloqExample.