-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Delegate `BasePass.__call__` to `PassManager.run` This ensures that calling a pass directly will follow the same execution logic as a regular pass-manager construction. This particularly matters for passes that have `requires`. It also ensures that the conversion from a circuit and back to a DAG will follow the same rules, which is expected since it is a shorthand notation, but liable to get out of sync as they are complex. * Correctly propagate exceptions through `PassManager.run` * Fix lint
- Loading branch information
1 parent
b77a822
commit 1b43c89
Showing
8 changed files
with
136 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
releasenotes/notes/pass-call-as-passmanager-7f874917b9b303f0.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
features_transpiler: | ||
- | | ||
:meth:`.PassManager.run` now accepts a ``property_set`` argument, which can be set to a | ||
:class:`~collections.abc.Mapping`-like object to provide the initial values of the pipeline's | ||
:class:`.PropertySet`. This can be used to recommence a partially applied compilation, or to | ||
reuse certain analysis from a prior compilation in a new place. | ||
upgrade_transpiler: | ||
- | | ||
The keyword argument ``property_set`` is now reserved in :meth:`.BasePassManager.run`, and | ||
cannot be used as a ``kwarg`` that will be forwarded to the subclass's conversion from the | ||
front-end representation to the internal representation. | ||
fixes: | ||
- | | ||
Calling an :class:`.AnalysisPass` or a :class:`.TransformationPass` like a function (as in | ||
``pass_ = MyPass(); pass_(qc)``) will now respect any requirements that the pass might have. | ||
For example, scheduling passes such as :class:`.ALAPScheduleAnalysis` require that | ||
:class:`.TimeUnitConversion` runs before them. Running the pass via a :class:`.PassManager` | ||
always respected this requirement, but until this note, it was not respected by calling the | ||
pass directly. | ||
- | | ||
When a :exc:`.TranspilerError` subclass is raised by a pass inside a call to | ||
:meth:`.PassManger.run`, the exception will now be propagated through losslessly, rather than | ||
becoming a chained exception with an erased type. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters