-
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
) * Fix non-complex dtypes in OneQubitEulerDecomposer methods This commit fixes a regression introduced in the rewrite of the internals of the OneQubitEulerDecomposer class to be in rust. Previously the angles() and angles_and_phase() methods of OneQubitEulerDecomposer would work with a non-complex dtype in the input, however because the rust component of the module is strictly typed to only work with a complex128 dtype passing the array to rust to compute the angles and phase of the unitary would fail. To address this limitation this commit casts the input matrix to be complex before passing it to the rust function. Fixes #9827 * Cleanup release note * Update test/python/quantum_info/test_synthesis.py Co-authored-by: Jake Lishman <jake@binhbar.com> --------- Co-authored-by: Jake Lishman <jake@binhbar.com> (cherry picked from commit 6cec912) Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
- Loading branch information
1 parent
c14f528
commit 36807d1
Showing
3 changed files
with
50 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
10 changes: 10 additions & 0 deletions
10
releasenotes/notes/fix-type-angles-euler-decompose-233e5cee7205ed03.yaml
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,10 @@ | ||
--- | ||
fixes: | ||
- | | ||
Fixed an issue with the :class:`~.OneQubitEulerDecomposer` class's methods | ||
:meth:`~.OneQubitEulerDecomposer.angles` and :meth:`~.OneQubitEulerDecomposer.angles_and_phase` | ||
would error if the input matrix was of a dtype other than ``complex``/``np.cdouble``. In earlier | ||
releases this worked fine but this stopped working in Qiskit Terra 0.23.0 | ||
when the internals of :class:`~.OneQubitEulerDecomposer` were re-written | ||
in Rust. | ||
Fixed `#9827 <https://github.com/Qiskit/qiskit-terra/issues/9827>`__ |
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