catalyst icon indicating copy to clipboard operation
catalyst copied to clipboard

[Frontend] Added test_broadcast_double_odd to test_template.py

Open ndcroos opened this issue 1 year ago • 7 comments

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

ndcroos avatar Aug 29 '23 22:08 ndcroos

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?

dime10 avatar Aug 30 '23 14:08 dime10

Hi @dime10, thanks for the welcome. I followed the suggestion here to use the CI on GitHub as way to test my work.

ndcroos avatar Aug 31 '23 16:08 ndcroos

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]])

ndcroos avatar Aug 31 '23 17:08 ndcroos

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 🙂

dime10 avatar Aug 31 '23 19:08 dime10

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.

dime10 avatar Sep 05 '23 21:09 dime10

Hi @ndcroos, I wanted to check in to see if you were still interested in contributing these tests? :)

dime10 avatar Oct 30 '23 19:10 dime10

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).

ndcroos avatar Oct 31 '23 19:10 ndcroos

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 :)

dime10 avatar Jul 12 '24 15:07 dime10