PennyLaneAI / PennyLaneAI/catalyst
Test suite maintenance regarding qjit device capabilities
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 234
- Forks
- 84
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 66
Description
One of the purposes of the QJITDevice class is to compute the preprocessing transform program depending on the device capabilities, i.e. what qnode-level transforms (aka qml.transfroms.blah) need to happen before reaching the mlir layer. For example, for devices without analytical mode execution, the measurement_from_samples/counts qnode transform is added here.
The code around here has recently been refactored https://github.com/PennyLaneAI/catalyst/pull/2089 (to account for whether the user has provided shots in the program, as well as just general clean up). One remaining function, get_device_capabilities , is not actually used in the codebase anymore. However, it was not deleted, because various tests are still using this internal function directly.
See https://github.com/PennyLaneAI/catalyst/pull/2089#discussion_r2421256201 for details.
The tests should properly construct custom capability sets for their respective purposes, instead of piggy-backing off lightning.
As an alternative, the get_device_capabilities function can be demoted to a test util, and decoupled from the actual code base.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by inspecting get_device_capabilities in frontend/catalyst/device/qjit_device.py and the tests that call it, then read the linked discussion in pull request 2089. Update the tests to construct capability sets for their own purposes, or move the function into test utilities and remove it from production code; done means the tests no longer depend on Lightning capabilities.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100