diff --git a/frontend/test/pytest/bug.py b/frontend/test/pytest/bug.py new file mode 100644 index 000000000..c15a604b1 --- /dev/null +++ b/frontend/test/pytest/bug.py @@ -0,0 +1,16 @@ +import pennylane as qml +import pytest +from catalyst import qjit + + +def test_observable_as_parameter(backend): + """Test to see if we can pass an observable parameter to qfunc.""" + + coeffs0 = [0.3, -5.1] + H0 = qml.Hamiltonian(qml.math.array(coeffs0), [qml.PauliZ(0), qml.PauliY(1)]) + + @qjit + def circuit(obs): + return qml.expval(obs) + + circuit(H0)