Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier access to the preset pass managers #7023

Closed
kdk opened this issue Sep 15, 2021 · 2 comments
Closed

Easier access to the preset pass managers #7023

kdk opened this issue Sep 15, 2021 · 2 comments
Labels
good first issue Good for newcomers help wanted community contributions welcome. For filters like http://github-help-wanted.com/ type: enhancement It's working, but needs polishing

Comments

@kdk
Copy link
Member

kdk commented Sep 15, 2021

What is the expected enhancement?

Currently, accessing the preset passmanagers (outside of a call to transpile) requires building a pass_manager_config by hand, like:

from qiskit.transpiler import PassManagerConfig, CouplingMap
from qiskit.transpiler.preset_passmanagerrs import *

pass_manager_config = qk.transpiler.PassManagerConfig(
    basis_gates = backend.configuration().basis_gates,
    coupling_map = CouplingMap(backend.configuration().coupling_map),
    backend_properties = backend.properties(),
)

pm = level_3_pass_manager(pass_manager_config)

which is a fair amount of boilerplate if one already has access to a backend and a set of transpiler options (and prone to going stale as new options are added). I also don't think we document this anywhere.

One option would be to add a PassManagerConfig.from_backend(backend, **pass_manager_options) so that users can level_1_pass_manager(PassManagerConfig.from_backend(backend, **pass_manager_options)) and we can extract some of the argument parsing and backend extraction logic from qiskit.compiler.transpiler.

Another would be to build upon the builder for the preset pass managers being introduced in #6403 and have something like pm = FullPassManager.from_backend(backend, **pass_manager_options)

(Related to #3118 .)

@kdk kdk added type: enhancement It's working, but needs polishing good first issue Good for newcomers help wanted community contributions welcome. For filters like http://github-help-wanted.com/ labels Sep 15, 2021
@HuangJunye
Copy link
Collaborator

Should this issue be closed since it's fixed by #7163?

@kdk
Copy link
Member Author

kdk commented Jan 20, 2022

Closing as resolved by #7163 .

@kdk kdk closed this as completed Jan 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted community contributions welcome. For filters like http://github-help-wanted.com/ type: enhancement It's working, but needs polishing
Projects
None yet
Development

No branches or pull requests

2 participants