catalyst
catalyst copied to clipboard
Test suite maintenance regarding qjit device capabilities
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.