Skip to content

Commit

Permalink
fix missing inverse definitions in generate_basis_approximations (#…
Browse files Browse the repository at this point in the history
…13517)

* fix missing inverse definitions in `generate_basis_approximation`

* add missing basis gates to test

* add bugfix release note

* Update releasenotes/notes/fix-missing-inverse-definition-af7fe8d9f2193308.yaml

* Fix reno annotation

---------

Co-authored-by: Julien Gacon <gaconju@gmail.com>
Co-authored-by: Julien Gacon <jules.gacon@googlemail.com>
  • Loading branch information
3 people authored Mar 6, 2025
1 parent 63445e9 commit 149d5a6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
"tdg": "t",
"s": "sdg",
"sdg": "s",
"sx": "sxdg",
"sxdg": "sx",
}

_1q_gates = {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
fixes:
- |
Fixed a bug in the basis approximation generation for :class:`.SolovayKitaev`.
Previously, generating discrete basis approximations using
``generate_basis_approximations`` for a basis containing ``"sx"`` or
``"sxdg"`` gates would fail. This has now been fixed.
2 changes: 1 addition & 1 deletion test/python/transpiler/test_solovay_kitaev.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ def test_generate_basis_approximation_gates(self):
Regression test of Qiskit/qiskit-terra#9585.
"""
basis = ["i", "x", "y", "z", "h", "t", "tdg", "s", "sdg"]
basis = ["i", "x", "y", "z", "h", "t", "tdg", "s", "sdg", "sx", "sxdg"]
approx = generate_basic_approximations(basis, depth=2)

# This mainly checks that there are no errors in the generation (like
Expand Down

0 comments on commit 149d5a6

Please sign in to comment.