HasLength#
qualtran.symbolics.HasLength
View source on GitHub
|
Symbolic value for an object that has a length.
qualtran.symbolics.HasLength(
n
)
This is used as a “symbolic” tuple. The length can either be a positive integer or a sympy expression. For example, if a bloq attribute is a tuple of ints, we can use the type:
values: Union[tuple, HasLength]
For the symbolic variant of a NDArray, see Shaped.
Note that we cannot override len and return a sympy symbol because Python has special treatment for len and expects you to return a non-negative integers.
See https://docs.python.org/3/reference/datamodel.html#object.len for more details.
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 HasLength.
View source on GitHub