-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
* Implement `__array__` for `qasm2._DefinedGate` Gates defined from OpenQASM 2 should have a well-defined matrix form (up to global phase) whenever all the constituent parts of the definition do. This manually makes such a matrix available. * Fix signature for Numpy 2.0 (cherry picked from commit 767bd07) Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
- Loading branch information
1 parent
bac400d
commit c148a5e
Showing
3 changed files
with
43 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
fixes: | ||
- | | ||
Custom gates (those stemming from a ``gate`` statement) in imported OpenQASM 2 programs will now | ||
have an :meth:`.Gate.to_matrix` implementation. Previously they would have no matrix definition, | ||
meaning that roundtrips through OpenQASM 2 could needlessly lose the ability to derive the gate | ||
matrix. Note, though, that the matrix is calculated by recursively finding the matrices of the | ||
inner gate definitions, as :class:`.Operator` does, which might be less performant than before | ||
the round-trip. |
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