Signature.build with flexible typing and shape syntax#1826
Merged
mpharrigan merged 6 commits intoquantumlib:mainfrom Mar 16, 2026
Merged
Signature.build with flexible typing and shape syntax#1826mpharrigan merged 6 commits intoquantumlib:mainfrom
Signature.build with flexible typing and shape syntax#1826mpharrigan merged 6 commits intoquantumlib:mainfrom
Conversation
d7cd375 to
77698d2
Compare
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces a more flexible syntax for building Signature objects by adding ShapedQCDType and enhancing Signature.build. The changes allow for more intuitive definitions of registers, including shaped arrays and side specifications. My review found one issue where the implementation of Signature.build for positional arguments is more restrictive than its documentation suggests, only handling lists instead of general iterables. I've suggested a fix to align the implementation with the documented behavior.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
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.
ShapedQCDTypecapable of specifying quantum arrays natively through subscripting (e.g.,QInt(8)[20])Signature.buildsyntactic sugar.Signature.buildcan now seamlessly handle fully instantiated types, shaped types, positional lists of registers/signatures, and granular side directives via tuples. fixes Syntactic sugar for declaring signatures #1769