catalyst icon indicating copy to clipboard operation
catalyst copied to clipboard

Qrack `ValueError` when using catalyst mid-circuit measurements

Open yorgossot opened this issue 6 months ago • 1 comments

The following code reproduces the bug:

import pennylane as qml
from catalyst import qjit, measure

dev = qml.device("qrack.simulator", wires=3, shots=5)

@qjit()
@qml.qnode(dev, mcm_method="one-shot")
def circuit():
    qml.X(0)
    m_res = [measure(0), measure(1)]
    return qml.sample(qml.Z(0))

giving:

ValueError: Incompatible shapes for broadcasting: shapes=[(15,), (5,), ()]

tagging @josh146 related issue #1627

yorgossot avatar Apr 09 '25 15:04 yorgossot