-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…5385) * Remove lone identity gates in Optimize 1q decomposition pass When running the optimize 1q decomposition pass for basis sets other than u1, u2, u3 there was an edge case where it wouldn't remove lone identity gates. This was because normally the pass skips runs of length 1 because the Euler decomposer will normally not do better than that. But, in the case of identity gates we know that they can just be removed, and the simplify=True flag on the decomposer will normally do this for us. But, since we don't run the decomposer this commit fixes this edge case by explicitly checking the single gate for an identity and removing it if it is. Fixes #5287 * Use append instead of deprecated u3 method in test * Compare to identity matrix instead of checking all parameters are 0 (cherry picked from commit 1578fb4) Co-authored-by: Matthew Treinish <[email protected]>
- Loading branch information
1 parent
230c07b
commit 1a009ca
Showing
2 changed files
with
90 additions
and
1 deletion.
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