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

Add PassManager ability to remove passes by name or label #5069

Open
kdk opened this issue Sep 15, 2020 · 0 comments
Open

Add PassManager ability to remove passes by name or label #5069

kdk opened this issue Sep 15, 2020 · 0 comments
Assignees
Labels
type: enhancement It's working, but needs polishing

Comments

@kdk
Copy link
Member

kdk commented Sep 15, 2020

What is the expected enhancement?

As a follow on to #5024 , it would be helpful to be able to remove a particular pass (or set of passes) by their name or python class, so that one wouldn't have to first inspect the PassManager to find the index to remove. This would also allow for removals to be stable across changes in the ordering of the pass manager.

This could look something like

pm.remove(passes=[Optimize1QGates, Collect2qBlocks, ConsolidateBlocks])

and/or

_opt = [ Collect2qBlocks(), ConsolidateBlocks(...), UnitarySynthesis(...), Optimize1qGates(...) ]
pm.append(_opt, _do_while=_opt_control, label='gate_consolidation')

and later

pm.remove(label='gate_consolidation')
@kdk kdk added the type: enhancement It's working, but needs polishing label Sep 15, 2020
@1ucian0 1ucian0 self-assigned this Sep 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement It's working, but needs polishing
Projects
None yet
Development

No branches or pull requests

2 participants