@@ -153,8 +153,8 @@ def to_matrix_representation(v, sub_field=None, basis=None):
153
153
154
154
- ``basis`` -- (default: ``None``) a basis of `F_{q^m}` as a vector space over
155
155
``sub_field``. If not specified, given that `q = p^s`, let
156
- `1,\beta ,\ldots,\beta ^{sm}` be the power basis that SageMath uses to
157
- represent `F_{q^m}`. The default basis is then `1,\beta ,\ldots,beta ^{m-1}`.
156
+ `1,β ,\ldots,β ^{sm}` be the power basis that SageMath uses to
157
+ represent `F_{q^m}`. The default basis is then `1,β ,\ldots,β ^{m-1}`.
158
158
159
159
EXAMPLES::
160
160
@@ -204,8 +204,8 @@ def from_matrix_representation(w, base_field=None, basis=None):
204
204
205
205
- ``basis`` -- (default: ``None``) a basis of `F_{q^m}` as a vector space over
206
206
``F_q``. If not specified, given that `q = p^s`, let
207
- `1,\beta ,\ldots,\beta ^{sm}` be the power basis that SageMath uses to
208
- represent `F_{q^m}`. The default basis is then `1,\beta ,\ldots,beta ^{m-1}`.
207
+ `1,β ,\ldots,β ^{sm}` be the power basis that SageMath uses to
208
+ represent `F_{q^m}`. The default basis is then `1,β ,\ldots,β ^{m-1}`.
209
209
210
210
EXAMPLES::
211
211
@@ -247,8 +247,8 @@ def rank_weight(c, sub_field=None, basis=None):
247
247
248
248
- ``basis`` -- (default: ``None``) a basis of `F_{q^m}` as a vector space over
249
249
``sub_field``. If not specified, given that `q = p^s`, let
250
- `1,\b eta ,\ldots,\b eta ^{sm}` be the power basis that SageMath uses to
251
- represent `F_{q^m}`. The default basis is then `1,\b eta ,\ldots,beta ^{m-1}`.
250
+ `1,β ,\ldots,β ^{sm}` be the power basis that SageMath uses to
251
+ represent `F_{q^m}`. The default basis is then `1,β ,\ldots,β ^{m-1}`.
252
252
253
253
EXAMPLES::
254
254
@@ -284,8 +284,8 @@ def rank_distance(a, b, sub_field=None, basis=None):
284
284
285
285
- ``basis`` -- (default: ``None``) a basis of `F_{q^m}` as a vector space over
286
286
``sub_field``. If not specified, given that `q = p^s`, let
287
- `1,\b eta ,\ldots,\b eta ^{sm}` be the power basis that SageMath uses to
288
- represent `F_{q^m}`. The default basis is then `1,\b eta ,\ldots,beta ^{m-1}`.
287
+ `1,β ,\ldots,β ^{sm}` be the power basis that SageMath uses to
288
+ represent `F_{q^m}`. The default basis is then `1,β ,\ldots,β ^{m-1}`.
289
289
290
290
EXAMPLES::
291
291
@@ -386,8 +386,8 @@ def __init__(self, base_field, sub_field, length, default_encoder_name,
386
386
387
387
- ``basis`` -- (default: ``None``) a basis of `F_{q^m}` as a vector space over
388
388
``sub_field``. If not specified, given that `q = p^s`, let
389
- `1,\b eta ,\ldots,\b eta ^{sm}` be the power basis that SageMath uses to
390
- represent `F_{q^m}`. The default basis is then `1,\b eta ,\ldots,beta ^{m-1}`.
389
+ `1,β ,\ldots,β ^{sm}` be the power basis that SageMath uses to
390
+ represent `F_{q^m}`. The default basis is then `1,β ,\ldots,β ^{m-1}`.
391
391
392
392
EXAMPLES:
393
393
@@ -558,10 +558,11 @@ def minimum_distance(self):
558
558
559
559
EXAMPLES::
560
560
561
- sage: G = Matrix(GF(64), [[1,1,0], [0,0,1]])
562
- sage: C = codes.LinearRankMetricCode(G, GF(4))
561
+ sage: F.<a> = GF(8)
562
+ sage: G = Matrix(F, [[1,a,a^2,0]])
563
+ sage: C = codes.LinearRankMetricCode(G, GF(2))
563
564
sage: C.minimum_distance()
564
- 1
565
+ 3
565
566
"""
566
567
d = Infinity
567
568
for c in self :
@@ -681,8 +682,8 @@ def __init__(self, generator, sub_field=None, basis=None):
681
682
682
683
- ``basis`` -- (default: ``None``) a basis of `F_{q^m}` as a vector space over
683
684
``sub_field``. If not specified, given that `q = p^s`, let
684
- `1,\beta ,\ldots,\beta ^{sm}` be the power basis that SageMath uses to
685
- represent `F_{q^m}`. The default basis is then `1,\beta ,\ldots,beta ^{m-1}`.
685
+ `1,β ,\ldots,β ^{sm}` be the power basis that SageMath uses to
686
+ represent `F_{q^m}`. The default basis is then `1,β ,\ldots,β ^{m-1}`.
686
687
687
688
EXAMPLES::
688
689
@@ -860,6 +861,15 @@ def decode_to_code(self, r):
860
861
OUTPUT:
861
862
862
863
- a vector of ``self``'s message space
864
+
865
+ EXAMPLES::
866
+
867
+ sage: F.<a> = GF(4)
868
+ sage: G = Matrix(F, [[1,1,0]])
869
+ sage: C = codes.LinearRankMetricCode(G, GF(2))
870
+ sage: D = codes.decoders.LinearRankMetricCodeNearestNeighborDecoder(C)
871
+ sage: D.decode_to_code(vector(F, [a, a, 1]))
872
+ (a, a, 0)
863
873
"""
864
874
C = self .code ()
865
875
c_min = C .zero ()
@@ -877,11 +887,12 @@ def decoding_radius(self):
877
887
878
888
EXAMPLES::
879
889
880
- sage: G = Matrix(GF(64), [[1,1,0], [0,0,1]])
881
- sage: C = codes.LinearRankMetricCode(G, GF(4))
890
+ sage: F.<a> = GF(8)
891
+ sage: G = Matrix(F, [[1,a,a^2,0]])
892
+ sage: C = codes.LinearRankMetricCode(G, GF(2))
882
893
sage: D = codes.decoders.LinearRankMetricCodeNearestNeighborDecoder(C)
883
894
sage: D.decoding_radius()
884
- 0
895
+ 1
885
896
"""
886
897
return (self .code ().minimum_distance ()- 1 ) // 2
887
898
0 commit comments