qsharp-compiler
qsharp-compiler copied to clipboard
Compiler freezes when compiling nested array logic.
Describe the bug
Compiler freezes (i.e. takes longer than is reasonable to wait) when compiling nested array logic.
To Reproduce
The issue is reproduced with following snippet:
namespace QATSample {
open Microsoft.Quantum.Intrinsic;
@EntryPoint()
operation Main(): Result
{
use qubits = Qubit[10];
let xx = [[[[[[[[[[[[ [qubits, qubits] ]]]]]]]]]]]];
CNOT(xx[0][0][0][0][0][0][0][0][0][0][0][0][Length(xx[0][0][0][0][0][0][0][0][0][0][0][0]) -1][Length(xx[0][0][0][0][0][0][0][0][0][0][0][0][Length(xx[0][0][0][0][0][0][0][0][0][0][0][0]) - 1]) - 1], q);
return Zero;
}
}
and
<Project Sdk="Microsoft.Quantum.Sdk/0.24.41975-alpha">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<IncludeProviderPackages>False</IncludeProviderPackages>
<ExecutionTarget>qci.qpu</ExecutionTarget>
<TargetCapability>AdaptiveExecution</TargetCapability>
<QirGeneration>true</QirGeneration>
</PropertyGroup>
</Project>
Expected behavior
That the compiler finishes timely or produces an error message explaining why it cannot finish.
System information
-
NuGet Version: 5.9.0.7134 -
Darwin MacBook Pro 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:45:05 PDT 2022; root:xnu-8020.101.4~15/RELEASE_X86_64 x86_64andnet6.0