Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/QECCore/ext/QECCoreNemoExt/QECCoreNemoExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ using DocStringExtensions

import Nemo
import Nemo: GF, gen, matrix, rank, transpose, polynomial_ring, evaluate, FqFieldElem,
FqPolyRingElem, degree, is_irreducible, gcd, derivative, inv, coeff, is_monic, one

FqPolyRingElem, degree, is_irreducible, gcd, derivative, inv, coeff, is_monic, one,
minpoly, lcm, is_zero, finite_field
import QECCore: code_k, parity_matrix_x, parity_matrix_z, parity_matrix, generator_polynomial

import Random
Expand All @@ -30,6 +30,7 @@ function QECCore.code_k(c::AbstractCECC)
return n - rank_H
end

include("bch.jl")
include("goppa.jl")

end # module
File renamed without changes.
3 changes: 2 additions & 1 deletion lib/QECCore/src/QECCore.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ DelfosseReichardt, DelfosseReichardtRep, DelfosseReichardt823, QuantumTannerGrap
TillichZemor, random_TillichZemor_code, BivariateBicycleViaCirculantMat

# Classical Codes
export RepCode, ReedMuller, RecursiveReedMuller, Golay, Hamming, random_Gallager_ldpc, Goppa, random_Goppa_code
export RepCode, ReedMuller, RecursiveReedMuller, Golay, Hamming, random_Gallager_ldpc, Goppa, random_Goppa_code, BCH

# utilities
export search_self_orthogonal_rm_code, hgp
Expand All @@ -37,6 +37,7 @@ include("codes/classical/repetition.jl")
include("codes/classical/golay.jl")
include("codes/classical/gallager.jl")
include("codes/classical/goppa.jl")
include("codes/classical/bch.jl")

# Quantum Codes
include("codes/quantum/css.jl")
Expand Down
8 changes: 8 additions & 0 deletions lib/QECCore/src/codes/classical/bch.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""BCH codes ([hocquenghem1959codes](@cite), [bose1960class](@cite))."""
function BCH(args...; kwargs...)
ext = Base.get_extension(QECCore, :QECCoreNemoExt)
if isnothing(ext)
throw("The `BCH` depends on the package `Nemo` but you have not installed or imported it yet. Immediately after you import `Nemo`, the `BCH` will be available.")
end
return ext.BCH(args...; kwargs...)
end
6 changes: 3 additions & 3 deletions test/test_ecc_bch.jl → lib/QECCore/test/codes/bch.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
@testitem "ECC BCH" tags=[:ecc, :ecc_bespoke_checks] begin
@testitem "ECC BCH" begin
using LinearAlgebra
using QECCore
using QuantumClifford.ECC
using QuantumClifford.ECC: AbstractECC, BCH, generator_polynomial
using Nemo: ZZ, residue_ring, matrix, finite_field, GF, minpoly, coeff, lcm, FqPolyRingElem, FqFieldElem, is_zero, degree, defining_polynomial, is_irreducible

using QuantumClifford.ECC.QECCore: code_k, code_n, distance, rate, parity_matrix
using QECCore: code_k, code_n, distance, rate, parity_matrix, BCH, generator_polynomial

# To prove that t-bit error correcting BCH code indeed has minimum distance
# of at least 2 * t + 1, it is shown that no 2 * t or fewer columns of its
Expand Down
1 change: 0 additions & 1 deletion src/ecc/ECC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,6 @@ include("codes/util.jl")

include("codes/concat.jl")
include("codes/random_circuit.jl")
include("codes/classical/bch.jl")

# qLDPC
include("codes/classical/lifted.jl")
Expand Down
Loading