Emit twirl from boundary in left-dressed boxes#368
Merged
Conversation
ihincks
reviewed
May 25, 2026
Collaborator
ihincks
left a comment
There was a problem hiding this comment.
Thanks Josh. We should include a changelog for the change here.
joshuasn
commented
May 25, 2026
ihincks
approved these changes
May 27, 2026
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.
Summary
This PR moves the location of twirl emissions from the right-hand side of a left-dressed box to the boundary between easy and hard gates. Adding to allow for support of measure operations as propagators.
Details and comments
This simplifies the sorted order pretty significantly.
I also had to make a small change where the choice between
SliceRegisterNodeandCombineRegistersNodewas made. Previously, when we had a left- then a right-dressed box, as the emits were on the edge of the box opposite the hard content, the emissions from both would be combined to always match the number of subsystems for any hard gates. This is not the case anymore for examples like the following:Here, the emission on qubit 1 from the right dressed box would error when encountering the CX from the first box as it selects a
SliceRegisterNodethat is trying to write a single register to two registers. The change in this PR looks for these cases and instead uses aCombineRegisterNodethat starts with an identity on the correct number of subsystems and multiplies the virtual register on a smaller number of subsystems into it.