Skip to content

Gate.to_unitary_mut(0) overflows and panics #464

@asaites

Description

@asaites

This code panics:

from quil.instructions import Gate, Qubit
Gate("X", (), (Qubit.from_fixed(0),), ()).to_unitary_mut(0)

Running that with a debug build gives something like:

attempt to subtract with overflow

In a release build, I see this:

ndarray: inputs 0 × 0 and 1 × 1 are not compatible for matrix multiplication

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