You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I couldn't find a way to define a sequence (list / tuple) using sympy where the length of the sequence is a symbolic parameter. This is often useful to specify costs of Bloqs which expect sequences as inputs but the call graph really only depends upon the length of this sequence. This is useful for a variety of Bloqs, like
QROM - The T-cost depends mainly on the iteration length of the data while the clifford cost depends upon the actual values of the data
(I'm sure there are more Bloqs that we should append to this list)
Let's figure out a way to support this. One way would be to have a custom wrapper class for sequences that can be instantiated via either just shape (which can be symbolic) or the actual data (in which case shape can be derived). Open to other suggestions.
Yeah, we could have a class that just has a shape and either raises an error if you try to index into it or yields sympy symbols like Shaped(name='x', shape=(3,))[2] = Symbol('x_2')
Do we want to wrap our data or just accept Union[NDArray, Shaped]. This is consistent with how we generally do n: Union[int, sympy.Expr]
I couldn't find a way to define a sequence (list / tuple) using sympy where the length of the sequence is a symbolic parameter. This is often useful to specify costs of Bloqs which expect sequences as inputs but the call graph really only depends upon the length of this sequence. This is useful for a variety of Bloqs, like
cvs: Tuple[int, ...]
#786GQSP
- [GQSP] Negative powers and Hamiltonian simulation #669 (comment)QROM
- The T-cost depends mainly on the iteration length of the data while the clifford cost depends upon the actual values of the data(I'm sure there are more Bloqs that we should append to this list)
Let's figure out a way to support this. One way would be to have a custom wrapper class for sequences that can be instantiated via either just
shape
(which can be symbolic) or the actual data (in which caseshape
can be derived). Open to other suggestions.cc @mpharrigan
The text was updated successfully, but these errors were encountered: