Utilities

Base.copy — Method
copy(C::AbstractCode) -> AbstractCode

Return a copy of the code C.

source
CodingTheory.Hamming_distance — Method
Hamming_distance(
    u::Union{Array{S<:Integer, 1}, Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC},
    v::Union{Array{S<:Integer, 1}, Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC}
) -> Any

Return the Hamming distance between u and v.

source
CodingTheory.Hamming_weight — Method
Hamming_weight(
    v::Union{AbstractArray{S<:Integer, 2}, Array{S<:Integer, 1}, LinearAlgebra.Adjoint{S<:Integer, Array{S<:Integer, 1}}, Nemo.FqMatrix, Nemo.fpMatrix, Vector{<:AbstractAlgebra.FinFieldElem}, Hecke.SMat, SparseArrays.SparseMatrixCSC}
) -> Any

Return the Hamming weight of v.

source
CodingTheory.Hermitian_inner_product — Method
Hermitian_inner_product(
    u::Union{Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC},
    v::Union{Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC}
) -> Any

Return the Hermitian inner product of u and v.

source
CodingTheory.are_equivalent_basis — Method
are_equivalent_basis(
    basis::Vector{<:AbstractAlgebra.FinFieldElem},
    basis2::Vector{<:AbstractAlgebra.FinFieldElem}
) -> Bool

Return true if basis is a scalar multiple of basis2.

source
CodingTheory.are_symplectic_orthogonal — Method
are_symplectic_orthogonal(
    A::Union{Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC},
    B::Union{Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC}
) -> Any

Return true if the rows of the matrices A and B are symplectic orthogonal.

source
CodingTheory.complementary_basis — Method
complementary_basis(
    E::AbstractAlgebra.FinField,
    F::AbstractAlgebra.FinField,
    basis::Vector{<:AbstractAlgebra.FinFieldElem}
) -> Union{Missing, Vector}

Return the dual, or complementary, basis of basis for the finite-field extension E/F. This is an alias for dual_basis.

source
CodingTheory.digits_to_int — Function
digits_to_int(x::Vector{Int64}) -> Int64
digits_to_int(x::Vector{Int64}, base::Int64) -> Int64

Return the integer represented in base base by the digits in x, ordered from most significant to least significant.

source
CodingTheory.dist — Method
dist(
    u::Union{Array{S<:Integer, 1}, Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC},
    v::Union{Array{S<:Integer, 1}, Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC}
) -> Any

Return the Hamming distance between same-typed Oscar finite-field matrices or integer vectors u and v. This is an alias for distance.

source
CodingTheory.distance — Method
distance(
    u::Union{Array{S<:Integer, 1}, Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC},
    v::Union{Array{S<:Integer, 1}, Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC}
) -> Any

Return the Hamming distance between same-typed Oscar finite-field matrices or integer vectors u and v. This is an alias for Hamming_distance.

source
CodingTheory.dual_basis — Method
dual_basis(
    E::AbstractAlgebra.FinField,
    F::AbstractAlgebra.FinField,
    basis::Vector{<:AbstractAlgebra.FinFieldElem}
) -> Union{Missing, Vector}

Return the dual, or complementary, basis of basis for the finite-field extension E/F.

source
CodingTheory.edge_vertex_incidence_graph — Method
edge_vertex_incidence_graph(
    G::Graphs.SimpleGraphs.SimpleGraph{Int64}
) -> Tuple{Graphs.SimpleGraphs.SimpleGraph{Int64}, Vector{Int64}, Vector{Int64}}

Return the edge-vertex incidence graph of G along with the vertex incides of the left and right bipartition.

source
CodingTheory.edge_vertex_incidence_matrix — Method
edge_vertex_incidence_matrix(
    G::Graphs.SimpleGraphs.SimpleGraph{Int64}
) -> Tuple{Matrix{Int64}, Vector{Int64}, Vector{Int64}}

Return the edge-vertex incidence matrix of G along with the vertex incides of the left and right bipartition.

source
CodingTheory.expand_matrix — Method
expand_matrix(
    M::Union{Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC},
    K::AbstractAlgebra.FinField,
    β::Vector{<:AbstractAlgebra.FinFieldElem}
) -> Any

Return the matrix constructed by expanding the elements of M to the subfield K using the basis β for the base ring of M over K.

source
CodingTheory.extended_binomial — Method
extended_binomial(
    x::Union{Int64, UInt64},
    y::Union{Int64, UInt64}
) -> UInt128

Return $\binom{x}{y}$ as a UInt128 when y <= x, and zero otherwise.

source
CodingTheory.extract_bipartition — Method
extract_bipartition(
    G::Graphs.SimpleGraphs.SimpleGraph{Int64}
) -> Tuple{Vector{Int64}, Vector{Int64}}

Return two vectors representing the vertex indices of each side of the bipartition.

source
CodingTheory.group_algebra_element_to_circulant_matrix — Function
group_algebra_element_to_circulant_matrix(
    x::Hecke.GroupAlgebraElem{Nemo.fpFieldElem, Hecke.GroupAlgebra{Nemo.fpFieldElem, Hecke.FinGenAbGroup, Hecke.FinGenAbGroupElem}}
) -> Nemo.fpMatrix
group_algebra_element_to_circulant_matrix(
    x::Hecke.GroupAlgebraElem{Nemo.fpFieldElem, Hecke.GroupAlgebra{Nemo.fpFieldElem, Hecke.FinGenAbGroup, Hecke.FinGenAbGroupElem}},
    type::Symbol
) -> Nemo.fpMatrix

Return the circulant matrix whose first row or column is the coefficients of x if type is :row or :col, respectively.

source
CodingTheory.is_basis — Method
is_basis(
    E::AbstractAlgebra.FinField,
    F::AbstractAlgebra.FinField,
    basis::Vector{<:AbstractAlgebra.FinFieldElem}
) -> Union{Tuple{Bool, Missing}, Tuple{Bool, Vector}}

Return true and the dual (complementary) basis if basis is a basis for E/F, otherwise return false, missing.

source
CodingTheory.is_extension — Method
is_extension(
    E::AbstractAlgebra.FinField,
    F::AbstractAlgebra.FinField
) -> Tuple{Bool, Any}

Return true if E/F is a valid field extension and the degree of the extension; otherwise return false, -1.

source
CodingTheory.is_normal_basis — Method
is_normal_basis(
    E::AbstractAlgebra.FinField,
    F::AbstractAlgebra.FinField,
    basis::Vector{<:AbstractAlgebra.FinFieldElem}
) -> Bool

Return true if basis is a normal basis for E/F.

source
CodingTheory.is_primitive_basis — Method
is_primitive_basis(
    E::AbstractAlgebra.FinField,
    F::AbstractAlgebra.FinField,
    basis::Vector{<:AbstractAlgebra.FinFieldElem}
) -> Bool

Return true if basis is a primitive basis for E/F.

source
CodingTheory.is_self_dual_basis — Method
is_self_dual_basis(
    E::AbstractAlgebra.FinField,
    F::AbstractAlgebra.FinField,
    basis::Vector{<:AbstractAlgebra.FinFieldElem}
) -> Union{Missing, Bool}

Return true if basis is equal to its dual.

source
CodingTheory.is_triorthogonal — Function
is_triorthogonal(G::CTMatrixTypes, verbose::Bool=false)
is_triorthogonal(G::Matrix{Int}, verbose::Bool=false)

Return whether the binary matrix G is triorthogonal.

Notes

  • If the optional parameter verbose is set to true, the first pair or triple of non-orthogonal rows will be identified on the console.
source
CodingTheory.is_valid_bipartition — Method
is_valid_bipartition(
    G::Graphs.SimpleGraphs.SimpleGraph{Int64},
    left::Vector{Int64},
    right::Vector{Int64}
) -> Bool

Return true if the vertices indexed by left and right form a valid bipartition for G.

source
CodingTheory.load_alist — Method
load_alist(file::String) -> Matrix{Int64}

Return a Matrix{Int} object from the matrix stored in the alist file format in file.

source
CodingTheory.mult_order — Method
mult_order(a::Int, prep::Tuple{Int,Int,Vector{Tuple{Int,Int}}}) -> Int

Compute ordn(a) using precomputed tuple from `preparemultordermod(n)`.

source
CodingTheory.normal_basis — Method
normal_basis(
    E::AbstractAlgebra.FinField,
    F::AbstractAlgebra.FinField
) -> Tuple{Any, Union{Missing, Vector}}

Return a normal basis for the finite-field extension E/F and its dual basis.

source
CodingTheory.prepare_mult_order — Method
prepare_mult_order_mod(n::Int) -> Tuple{Int,Int,Vector{Tuple{Int,Int}}}

Precompute data for repeated multiplicative-order queries modulo n. Returns:

  • prep[1] = n
  • prep[2] = phi = φ(n)
  • prep[3] = pf = prime factorization of φ(n) as (p, e) pairs
source
CodingTheory.primitive_basis — Method
primitive_basis(
    E::AbstractAlgebra.FinField,
    F::AbstractAlgebra.FinField
) -> Tuple{Any, Union{Missing, Vector}}

Return a primitive basis for E/F and its dual (complementary) basis.

source
CodingTheory.print_string_array — Function
print_string_array(A::Vector{String})
print_string_array(A::Vector{String}, without_Is)

Return nothing after printing each string in A on its own line. When without_Is is true, print spaces in place of every I.

source
CodingTheory.quadratic_residues — Method
quadratic_residues(
    q::Int64,
    n::Int64
) -> Tuple{Vector{Int64}, Vector{Int64}}

Return the sets of quadratic resides and quadratic non-residues of q and n.

source
CodingTheory.residue_polynomial_to_circulant_matrix — Function
residue_polynomial_to_circulant_matrix(
    f::AbstractAlgebra.ResElem
) -> Any
residue_polynomial_to_circulant_matrix(
    f::AbstractAlgebra.ResElem,
    type::Symbol
) -> Any
Return the circulant matrix whose first row or column is the coefficients of `f` if `type` is `:row` or `:col`, respectively.
source
CodingTheory.row_supports — Method
row_supports(
    M::Union{AbstractAlgebra.MatElem{AbstractAlgebra.Generic.EuclideanRingResidueRingElem{Nemo.fpPolyRingElem}}, Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC}
) -> Any

Return a vector whose $i$th entry lists the indices of the nonzero entries of M[i, :].

source
CodingTheory.row_supports_symplectic — Method
row_supports_symplectic(
    M::Union{Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC}
) -> Vector{Tuple{Vector{Int64}, Vector{Int64}}}

Return a vector whose $i$th entry is a two-tuple of lists giving the indices of the nonzero $X$ and $Z$ entries of M[i, :].

source
CodingTheory.strongly_lower_triangular_reduction — Method
strongly_lower_triangular_reduction(
    A::Union{Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC}
) -> Tuple{Any, Any}

Return a strongly lower triangular basis for the kernel of A and a unit vector basis for the complement of the image of transpose(A).

  • Note
  • This implements Algorithm 1 from https://doi.org/10.48550/arXiv.2204.10812
source
CodingTheory.symplectic_inner_product — Method
symplectic_inner_product(
    u::Union{Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC},
    v::Union{Nemo.FqMatrix, Nemo.fpMatrix, Hecke.SMat, SparseArrays.SparseMatrixCSC}
) -> Any

Return the symplectic inner product of u and v.

source
CodingTheory.verify_complementary_basis — Method
verify_complementary_basis(
    E::AbstractAlgebra.FinField,
    F::AbstractAlgebra.FinField,
    basis::Vector{<:AbstractAlgebra.FinFieldElem},
    dual_basis::Vector{<:AbstractAlgebra.FinFieldElem}
) -> Any

Return true if basis and dual_basis are dual bases for the finite-field extension E/F, and false otherwise. This is an alias for verify_dual_basis.

source
CodingTheory.verify_dual_basis — Method
verify_dual_basis(
    E::AbstractAlgebra.FinField,
    F::AbstractAlgebra.FinField,
    basis::Vector{<:AbstractAlgebra.FinFieldElem},
    dual_basis::Vector{<:AbstractAlgebra.FinFieldElem}
) -> Any

Return whether basis is the dual of dual_basis for the finite-field extension E/F.

source
CodingTheory.weight — Method
weight(
    v::Union{AbstractArray{S<:Integer, 2}, Array{S<:Integer, 1}, LinearAlgebra.Adjoint{S<:Integer, Array{S<:Integer, 1}}, Nemo.FqMatrix, Nemo.fpMatrix, Vector{<:AbstractAlgebra.FinFieldElem}, Hecke.SMat, SparseArrays.SparseMatrixCSC}
) -> Any

Return the Hamming weight of the finite-field or integer vector or matrix v. This is an alias for Hamming_weight and counts all nonzero entries.

source
CodingTheory.wt — Method
wt(
    f::AbstractAlgebra.PolyRingElem{<:AbstractAlgebra.FinFieldElem}
) -> Any

Return the number of nonzero coefficients of the polynomial f.

source
Hecke.:⊕ — Method
⊕(A::CTMatrixTypes, B::CTMatrixTypes)
direct_sum(A::CTMatrixTypes, B::CTMatrixTypes)

Return the direct sum of the two matrices A and B.

source
Hecke.is_regular — Method
is_regular(
    G::Graphs.SimpleGraphs.SimpleGraph{Int64}
) -> Bool

Return true if G is regular.

source
LinearAlgebra.tr — Method
tr(
    x::AbstractAlgebra.FinFieldElem,
    K::AbstractAlgebra.FinField;
    verify
) -> Any

Return the relative trace of x from its base field to the field K.

Notes

  • If the optional parameter verify is set to true, the two fields are checked for compatibility.
source