-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding tests for all PennyLane transforms #1215
base: main
Are you sure you want to change the base?
Conversation
…l add support to qml.qml.CosineWindow when it's called as the first op in tapes
Co-authored-by: David Ittah <[email protected]>
…I/catalyst into cosinewindow_catalyst_support
…I/catalyst into cosinewindow_catalyst_support
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1215 +/- ##
==========================================
+ Coverage 96.72% 97.95% +1.23%
==========================================
Files 56 77 +21
Lines 6800 11318 +4518
Branches 780 981 +201
==========================================
+ Hits 6577 11087 +4510
- Misses 173 181 +8
Partials 50 50 ☔ View full report in Codecov by Sentry. |
Hello. You may have forgotten to update the changelog!
|
Thanks for adding this, I will take a closer look in a bit, but first @mlxd , what's the guideline on large batches of xfailed python tests like this? Do we prefer For context, @willjmax is going over the core PL transforms and testing whether qjit works with them or not. If they don't work, a reason is noted in this testing file. Edit: discussed this; if we know something fails, but it shouldn't, we should always aim to mark it xfail. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding the tests 💯 Some questions from me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @willjmax ! Interesting results that we need to look at to make sure Catalyst and PL are more compatible with each other. Cheers!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @willjmax, left some comments, will be good from my side after addressing them.
|
||
@pytest.mark.xfail(reason="Noise models not supported on Lightning.") | ||
def test_add_noise(backend): | ||
"""Test the add noise transform on a simple circuit""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"""Test the add noise transform on a simple circuit""" | |
"""Test the add_noise transform on a simple circuit""" |
def test_split_non_commuting(backend): | ||
"""Test split non commuting""" | ||
def test_batch_partial(backend): | ||
"""Test batch partial""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this is changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Git sees the tests being deleted, but this was just moved down. https://github.com/PennyLaneAI/catalyst/pull/1215/files/eb2182d2ea8b77cb7df4cfc21d8e5bdbc0c15098#diff-6e6e42c7dd176e53e7c05f2380b0c7b728f82f35912fea619fee3988daa5f08aR687-R688
@qml.transforms.split_non_commuting | ||
@qml.qnode(qml.device(device_name, wires=6), interface="jax") | ||
def qfunc(): | ||
"""Example taken from PL tests""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine to mention this but it is not the case for all other tests, why explicitly mentioned for this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this test was written by me. The reason why it is in green is because git sees it being deleted and rewritten instead of being move. We can also remove this comment if you think it is worthwhile.
|
||
|
||
@pytest.mark.xfail(reason="Noise models not supported on Lightning.") | ||
def test_add_noise(backend): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where backend
is defined?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The backend is a variable provided from the command line to pytest. It defaults to "lightning.qubit" but we also run it with "lightning.kokkos".
# pylint: disable=too-many-lines,line-too-long | ||
|
||
|
||
@pytest.mark.xfail(reason="Noise models not supported on Lightning.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be better to move all xfail tagged tests to the end of file.
This PR adds unit tests for all PennyLane transforms. This PR addresses [sc-72626].