Currently, there exists no framework for the typechecker to recognize when certain types inherit from other types. This leads to issues where valid qwerty code is not accepted by the compiler due to the typechecker throwing errors. Take for example the following qwerty code:
from qwerty import *
@qpu
def kernel() -> bit:
f = pm.project if '+'|measure else id
q = '0'|f|std.project|f
return q|measure
print(kernel())
This produces the following error:
error: 'scf.if' op along control flow edge from Region #1 to parent results:
source type #0 '!qwerty<func(!qwerty<qbundle[1]>) rev-> !qwerty<qbundle[1]>>' should match input type #0 '!qwerty<func(!qwerty<qbundle[1]>) irrev-> !qwerty<qbundle[1]>>'
This happens because the typechecker does not correctly recognize the type-subtype relationship between irreversible and reversible functions.
Currently, there exists no framework for the typechecker to recognize when certain types inherit from other types. This leads to issues where valid qwerty code is not accepted by the compiler due to the typechecker throwing errors. Take for example the following qwerty code:
This produces the following error:
This happens because the typechecker does not correctly recognize the type-subtype relationship between irreversible and reversible functions.