quil-rs icon indicating copy to clipboard operation
quil-rs copied to clipboard

`Gate.to_unitary_mut(0)` overflows and panics

Open asaites opened this issue 4 months ago • 0 comments

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

asaites avatar Aug 22 '25 01:08 asaites