Skip to content

Port EquivalenceLibrary to Rust #12278

@mtreinish

Description

@mtreinish

What should we add?

As part of our effort to migrate more of Qiskit's code into rust for better runtime performance and efficiency we need to look at migrating more functionality to Rust. As part of this we're looking at moving the implementation of more transpiler passes into Rust in #12208. The BasisTranslator is one of the passes included in that epic (individually being tracked in #12246), and to enable the maximum efficiencies in that pass we will need to port the EquivalenceLibrary to rust. Right now it's built using a rustworkx graph, and we'll want to move the internals one level down to a petgraph graph and leverage rustworkx-core.

In practice this is probably blocked on #12205, but an initial implementation can leverage python space for dealing with gates and circuits and this can be refactored after #12205 is implemented to use the rust objects directly.

The one thing to keep an eye out for here is that after #12205 we'll still need a mechanism for Python space users to add onto the equivalence library with custom gates. It likely will just need to reuse whatever mechanism we use for QuantumCircuit but it's worth highlighting here too.

Metadata

Metadata

Assignees

Labels

RustThis PR or issue is related to Rust code in the repositorymod: transpilerIssues and PRs related to Transpilerperformance

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions