Constructing a Stabilizer(phases, xs, zs) should not allow the phases array to be longer than the height of the Hx or Hz matrix #208
Labels
better error messages
bug
Something isn't working
good first issue
Good for newcomers
help wanted
Extra attention is needed
When calling the stabilizer constructor on line 358 in QuantumClifford.jl:
Stabilizer(phases::AbstractVector{UInt8}, xs::AbstractMatrix{Bool}, zs::AbstractMatrix{Bool}) = Stabilizer(Tableau(phases, xs, zs))
The length of the phases array and the height of the xs and zs matrices are not compared, allowing invalid Stabilizers to be Created. For example, calling
Stabilizer(fill(0x0, 10), Hx, Hz)
where Hx and Hz are 3x6 matrices, creates a Stabilizer with no problems which is in fact invalid.
This is true for most Stabilizer/Tableau constructors, so looking at the Tableau constructor might be a good place to start
The text was updated successfully, but these errors were encountered: