catalyst
catalyst copied to clipboard
[Frontend] Added test_broadcast_double_odd to test_template.py
See issue https://github.com/PennyLaneAI/catalyst/issues/59 Parameters are taken from here: https://docs.pennylane.ai/en/stable/code/api/pennylane.broadcast.html
Hi @ndcroos, welcome to Catalyst and thank you for contributing! 🙂
The Catalyst team will be taking a look at your PR shortly. In general we use black
and isort
to format our Python files, you should be able to just run those on the frontend directory (black frontend
and isort frontend
, although isort shouldn't be needed unless you touch imports).
It also looks like the test you added is failing in the CI check:
FAILED frontend/test/pytest/test_template.py::test_broadcast_double_odd[lightning.qubit] - ValueError: Parameters must contain entries for 1 unitaries; got 3 entries
Was it passing locally?
Hi @dime10, thanks for the welcome. I followed the suggestion here to use the CI on GitHub as way to test my work.
I am not sure how to reason about how to specify the parameter. See this: https://docs.pennylane.ai/en/stable/code/api/pennylane.broadcast.html
Now I use this, but I am not sure of it.
params = jnp.array([[-5.3, 2.3, 3]])
Hi @ndcroos, I think your change in 7009853 fixed it. Because the given gate / unitary itself requires multiple parameters (in a list or array), you just needed an additional dimension in addition to the broadcast dimension.
At the moment our CI checks are temporarily disabled because we are updating our GitHub actions cache, but as soon as that is resolved we can proceed with your PR 🙂
Hi @ndcroos, you might need to revert your latest commit a155b73 as it seems to have changed the versions of our dependencies with respect to main.
Hi @ndcroos, I wanted to check in to see if you were still interested in contributing these tests? :)
Hi @dime10, thanks for coming back to me. At the moment, I haven't found time to continue yet. If anyone else wants to contribute these tests, and wants to use some part of these commits, they can do so. I will not continue work on this (for a relative long time, I think).
Thank you for working on this PR! I'll close it as stale now but feel free to reopen at any time if you wish to continue working on it :)