-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Keep resets at beginning of circuits #10591
Changes from all commits
d29577e
ea7c1e6
4c11177
ef9e2d3
ba0bf89
35421fe
5bc253d
ef8329e
d86d77e
1149097
7a6b0f5
b1ca039
15fec47
584ead4
7abded2
79e5b5c
8492811
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,10 +82,10 @@ def level_1_pass_manager(pass_manager_config: PassManagerConfig) -> StagedPassMa | |
target is not None and target.get_non_global_operation_names(strict_direction=True) | ||
): | ||
pre_optimization = common.generate_pre_op_passmanager( | ||
target, coupling_map, remove_reset_in_zero=True | ||
target, coupling_map, remove_reset_in_zero=False | ||
) | ||
else: | ||
pre_optimization = common.generate_pre_op_passmanager(remove_reset_in_zero=True) | ||
pre_optimization = common.generate_pre_op_passmanager(remove_reset_in_zero=False) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doing this is no-op, with the arguments set like this it returns an empty There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wouldn't have thought that would have an effect on performance, though, and keeping it like this means potentially a bit less coupling between the components? It doesn't feel like the call site needs/ought to know that this combination of options returns an empty object. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It`ll save a few hundred ns at most. It's why I only left a comment and didn't block it because it's probably fine like this. I just wanted to call it out because this whole branch logic was written to support the pre optimization construction that was done prior to the introduction of stages. Where before the optimization loop the passmanagers either ran gate direction and optionally remove reset depending on optimization level or just remove reset in zero if there are no connectivity constraints. That all feels unnecessary now if we're never running remove resets anymore. |
||
|
||
optimization = plugin_manager.get_passmanager_stage( | ||
"optimization", optimization_method, pass_manager_config, optimization_level=1 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
upgrade: | ||
- | | ||
Disables the use of :class:`.RemoveResetInZeroState` in the preset passmanagers. | ||
This better aligns circuits to the notion of arbitrary initial states | ||
unless explicitly set to zeros with resets. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
black on the docs/conf.py file introduced this.