Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit 8185e87

Browse files
committed
Updated to latest beta and fixed conflicts
2 parents 375d4ee + ac2dd76 commit 8185e87

20 files changed

+254
-172
lines changed

src/doc/en/reference/coding/index.rst

+58-34
Original file line numberDiff line numberDiff line change
@@ -3,89 +3,113 @@
33
Coding Theory
44
=============
55

6-
Abstract classes, catalogs and databases
7-
----------------------------------------
6+
Basic Coding Theory objects
7+
---------------------------
8+
89

910
.. toctree::
10-
:maxdepth: 2
11+
:maxdepth: 1
1112

13+
sage/coding/linear_code
14+
sage/coding/channel_constructions
1215
sage/coding/decoder
1316
sage/coding/encoder
14-
sage/coding/bounds_catalog
17+
18+
Catalogs
19+
--------
20+
21+
.. toctree::
22+
:maxdepth: 2
23+
1524
sage/coding/channels_catalog
1625
sage/coding/codes_catalog
1726
sage/coding/decoders_catalog
1827
sage/coding/encoders_catalog
28+
sage/coding/bounds_catalog
1929
sage/coding/databases
2030
sage/coding/two_weight_db
2131

22-
Linear codes and related constructions
23-
---------------------------------------
32+
Code constructions
33+
------------------
2434

2535
.. toctree::
2636
:maxdepth: 1
2737

2838
sage/coding/binary_code
2939
sage/coding/cyclic_code
3040
sage/coding/linear_code
41+
42+
The named code families below are represented in Sage by their own classes,
43+
allowing specialised implementations of e.g. decoding or computation of properties:
44+
45+
.. toctree::
46+
:maxdepth: 2
47+
3148
sage/coding/grs
3249
sage/coding/hamming_code
33-
sage/coding/guruswami_sudan/gs_decoder
34-
sage/coding/guruswami_sudan/interpolation
35-
sage/coding/guruswami_sudan/utils
36-
sage/coding/subfield_subcode
37-
sage/coding/code_constructions
38-
sage/coding/punctured_code
39-
sage/coding/extended_code
40-
sage/coding/self_dual_codes
41-
sage/coding/guava
42-
sage/coding/binary_code
4350
sage/coding/reed_muller_code
4451

45-
Bounds on codes
46-
---------------
52+
In contrast, for some code families Sage can only construct their generator
53+
matrix and has no other a priori knowledge on them:
4754

4855
.. toctree::
4956
:maxdepth: 1
5057

51-
sage/coding/code_bounds
52-
sage/coding/delsarte_bounds
58+
sage/coding/code_constructions
59+
sage/coding/guava
60+
sage/coding/self_dual_codes
61+
sage/coding/binary_code
5362

54-
Channels and related constructions
55-
----------------------------------
63+
Derived Code Constructions
64+
--------------------------
65+
66+
Sage supports the following derived code constructions. If the constituent code
67+
is from a special code family, the derived codes inherit e.g. decoding or
68+
minimum distance capabilities:
5669

5770
.. toctree::
5871
:maxdepth: 2
5972

60-
sage/coding/channel_constructions
73+
sage/coding/subfield_subcode
74+
sage/coding/punctured_code
75+
sage/coding/extended_code
76+
77+
Other derived constructions that simply produce the modified generator matrix
78+
can be found among the methods of a constructed code.
79+
80+
Methods and Operations related to Linear Codes
81+
----------------------------------------------
6182

62-
Source coding
63-
-------------
6483

6584
.. toctree::
66-
:maxdepth: 1
85+
:maxdepth: 2
6786

68-
sage/coding/source_coding/huffman
87+
sage/coding/codecan/codecan
88+
sage/coding/codecan/autgroup_can_label
6989

70-
Canonical forms
71-
---------------
90+
Source coding
91+
-------------
7292

7393
.. toctree::
7494
:maxdepth: 1
7595

76-
sage/coding/codecan/codecan
77-
sage/coding/codecan/autgroup_can_label
96+
sage/coding/source_coding/huffman
7897

79-
Other tools
80-
-----------
98+
Other modules
99+
-------------
81100

82101
.. toctree::
83102
:maxdepth: 1
84103

85104
sage/coding/relative_finite_field_extension
105+
sage/coding/guruswami_sudan/gs_decoder
106+
sage/coding/guruswami_sudan/interpolation
107+
sage/coding/guruswami_sudan/utils
108+
sage/coding/code_bounds
109+
sage/coding/delsarte_bounds
86110

87111
Deprecated modules
88-
------------------
112+
----------------------------
89113

90114
.. toctree::
91115
:maxdepth: 1

src/sage/coding/all.py

+29-17
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
from __future__ import absolute_import
22

3-
from sage.misc.lazy_import import lazy_import
3+
from sage.misc.lazy_import import lazy_import as _lazy_import
44

5-
lazy_import("sage.coding.code_constructions", ["permutation_action",
5+
_lazy_import("sage.coding.code_constructions", ["permutation_action",
66
"walsh_matrix"])
77

8-
from sage.misc.superseded import deprecated_callable_import
8+
from sage.misc.superseded import \
9+
deprecated_callable_import as _deprecated_callable_import, \
10+
deprecated_function_alias as _deprecated_function_alias
911

10-
deprecated_callable_import(19315,
12+
_deprecated_callable_import(19315,
1113
"sage.coding.code_bounds",
1214
globals(),
1315
locals(),
@@ -31,28 +33,38 @@
3133
("This method soon will not be available in that way."
3234
"Please call codes.bounds.%(name)s instead"))
3335

34-
lazy_import("sage.coding.linear_code", [
36+
_lazy_import("sage.coding.linear_code", [
3537
"LinearCode",
3638
"LinearCodeFromVectorSpace",
3739
"self_orthogonal_binary_codes"])
3840

3941
# Functions removed from the global namespace
40-
lazy_import('sage.coding.databases','best_linear_code_in_guava', "best_known_linear_code",
42+
_lazy_import('sage.coding.databases','best_linear_code_in_guava', "best_known_linear_code",
4143
deprecation=(21165, "best_known_linear_code has moved to sage.coding.databases.best_linear_code_in_guava"))
42-
lazy_import('sage.coding.databases','best_linear_code_in_guava', "best_known_linear_code_www",
44+
_lazy_import('sage.coding.databases','best_linear_code_in_guava', "best_known_linear_code_www",
4345
deprecation=(21165, "best_known_linear_code_www has moved to sage.coding.databases.best_linear_code_in_guava"))
44-
lazy_import('sage.coding.databases','bounds_on_minimum_distance_in_guava', "bounds_minimum_distance",
46+
_lazy_import('sage.coding.databases','bounds_on_minimum_distance_in_guava', "bounds_minimum_distance",
4547
deprecation=(21165, "bounds_minimum_distance has moved to sage.coding.databases.bounds_on_minimum_distance_in_guava"))
46-
lazy_import('sage.coding.databases','self_orthogonal_binary_codes', "self_orthogonal_binary_codes",
48+
_lazy_import('sage.coding.databases','self_orthogonal_binary_codes', "self_orthogonal_binary_codes",
4749
deprecation=(21165, "self_orthogonal_binary_codes has moved to sage.coding.databases.self_orthogonal_binary_codes"))
48-
lazy_import('sage.coding.databases','self_dual_binary_codes', "self_dual_codes_binary",
50+
_lazy_import('sage.coding.databases','self_dual_binary_codes', "self_dual_codes_binary",
4951
deprecation=(21165, "self_dual_codes_binary has moved to sage.coding.databases.self_dual_binary_codes"))
5052

51-
lazy_import("sage.coding.delsarte_bounds", [
52-
"Krawtchouk",
53-
"Kravchuk",
54-
"delsarte_bound_hamming_space",
55-
"delsarte_bound_additive_hamming_space"])
53+
_lazy_import('sage.coding.delsarte_bounds','krawtchouk', "Krawtchouk",
54+
deprecation=(20908, "Krawtchouk will be removed from the global namespace. Please use codes.bounds.krawtchouk instead."))
55+
_lazy_import('sage.coding.delsarte_bounds','krawtchouk', "Kravchuk",
56+
deprecation=(20908, "Kravchuk will be removed from the global namespace. Please use codes.bounds.krawtchouk instead."))
5657

57-
lazy_import('sage.coding', 'codes_catalog', 'codes')
58-
lazy_import('sage.coding', 'channels_catalog', 'channels')
58+
_deprecated_callable_import(20908,
59+
"sage.coding.delsarte_bounds",
60+
globals(),
61+
locals(),
62+
["delsarte_bound_hamming_space",
63+
"delsarte_bound_additive_hamming_space"],
64+
("This function will soon be removed from the global namespace. "
65+
"Please call it using codes.bounds.%(name)s instead"))
66+
67+
68+
69+
_lazy_import('sage.coding', 'codes_catalog', 'codes')
70+
_lazy_import('sage.coding', 'channels_catalog', 'channels')

src/sage/coding/binary_code.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
r"""
2-
Fast binary code routines
2+
Optimized low-level binary code representation
33
44
Some computations with linear binary codes. Fix a basis for $GF(2)^n$.
55
A linear binary code is a linear subspace of $GF(2)^n$, together with

src/sage/coding/bounds_catalog.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
r"""
2-
Index of bounds
2+
Index of bounds on the parameters of codes
33
44
The ``codes.bounds`` object may be used to access the bounds that Sage can compute.
55
@@ -30,6 +30,12 @@
3030
"elias_bound_asymp",
3131
"mrrw1_bound_asymp"])
3232

33+
_lazy_import("sage.coding.delsarte_bounds",
34+
["krawtchouk",
35+
"delsarte_bound_hamming_space",
36+
"delsarte_bound_additive_hamming_space"])
37+
38+
3339
from sage.misc.rest_index_of_methods import gen_rest_table_index as _gen_rest_table_index
3440
import sys as _sys
3541
__doc__ = __doc__.format(INDEX_OF_FUNCTIONS=_gen_rest_table_index(_sys.modules[__name__], only_local_functions=False))

src/sage/coding/channel_constructions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
r"""
2-
Channels
2+
Base class for Channels and commonly used channels
33
44
Given an input space and an output space, a channel takes element from
55
the input space (the message) and transforms it into an element of the output space

src/sage/coding/channels_catalog.py

+16-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
r"""
2-
Index of channels
2+
Index of Channels: the information theoretic notion of transmission
33
44
The ``channels`` object may be used to access the codes that Sage can build.
55
6-
- :func:`channel_constructions.ErrorErasureChannel <sage.coding.channel_constructions.ErrorErasureChannel>`
7-
- :func:`channel_constructions.StaticErrorRateChannel <sage.coding.channel_constructions.StaticErrorRateChannel>`
8-
9-
- :func:`channel_constructions.QarySymmetricChannel <sage.coding.channel_constructions.QarySymmetricChannel>`
6+
- :class:`channel_constructions.ErrorErasureChannel <sage.coding.channel_constructions.ErrorErasureChannel>`
7+
- :class:`channel_constructions.QarySymmetricChannel <sage.coding.channel_constructions.QarySymmetricChannel>`
8+
- :class:`channel_constructions.StaticErrorRateChannel <sage.coding.channel_constructions.StaticErrorRateChannel>`
109
1110
.. NOTE::
1211
@@ -15,6 +14,17 @@
1514
sage: from sage.coding.channels_catalog import *
1615
1716
"""
17+
#*****************************************************************************
18+
# Copyright (C) 2015 David Lucas <[email protected]>
19+
#
20+
# Distributed under the terms of the GNU General Public License (GPL),
21+
# version 2 or later (at your preference).
22+
#
23+
# http://www.gnu.org/licenses/
24+
#*****************************************************************************
1825
from __future__ import absolute_import
1926

20-
from .channel_constructions import (ErrorErasureChannel, StaticErrorRateChannel, QarySymmetricChannel)
27+
from sage.misc.lazy_import import lazy_import as _lazy_import
28+
_lazy_import('sage.coding.channel_constructions', ['ErrorErasureChannel',
29+
'QarySymmetricChannel',
30+
'StaticErrorRateChannel'])

src/sage/coding/code_constructions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
r"""
2-
Linear code constructors that do not preserve the structural information.
2+
Linear code constructors that do not preserve the structural information
33
44
This file contains a variety of constructions which builds the generator matrix
55
of special (or random) linear codes and wraps them in a

src/sage/coding/codecan/codecan.pyx

+7
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,13 @@ is returned by generators::
8181
sage: A = P.get_autom_gens()
8282
sage: all( [(a*mat).echelon_form() == mat.echelon_form() for a in A])
8383
True
84+
85+
REFERENCES:
86+
87+
.. [Feu2009] Thomas Feulner, The Automorphism Groups of Linear Codes and
88+
Canonical Representatives of Their Semilinear Isometry Classes, Advances in
89+
Mathematics of Communications 3 (4), pp. 363-383, 2009.
90+
8491
"""
8592
8693
#*******************************************************************************

src/sage/coding/codes_catalog.py

+37-24
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
r"""
2-
Index of codes
2+
Index of code constructions
33
44
The ``codes`` object may be used to access the codes that Sage can build.
55
@@ -12,38 +12,51 @@
1212
sage: from sage.coding.codes_catalog import *
1313
1414
"""
15-
from __future__ import absolute_import
15+
#*****************************************************************************
16+
# Copyright (C) 2009 David Lucas <[email protected]>
17+
#
18+
# Distributed under the terms of the GNU General Public License (GPL),
19+
# version 2 or later (at your preference).
20+
#
21+
# http://www.gnu.org/licenses/
22+
#*****************************************************************************
23+
1624

1725
# Implementation note:
1826
#
1927
# This module is imported as "codes" in all.py so that codes.<tab> is available
2028
# in the global namespace.
2129

30+
from __future__ import absolute_import
2231
from sage.misc.lazy_import import lazy_import as _lazy_import
2332

24-
from .linear_code import LinearCode
25-
from .code_constructions import (BCHCode, BinaryGolayCode, CyclicCodeFromGeneratingPolynomial,
26-
CyclicCodeFromCheckPolynomial, DuadicCodeEvenPair,
27-
DuadicCodeOddPair, ExtendedBinaryGolayCode,
28-
ExtendedQuadraticResidueCode, ExtendedTernaryGolayCode,
29-
from_parity_check_matrix,
30-
LinearCodeFromCheckMatrix, #deprecated
31-
QuadraticResidueCode, QuadraticResidueCodeEvenPair,
32-
QuadraticResidueCodeOddPair,
33-
random_linear_code,
34-
RandomLinearCode, #deprecated
35-
ReedSolomonCode, TernaryGolayCode,
36-
ToricCode, WalshCode)
37-
38-
from .grs import GeneralizedReedSolomonCode
39-
from .reed_muller_code import ReedMullerCode, BinaryReedMullerCode
40-
from .extended_code import ExtendedCode
41-
from .subfield_subcode import SubfieldSubcode
42-
43-
from .guava import QuasiQuadraticResidueCode, RandomLinearCodeGuava
33+
from sage.coding.linear_code import LinearCode
34+
35+
_lazy_import('sage.coding.code_constructions',
36+
['BCHCode', 'BinaryGolayCode', 'CyclicCodeFromGeneratingPolynomial',
37+
'CyclicCode', 'CyclicCodeFromCheckPolynomial', 'DuadicCodeEvenPair',
38+
'DuadicCodeOddPair', 'ExtendedBinaryGolayCode',
39+
'ExtendedQuadraticResidueCode', 'ExtendedTernaryGolayCode',
40+
'from_parity_check_matrix',
41+
'LinearCodeFromCheckMatrix', #deprecated
42+
'QuadraticResidueCode', 'QuadraticResidueCodeEvenPair',
43+
'QuadraticResidueCodeOddPair',
44+
'random_linear_code',
45+
'RandomLinearCode', #deprecated
46+
'ReedSolomonCode', 'TernaryGolayCode',
47+
'ToricCode', 'WalshCode'])
48+
49+
_lazy_import('sage.coding.cyclic_code', 'CyclicCode')
50+
_lazy_import('sage.coding.extended_code', 'ExtendedCode')
51+
_lazy_import('sage.coding.grs', 'GeneralizedReedSolomonCode')
52+
_lazy_import('sage.coding.guava', ['QuasiQuadraticResidueCode',
53+
'RandomLinearCodeGuava'])
54+
_lazy_import('sage.coding.hamming_code', 'HammingCode')
4455
_lazy_import('sage.coding.punctured_code', 'PuncturedCode')
45-
from .cyclic_code import CyclicCode
46-
from .hamming_code import HammingCode
56+
_lazy_import('sage.coding.reed_muller_code', ['BinaryReedMullerCode',
57+
'ReedMullerCode'])
58+
_lazy_import('sage.coding.subfield_subcode', 'SubfieldSubcode')
59+
4760
from . import decoders_catalog as decoders
4861
from . import encoders_catalog as encoders
4962
from . import bounds_catalog as bounds

src/sage/coding/decoder.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
r"""
2-
Decoder
2+
Base class for Decoders
33
44
Representation of an error-correction algorithm for a code.
55

0 commit comments

Comments
 (0)