qcor icon indicating copy to clipboard operation
qcor copied to clipboard

pyxasm token collector cannot handle function docs strings in qjit kernel

Open amccaskey opened this issue 4 years ago • 1 comments

The following causes an assertion to be triggered

@qjit
def oracle(q : qreg):
    """
    Define the oracle for our phase estimation algorithm,
    a T gate on the last qubit
    """
    ... oracle code ...

but this does not

@qjit
def oracle(q : qreg):
    ... oracle code ...

amccaskey avatar Feb 05 '21 20:02 amccaskey

I guess this might be because we're doing single-line parsing of the Python code. We probably need to track the scope of these multi-line comment blocks in the handler.

1tnguyen avatar Feb 05 '21 21:02 1tnguyen