Skip to content

Commit 38b4d02

Browse files
author
Matthias Koeppe
committed
src/sage/coding/linear_code.py: Fix formatting of doctest tags
1 parent 432ec9b commit 38b4d02

File tree

1 file changed

+22
-17
lines changed

1 file changed

+22
-17
lines changed

src/sage/coding/linear_code.py

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ def __init__(self, base_field, length, default_encoder_name, default_decoder_nam
410410
1
411411
sage: C.is_self_orthogonal()
412412
False
413-
sage: print(C.divisor()) #long time
413+
sage: print(C.divisor()) #long time
414414
1
415415
"""
416416
from sage.coding.information_set_decoder import LinearCodeInformationSetDecoder
@@ -910,12 +910,12 @@ def covering_radius(self):
910910
EXAMPLES::
911911
912912
sage: C = codes.HammingCode(GF(2), 5)
913-
sage: C.covering_radius() # optional - gap_package_guava
913+
sage: C.covering_radius() # optional - gap_package_guava
914914
...
915915
1
916916
917917
sage: C = codes.random_linear_code(GF(263), 5, 1)
918-
sage: C.covering_radius() # optional - gap_package_guava
918+
sage: C.covering_radius() # optional - gap_package_guava
919919
Traceback (most recent call last):
920920
...
921921
NotImplementedError: the GAP algorithm that Sage is using
@@ -1374,7 +1374,7 @@ def minimum_distance(self, algorithm=None):
13741374
sage: C.minimum_distance(algorithm="gap") # optional - sage.libs.gap
13751375
3
13761376
sage: libgap.SetAllInfoLevels(0) # to suppress extra info messages # optional - sage.libs.gap
1377-
sage: C.minimum_distance(algorithm="guava") # optional - gap_package_guava
1377+
sage: C.minimum_distance(algorithm="guava") # optional - gap_package_guava
13781378
...
13791379
3
13801380
@@ -1612,8 +1612,8 @@ def permutation_automorphism_group(self, algorithm="partition"):
16121612
[5, 3] Hamming Code over GF(4)
16131613
sage: G = C.permutation_automorphism_group(algorithm="partition"); G # optional - sage.groups
16141614
Permutation Group with generators [(1,3)(4,5), (1,4)(3,5)]
1615-
sage: GG = C.permutation_automorphism_group(algorithm="codecan") # long time, optional - sage.groups
1616-
sage: GG == G # long time, optional - sage.groups
1615+
sage: GG = C.permutation_automorphism_group(algorithm="codecan") # long time, optional - sage.groups
1616+
sage: GG == G # long time, optional - sage.groups
16171617
True
16181618
sage: C.permutation_automorphism_group(algorithm="gap") # optional - gap_package_guava sage.groups
16191619
Permutation Group with generators [(1,3)(4,5), (1,4)(3,5)]
@@ -1845,17 +1845,19 @@ def weight_distribution(self, algorithm=None):
18451845
[1, 0, 0, 7, 7, 0, 0, 1]
18461846
sage: C.weight_distribution(algorithm="binary")
18471847
[1, 0, 0, 7, 7, 0, 0, 1]
1848+
1849+
sage: # optional - gap_package_guava
18481850
sage: C = codes.HammingCode(GF(3), 3); C
18491851
[13, 10] Hamming Code over GF(3)
1850-
sage: C.weight_distribution() == C.weight_distribution(algorithm="leon") # optional - gap_package_guava
1852+
sage: C.weight_distribution() == C.weight_distribution(algorithm="leon")
18511853
True
18521854
sage: C = codes.HammingCode(GF(5), 2); C
18531855
[6, 4] Hamming Code over GF(5)
1854-
sage: C.weight_distribution() == C.weight_distribution(algorithm="leon") # optional - gap_package_guava
1856+
sage: C.weight_distribution() == C.weight_distribution(algorithm="leon")
18551857
True
18561858
sage: C = codes.HammingCode(GF(7), 2); C
18571859
[8, 6] Hamming Code over GF(7)
1858-
sage: C.weight_distribution() == C.weight_distribution(algorithm="leon") # optional - gap_package_guava
1860+
sage: C.weight_distribution() == C.weight_distribution(algorithm="leon")
18591861
True
18601862
18611863
"""
@@ -2001,14 +2003,17 @@ def zeta_polynomial(self, name="T"):
20012003
sage: C = codes.HammingCode(GF(2), 3)
20022004
sage: C.zeta_polynomial()
20032005
2/5*T^2 + 2/5*T + 1/5
2004-
sage: C = codes.databases.best_linear_code_in_guava(6,3,GF(2)) # optional - gap_package_guava
2005-
sage: C.minimum_distance() # optional - gap_package_guava
2006+
2007+
sage: C = codes.databases.best_linear_code_in_guava(6, 3, GF(2)) # optional - gap_package_guava
2008+
sage: C.minimum_distance() # optional - gap_package_guava
20062009
3
2007-
sage: C.zeta_polynomial() # optional - gap_package_guava
2010+
sage: C.zeta_polynomial() # optional - gap_package_guava
20082011
2/5*T^2 + 2/5*T + 1/5
2012+
20092013
sage: C = codes.HammingCode(GF(2), 4)
20102014
sage: C.zeta_polynomial()
20112015
16/429*T^6 + 16/143*T^5 + 80/429*T^4 + 32/143*T^3 + 30/143*T^2 + 2/13*T + 1/13
2016+
20122017
sage: F.<z> = GF(4,"z")
20132018
sage: MS = MatrixSpace(F, 3, 6)
20142019
sage: G = MS([[1,0,0,1,z,z],[0,1,0,z,1,z],[0,0,1,z,z,1]])
@@ -2601,7 +2606,7 @@ class LinearCodeSyndromeDecoder(Decoder):
26012606
We build a first syndrome decoder, and pick a ``maximum_error_weight``
26022607
smaller than both the covering radius and half the minimum distance::
26032608
2604-
sage: D = C.decoder("Syndrome", maximum_error_weight = 1)
2609+
sage: D = C.decoder("Syndrome", maximum_error_weight=1)
26052610
sage: D.decoder_type()
26062611
{'always-succeed', 'bounded_distance', 'hard-decision'}
26072612
sage: D.decoding_radius()
@@ -2614,7 +2619,7 @@ class LinearCodeSyndromeDecoder(Decoder):
26142619
``maximum_error_weight`` is chosen to be bigger than half the minimum distance,
26152620
but lower than the covering radius::
26162621
2617-
sage: D = C.decoder("Syndrome", maximum_error_weight = 3)
2622+
sage: D = C.decoder("Syndrome", maximum_error_weight=3)
26182623
sage: D.decoder_type()
26192624
{'bounded_distance', 'hard-decision', 'might-error'}
26202625
sage: D.decoding_radius()
@@ -2628,10 +2633,10 @@ class LinearCodeSyndromeDecoder(Decoder):
26282633
And now, we build a third syndrome decoder, whose ``maximum_error_weight``
26292634
is bigger than both the covering radius and half the minimum distance::
26302635
2631-
sage: D = C.decoder("Syndrome", maximum_error_weight = 5) # long time
2632-
sage: D.decoder_type() # long time
2636+
sage: D = C.decoder("Syndrome", maximum_error_weight=5) # long time
2637+
sage: D.decoder_type() # long time
26332638
{'complete', 'hard-decision', 'might-error'}
2634-
sage: D.decoding_radius() # long time
2639+
sage: D.decoding_radius() # long time
26352640
4
26362641
26372642
In that case, the decoder might still return an unexpected codeword, but

0 commit comments

Comments
 (0)