CLS-8612: Move res allocation in Qmod tutorial part 2 - #1658
Open
Lior-Preminger wants to merge 1 commit into
Open
Lior-Preminger wants to merge 1 commit into
Lior-Preminger wants to merge 1 commit into
Conversation
…art 2 In the Exercise 10 solutions, `allocate(5, res)` was called at the very start of `main`, keeping those 5 qubits reserved during the `aux |= x < 0.5` comparison. Moving the allocation to just before the `control` block lets the synthesizer use res's qubits as auxiliaries for the comparison. The old flow moved this automatically via topological ordering; the new flow does not, so it is done explicitly here. This brings the new-flow width down to 11. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket
[CLS-8612] Move allocation in Qmod tutorial part 2 (#13)
What
In
Qmod_tutorial_part2.ipynb, the Exercise 10a and 10b solutions allocateres(allocate(5, res)) at the very start ofmain. This reserves those 5 qubits throughout theaux |= x < 0.5comparison, inflating the circuit width in the new synthesis flow.The allocation is moved to just before the
controlblock (right afteraux |= x < 0.5). Sinceresis only first used inside thecontrolblock, this is semantically equivalent, but it now lets the synthesizer reuseres's qubits as auxiliaries for the comparison.The old synthesis flow performed topological ordering and moved this allocation automatically; the new flow does not, so the notebook does it explicitly.
DoD
🤖 Generated with Claude Code