-
Notifications
You must be signed in to change notification settings - Fork 615
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow pulses to be applied to broadcasted states (#4863)
**Context:** Currently, we are raising an error in `apply_operation` of the new qubit device whenever a broadcasted state is supplied together with a non-broadcasted `ParametrizedEvolution` operation. We actually can support this scenario via the evolved matrix code, and via the evolved state code if `return_intermediate` is `False`. **Description of the Change:** Evolve batched states instead of raising an error. If the pulse has `return_intermediate=True`, introducing a batch dimension itself, we always use the matrix evolution method, modifying the branching slightly. **Benefits:** More code is supported, in particular the stochastic pulse parameter-shift rule in conjunction with multiple pulses within a QNode. **Possible Drawbacks:** N/A **Related GitHub Issues:** Fixes #4859 --------- Co-authored-by: Christina Lee <[email protected]>
- Loading branch information
Showing
5 changed files
with
63 additions
and
38 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
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