Skip to content

Commit

Permalink
iscss function
Browse files Browse the repository at this point in the history
  • Loading branch information
Fe-r-oz committed Mar 18, 2024
1 parent d1b1e2f commit e199ac2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/ecc/ECC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ Only CSS codes have this method.
See also: [`parity_checks`](@ref)"""
function parity_checks_x(code::AbstractECC)
if iscss(code)

Check warning on line 40 in src/ecc/ECC.jl

View check run for this annotation

Codecov / codecov/patch

src/ecc/ECC.jl#L40

Added line #L40 was not covered by tests
# Existing implementation for CSS codes
else
throw(lazy"Codes of type $(typeof(code)) do not have separate X and Z parity checks, either because they are not a CSS code and thus inherently do not have separate checks, or because its separate checks are not yet implemented in this library.")
end
end

"""Parity check boolean matrix of a code (only the Z entries in the tableau, i.e. the checks for X errors).
Expand All @@ -46,10 +50,16 @@ Only CSS codes have this method.
See also: [`parity_checks`](@ref)"""
function parity_checks_z(code::AbstractECC)
if iscss(code)

Check warning on line 53 in src/ecc/ECC.jl

View check run for this annotation

Codecov / codecov/patch

src/ecc/ECC.jl#L53

Added line #L53 was not covered by tests
# Existing implementation for CSS codes
else
throw(lazy"Codes of type $(typeof(code)) do not have separate X and Z parity checks, either because they are not a CSS code and thus inherently do not have separate checks, or because its separate checks are not yet implemented in this library.")
end
end

function iscss(code::AbstractECC) = false end # Default: not CSS
function iscss(code::AbstractECC)
return false # Default: not CSS

Check warning on line 61 in src/ecc/ECC.jl

View check run for this annotation

Codecov / codecov/patch

src/ecc/ECC.jl#L60-L61

Added lines #L60 - L61 were not covered by tests
end

parity_checks(s::Stabilizer) = s
Stabilizer(c::AbstractECC) = parity_checks(c)
Expand Down

0 comments on commit e199ac2

Please sign in to comment.