Skip to content

Commit 6654059

Browse files
committed
Rewrite standard equivalence library for full connectivity
This rewrites the standard equivalence library around the core of making it fully connected, such that there are always paths through the equivalence relations to translate a standard-library 2q gate into the minimal number of standard-library 2q gates from a different local equivalence class. Similarly at the 1q level, the Pauli relations, Clifford relations, and Clifford+T relations are arranged such that it is always possible that a circuit in any of those classes can be translated to any basis within the same class or higher. Unfortunately, the current algorithm of the `BasisTranslator` is not really suitable for such a library; its algorithm is designed and efficient at finding _any_ translation, and cannot be directly weighted to produce the _best_ translation when multiple possibilities are available. This new library in this commit requires a different translation algorithm to realise its benefits. I call the new algorithm the `BasisConstructor`, but it still needs writing into a transpiler pass.
1 parent f80a3de commit 6654059

File tree

4 files changed

+1286
-1806
lines changed

4 files changed

+1286
-1806
lines changed

qiskit/circuit/equivalence_library.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212

1313
"""Session gates."""
1414

15-
from .library.standard_gates.equivalence_library import StandardEquivalenceLibrary
15+
from .library.standard_gates.equivalence_library import (
16+
STANDARD_EQUIVALENCE_LIBRARY as StandardEquivalenceLibrary,
17+
)
1618
from .equivalence import EquivalenceLibrary
1719

1820
SessionEquivalenceLibrary = EquivalenceLibrary(base=StandardEquivalenceLibrary)

0 commit comments

Comments
 (0)