Update samples for circuit compatibility, relax RCA dynamic string checks#2999
Merged
Update samples for circuit compatibility, relax RCA dynamic string checks#2999
Conversation
…ecks This change updates the samples for more circuits compatibility (as well as QIR generation for Adaptive) where needed. It enables some of this via a relaxation of RCA checks on dyanmic strings by avoiding marking the program as requiring the string capability just because of a dynamic string. Since Q# strings can only be concatenated and copared for equality, only the latter can affect program control flow and output. So the capability is now associated with the use of equality comparison on dynamic strings, enabling programs that use `Message` with interpolated strings to now successfully generate RIR for circuits and QIR codegen. In addition, this change adds new expect-based tests for the samples that verify both the circuit generation and the QIR generation. This fixes #2442.
swernli
commented
Mar 5, 2026
Collaborator
Author
swernli
left a comment
There was a problem hiding this comment.
I'm going to take a crack at tweaking the string display for circuits to make this a bit smaller.
orpuente-MS
reviewed
Mar 6, 2026
minestarks
reviewed
Mar 9, 2026
minestarks
reviewed
Mar 9, 2026
minestarks
reviewed
Mar 11, 2026
minestarks
approved these changes
Mar 11, 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.
This change updates the samples for more circuits compatibility (as well as QIR generation for Adaptive) where needed. It enables some of this via a relaxation of RCA checks on dyanmic strings by avoiding marking the program as requiring the string capability just because of a dynamic string. Since Q# strings can only be concatenated and copared for equality, only the latter can affect program control flow and output. So the capability is now associated with the use of equality comparison on dynamic strings, enabling programs that use
Messagewith interpolated strings to now successfully generate RIR for circuits and QIR codegen.In addition, this change adds new expect-based tests for the samples that verify both the circuit generation and the QIR generation. This fixes #2442.
Note for reviewers: only the following files have production changes, the rest are updates to test snapshots or test infra
samples/algorithmsandsamples/getting_startedsource/compiler/qsc_partial_eval/src/lib.rssource/compiler/qsc_rca/src/core.rs