PennyLaneAI / pennylane

PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Train a quantum computer the same way as a neural network.
https://pennylane.ai
Apache License 2.0
2.38k stars 607 forks source link

Add `_setup_transform_program` helper function #6615

Closed andrijapau closed 2 hours ago

andrijapau commented 1 week ago

Context:

Previously, the transform program setup was split between qnode.py and execution.py, making it unintuitive, hard to maintain, and difficult to test. This PR moves all of the setup code into a single location and introduces unit testing for the newly added helper functions.

Description of the Change:

Refactored the workflow module to enhance unit testing and improve code modularity. Added unit tests specifically targeting helper functions, ensuring their functionality is isolated and independently verified.

Introduced new files to the qml.workflow module:

Benefits: Workflow clean-up and better testing of the execution pipeline.

Possible Drawbacks: None

[sc-72138]

codecov[bot] commented 1 week ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.65%. Comparing base (8ad0ab9) to head (fe5af9b). Report is 1 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #6615 +/- ## ======================================= Coverage 99.65% 99.65% ======================================= Files 455 456 +1 Lines 42993 42993 ======================================= Hits 42844 42844 Misses 149 149 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.