-
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.
Fix multiple appends of '_dg' in name attribute on calling inverse() (#…
…6563) * Fix multiple appends of '_dg' in name attribute. If inverse() method of Gate is called multiple times, each call appended '_dg' to the end of the name attribute, i.e. 'gate_name_dg_dg'. This commit fixes it by checking if the name already contains '_dg'. If so, the '_dg' is removed from the name. If not, '_dg' is added. * Add tests and release notes. * Update bugfix-gate-inverse-name-3401093a18813ace.yaml
- Loading branch information
Showing
3 changed files
with
25 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
8 changes: 8 additions & 0 deletions
8
releasenotes/notes/bugfix-gate-inverse-name-3401093a18813ace.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,8 @@ | ||
--- | ||
fixes: | ||
- | | ||
Fixed bug in assigning name attribute to ``inverse()`` function of | ||
:class:`~qiskit.circuit.Gate` (inherited from :class:`~qiskit.circuit.Instruction`). | ||
Earlier, the inverse() function returned a gate with label None. Now | ||
the label of inverse is built using the label calling it. | ||
`#6563 <https://github.com/Qiskit/qiskit-terra/pull/6563>` for more details. |
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