-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ZNE with measurements_from_samples (#1165)
**Context:** 1) Jax generates additional const arguments with [...], and take. 2) The `mitigate_with_zne` does not work when using the `measurements_from_sample` function. The root of the the issue is the function `removeQuantumMeasurements` that tries to remove all users of the measurments. But potentially users are located in a block of an operations, therefore emptying the block but not the operation. **Description of the Change:** 1) The JaxPr const are added to the ZNE op args. 2) removeQuantumMeasurements is replaced by replaceQuantumMeasurements, this functions is replacing quantum measurements with empty tensors. The tensors are remove in the bufferization pass. (`--inline, --canonicalize`) **Benefits:** ZNE with shots works with hardware devices (counts and samples) --------- Co-authored-by: David Ittah <[email protected]>
- Loading branch information
Showing
6 changed files
with
83 additions
and
4 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
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