Skip to content

Commit

Permalink
Rewrite standard equivalence library for full connectivity
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jakelishman committed Aug 23, 2024
1 parent f80a3de commit 6654059
Show file tree
Hide file tree
Showing 4 changed files with 1,286 additions and 1,806 deletions.
4 changes: 3 additions & 1 deletion qiskit/circuit/equivalence_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@

"""Session gates."""

from .library.standard_gates.equivalence_library import StandardEquivalenceLibrary
from .library.standard_gates.equivalence_library import (
STANDARD_EQUIVALENCE_LIBRARY as StandardEquivalenceLibrary,
)
from .equivalence import EquivalenceLibrary

SessionEquivalenceLibrary = EquivalenceLibrary(base=StandardEquivalenceLibrary)
Loading

0 comments on commit 6654059

Please sign in to comment.