Skip to content

Commit 149d5a6

Browse files
burgholzerCryoris
andauthored
fix missing inverse definitions in generate_basis_approximations (Qiskit#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 <[email protected]> Co-authored-by: Julien Gacon <[email protected]>
1 parent 63445e9 commit 149d5a6

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

qiskit/synthesis/discrete_basis/generate_basis_approximations.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
"tdg": "t",
3838
"s": "sdg",
3939
"sdg": "s",
40+
"sx": "sxdg",
41+
"sxdg": "sx",
4042
}
4143

4244
_1q_gates = {
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
fixes:
2+
- |
3+
Fixed a bug in the basis approximation generation for :class:`.SolovayKitaev`.
4+
Previously, generating discrete basis approximations using
5+
``generate_basis_approximations`` for a basis containing ``"sx"`` or
6+
``"sxdg"`` gates would fail. This has now been fixed.

test/python/transpiler/test_solovay_kitaev.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ def test_generate_basis_approximation_gates(self):
463463
464464
Regression test of Qiskit/qiskit-terra#9585.
465465
"""
466-
basis = ["i", "x", "y", "z", "h", "t", "tdg", "s", "sdg"]
466+
basis = ["i", "x", "y", "z", "h", "t", "tdg", "s", "sdg", "sx", "sxdg"]
467467
approx = generate_basic_approximations(basis, depth=2)
468468

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

0 commit comments

Comments
 (0)