quilc icon indicating copy to clipboard operation
quilc copied to clipboard

Stack overflow on very long inputs

Open markasoftware opened this issue 3 years ago • 0 comments

This is clearly evident when running the QASM benchmark suite, specifically 9symml_195.qasm. The problem is in process-includes, which uses tail recursion to loop over all the instructions. One solution is to add a local declare form to process-includes increasing the speed optimization to ensure that it uses tail recursion by default (at least in SBCL). Another solution is to use a loop. And the final option is to do nothing at all and assume any circuit long enough to exhaust the stack is simply too long for Quilc (since it blows the heap on my machine during addressing on this 9symml_195.qasm anyway)

markasoftware avatar Sep 21 '22 04:09 markasoftware