Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Benzillaist opened this issue Dec 30, 2023 · 0 comments · Fixed by #350
Labels
better error messages bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed

Comments

@Benzillaist
Copy link
Contributor

Benzillaist commented Dec 30, 2023

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

@Krastanov Krastanov added bug Something isn't working help wanted Extra attention is needed good first issue Good for newcomers better error messages labels Dec 30, 2023
Fe-r-oz added a commit to Fe-r-oz/QuantumClifford.jl that referenced this issue Aug 30, 2024
Fe-r-oz added a commit to Fe-r-oz/QuantumClifford.jl that referenced this issue Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
better error messages bug Something isn't working good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants