Skip to content

Commit

Permalink
since iscss(CircuitCode) returns nothing, take that into account and …
Browse files Browse the repository at this point in the history
…throw error when calculating distance of generally non-CSS codes
  • Loading branch information
Fe-r-oz committed Jan 21, 2025
1 parent 321d4f3 commit f752ba6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ecc/ECC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ The minimum distance of a qLDPC code requires:
function distance end

function distance(c::AbstractECC; kwargs...)
if !iscss(c)
if iscss(c) == nothing || !iscss(c)
throw(ArgumentError("Computing the minimum distance of QLDPC using Mixed Integer Programming works only for CSS codes."))
end
return distance(parity_checks(c); kwargs...)
Expand Down

0 comments on commit f752ba6

Please sign in to comment.