Shaped#
qualtran.symbolics.Shaped
View source on GitHub
|
Symbolic value for an object that has a shape.
qualtran.symbolics.Shaped(
shape
)
A Shaped object can be used as a symbolic replacement for any object that has an
attribute shape, for example numpy NDArrays. Each dimension can be either
a positive integer value or a sympy expression.
For the symbolic variant of a tuple or sequence of values, see HasLength.
This is useful to do symbolic analysis of Bloqs whose call graph only depends on the shape
of the input, but not on the actual values. For example, T-cost of the QROM Bloq depends
only on the iteration length (shape) and not on actual data values. In this case, for the
bloq attribute data, we can use the type:
data: Union[NDArray, Shaped]
Attributes
Methods#
is_symbolic
is_symbolic()
__ne__
__ne__(
other
)
Check equality and either forward a NotImplemented or return the result negated.
__eq__
__eq__(
other
)
Method generated by attrs for class Shaped.
View source on GitHub