Skip to content

[Bug]: Invalid Hugr with dagger and index access #1555

@nicolaassolini-qntm

Description

@nicolaassolini-qntm

Description

The pass on the following program produces an invalid hugr:

@guppy
def main() -> None:
    q = qubit()
    array_qubits: array[qubit, 2] = array(qubit(), qubit())

    with dagger:
        h(array_qubits[1])

    state_result("r", array_qubits[0], array_qubits[1], q)
    discard_array(array_qubits)
    discard(q)

Steps to Reproduce

No response

Expected Behaviour

No response

Actual Behaviour

No response

Component

No response

Environment

Additional Context

No response

Metadata

Metadata

Labels

C-bugfixCategory: PR with bug fix

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions