-
Notifications
You must be signed in to change notification settings - Fork 617
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add dynamic_one_shot tensorflow support + expanded testing (#5973)
**Context:** As name says. Gradient workflows no longer raise errors after the merge of #5791 , but their correctness is yet to be verified. **Description of the Change:** * Updated casting rules in `dynamic_one_shot`'s processing function for tensorflow. * For the changes to be fully integrated, the way that the interface is passed around when calling a QNode needed to be changed, so the following changes were made: * `QNode` has updated behaviour for how `mcm_config` is used during execution. In `QNode._execution_component`, a copy of `self.execute_kwargs["mcm_config"]` is the source of truth, and in `qml.execute`, `config.mcm_config` is the source of truth. * Added a private `pad-invalid-samples` `postselect_mode`. The `postselect_mode` is switched to this automatically in `qml.execute` if executing with jax and shots and `postselect_mode == "hw-like"`. This way we standardize how the MCM transforms determine if jax is being used. * Updates to `capture` module to accommodate the above changes. **Benefits:** * `dynamic_one_shot` doesn't cast to interfaces inside the ML boundary * `dynamic_one_shot` works with tensorflow * Expanded tests **Possible Drawbacks:** **Related GitHub Issues:** Fixes #5736, #5710 Duplicate of #5861 which was closed due to release branch merge stuff. --------- Co-authored-by: Jay Soni <[email protected]> Co-authored-by: Astral Cai <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Yushao Chen (Jerry) <[email protected]> Co-authored-by: Christina Lee <[email protected]> Co-authored-by: Thomas R. Bromley <[email protected]> Co-authored-by: soranjh <[email protected]> Co-authored-by: Pietropaolo Frisoni <[email protected]> Co-authored-by: Ahmed Darwish <[email protected]> Co-authored-by: Utkarsh <[email protected]> Co-authored-by: David Wierichs <[email protected]> Co-authored-by: Christina Lee <[email protected]> Co-authored-by: Mikhail Andrenkov <[email protected]> Co-authored-by: Diego <[email protected]> Co-authored-by: Josh Izaac <[email protected]> Co-authored-by: Diego <[email protected]> Co-authored-by: Vincent Michaud-Rioux <[email protected]> Co-authored-by: lillian542 <[email protected]> Co-authored-by: Jack Brown <[email protected]> Co-authored-by: Paul Finlay <[email protected]> Co-authored-by: David Ittah <[email protected]> Co-authored-by: Cristian Emiliano Godinez Ramirez <[email protected]> Co-authored-by: Vincent Michaud-Rioux <[email protected]>
- Loading branch information
1 parent
d7c984e
commit eb7c349
Showing
14 changed files
with
493 additions
and
355 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -929,4 +929,4 @@ Kenya Sakka, | |
Jay Soni, | ||
Kazuki Tsuoka, | ||
Haochen Paul Wang, | ||
David Wierichs. | ||
David Wierichs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.