Skip to content

Move GateDirection responsibility into translation preset stage #13787

@jakelishman

Description

@jakelishman

At the moment, the GateDirection fix-up pass is run in the "pre-optimisation" stage as a fix-up method, mostly because BasisTranslator isn't direction-aware.

Instead, we should shift the responsibility of the translation stage so that a translation plugin is required to put out an ISA circuit, such that the optimisation loop can then be certain it takes in a hardware-lowered circuit. This makes it possible for translation plugins that are direction-aware (like the upcoming BasisConstructor) to avoid the extra cost, and it removes the need for the pre_optimization stage in the default StagedPassManager construction, which is a de facto stage of its own accord right now, since it's populated by default.

This is an API change, since it's adding to the responsibilities of external translation plugins, but the mitigation strategy is already available: add the GateDirection pass to plugins that might need it.

Metadata

Metadata

Assignees

Labels

mod: transpilerIssues and PRs related to Transpiler

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions