-
Notifications
You must be signed in to change notification settings - Fork 2.7k
dagcircuit: transfer DAG-level variables in substitute_node_with_dag
#15542
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
base: main
Are you sure you want to change the base?
dagcircuit: transfer DAG-level variables in substitute_node_with_dag
#15542
Conversation
…ixes Qiskit#15509)\n\n- Add input/captured/declared vars and stretches from replacement DAG\n- Add tests verifying input vars and captured/declared vars transfer\n- Add release note entry
|
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the following people are relevant to this code:
|
substitute_node_with_dag
Previously, substitute_node_with_dag() would try to add all variables from the replacement DAG, including those already present in the target DAG. This violated the constraint that a DAG cannot have both input and captured variables simultaneously when the same variable object appears in both contexts. Now check if each variable is already present before adding it, matching the behavior of compose() with inline_captures=False.
Pull Request Test Coverage Report for Build 21118635002Details
💛 - Coveralls |
|
@Cryoris can you please review this pr. I would really appreciate it. Thanks! |
Fixes missing variable/stretches when the replacement DAG carries declarations (e.g., for control-flow conditions/targets).
Adds tests for input-vars and captured/declared-vars transfer.
Includes a release note.
Closes #15509.