Skip to content

Commit

Permalink
Treat dynamic Pauli as requiring HigherLevelConstructs (#1597)
Browse files Browse the repository at this point in the history
This updates the logic for dynamic `Pauli` variables so that they
produce an RCA check error even when integer computations are supported.
This is consistent with the fact that they are not supported at codegen,
as expected.
  • Loading branch information
swernli authored May 31, 2024
1 parent 6c8bafb commit 48fd2e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,18 @@ fn use_of_dynamic_int_yields_no_errors() {
}

#[test]
fn use_of_dynamic_pauli_yields_no_errors() {
fn use_of_dynamic_pauli_yields_error() {
check_profile(
USE_DYNAMIC_PAULI,
&expect![[r#"
[]
[
UseOfDynamicPauli(
Span {
lo: 104,
hi: 134,
},
),
]
"#]],
);
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/qsc_rca/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ impl RuntimeFeatureFlags {
capabilities |= TargetCapabilityFlags::IntegerComputations;
}
if self.contains(RuntimeFeatureFlags::UseOfDynamicPauli) {
capabilities |= TargetCapabilityFlags::IntegerComputations;
capabilities |= TargetCapabilityFlags::HigherLevelConstructs;
}
if self.contains(RuntimeFeatureFlags::UseOfDynamicRange) {
capabilities |= TargetCapabilityFlags::HigherLevelConstructs;
Expand Down

0 comments on commit 48fd2e1

Please sign in to comment.