Skip to content

Loop index type inferred as iList in squin kernel #408

Open
@david-pl

Description

@david-pl

MWE:

@squin.kernel
def main():
    q = squin.qubit.new(3)
    x = squin.op.x()
    for i in range(3):
        squin.qubit.apply(x, [q[i]])

main.print()

The resulting IR is shows that the loop variable is an IList for some reason:

%x_1, %q_1, %x_2, %q_2 = scf.for %i : !py.IList[!py.int, Literal(3,int)] in %1 -> !py.Op, !py.IList[!py.Qubit, !Any], !py.Op, !py.IList[!py.Qubit, !Any]

Tested on bloqade-circuit main branch with kirin v0.17.6.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions