catalyst icon indicating copy to clipboard operation
catalyst copied to clipboard

Not detecting need for recompilation triggered by keyword arguments

Open albi3ro opened this issue 2 weeks ago • 0 comments

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.

albi3ro avatar Nov 10 '25 16:11 albi3ro