catalyst
catalyst copied to clipboard
Not detecting need for recompilation triggered by keyword arguments
qjit is not detecting the need for recompilation when keyword arguments change shape.
For example:
@qml.qjit
def f(x, y):
return x + y
>>> f(1, y=2), f(1, y=jnp.array([2,2]))
(Array(3, dtype=int64), Array(3, dtype=int64))
>>> # redefine f
>>> f(1, y=jnp.array([3, 3])), f(1, y=2)
(Array([4, 4], dtype=int64), Array([3, 1], dtype=int64))
I would expect the behaviour with keyword arguments to match the behaviour where everything is passed positionally.