catalyst icon indicating copy to clipboard operation
catalyst copied to clipboard

Error when using `jnp.roll` with QNode + Dynamic shapes

Open dime10 opened this issue 6 months ago • 4 comments

The following program fails:

from catalyst import *
import pennylane as qml

@qjit
@qml.qnode(qml.device('lightning.qubit', wires=0))
def circuit(N: int):
    phase_divisors = jnp.arange(N)
    cumulative_phase = jnp.roll(phase_divisors, jnp.asarray(1))
    return cumulative_phase

print(circuit(2))

Without the QNode, it succeeds.

dime10 avatar Apr 04 '25 22:04 dime10