qsharp-runtime
qsharp-runtime copied to clipboard
AllowAtMostNQubits not allowing at most N qubits
The following test passes:
@Test("ResourcesEstimator")
operation test_repro() : Unit {
within {
AllowAtMostNQubits(0, "Workspace");
} apply {
use q = Qubit();
X(q);
}
}
It should fail.
Project details:
<Project Sdk="Microsoft.Quantum.Sdk/0.23.195983">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Quantum.AutoSubstitution" Version="0.18.2107153439" IsQscReference="true" />
<PackageReference Include="Microsoft.Quantum.Xunit" Version="0.16.2105140472" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.4.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
</ItemGroup>
</Project>
I've transferred this issue from qsharp-language to qsharp-runtime and marked it as bug. We should investigate to understand why enforcement is not happening here.