@@ -604,15 +604,16 @@ class EvaluationAGCodeUniqueDecoder(Decoder):
604
604
605
605
if Q.degree() > 1 :
606
606
circuit = EvaluationAGCodeDecoder_K_extension(code._pls, code._G, Q,
607
- verbose = verbose)
607
+ verbose = verbose)
608
608
else :
609
609
circuit = EvaluationAGCodeDecoder_K(code._pls, code._G, Q,
610
- verbose = verbose)
610
+ verbose = verbose)
611
611
612
612
if basis is None :
613
613
basis = code._basis_functions
614
614
615
- C = matrix([circuit.decode(vector(K, [f.evaluate(p) for p in code._pls]))
615
+ C = matrix([circuit.decode(vector(K,
616
+ [f.evaluate(p) for p in code._pls]))
616
617
for f in basis])
617
618
618
619
self ._extension = Q.degree() > 1
@@ -647,7 +648,7 @@ class EvaluationAGCodeUniqueDecoder(Decoder):
647
648
"""
648
649
return hash ((self .code(), self ._Q))
649
650
650
- def __eq__ (self , other ):
651
+ def __eq__ (self , other ) -> bool :
651
652
"""
652
653
Check whether ``other`` equals ``self``.
653
654
@@ -677,7 +678,7 @@ class EvaluationAGCodeUniqueDecoder(Decoder):
677
678
return (self .code() == other.code() and self ._Q == other._Q
678
679
and self ._basis == other._basis)
679
680
680
- def _repr_ (self ):
681
+ def _repr_ (self ) -> str :
681
682
r"""
682
683
Return the string representation of ``self``.
683
684
@@ -699,7 +700,7 @@ class EvaluationAGCodeUniqueDecoder(Decoder):
699
700
"""
700
701
return "Unique decoder for {}".format(self.code())
701
702
702
- def _latex_ (self ):
703
+ def _latex_(self ) -> str :
703
704
r"""
704
705
Return the latex representation of ``self``.
705
706
@@ -757,13 +758,13 @@ class EvaluationAGCodeUniqueDecoder(Decoder):
757
758
else :
758
759
return circuit.encode(vector(K, message) * C)
759
760
760
- def _decode (self , vector , **kwargs ):
761
+ def _decode (self , vect , **kwargs ):
761
762
r """
762
- Return the message decoded from ``vector ``.
763
+ Return the message decoded from the vector ``vect ``.
763
764
764
765
INPUT:
765
766
766
- - ``vector `` -- a vector to be decoded to a message
767
+ - ``vect `` -- a vector to be decoded to a message
767
768
768
769
TESTS::
769
770
@@ -787,10 +788,10 @@ class EvaluationAGCodeUniqueDecoder(Decoder):
787
788
circuit = self ._circuit
788
789
789
790
if self ._extension:
790
- internal_message = circuit.decode(circuit._lift(vector ), ** kwargs) * Cinv
791
+ internal_message = circuit.decode(circuit._lift(vect ), ** kwargs) * Cinv
791
792
return circuit._pull_back(internal_message)
792
- else :
793
- return circuit.decode(vector , ** kwargs) * Cinv
793
+
794
+ return circuit.decode(vect , ** kwargs) * Cinv
794
795
795
796
def connected_encoder (self , *args , **kwargs ):
796
797
r """
@@ -1011,10 +1012,10 @@ class DifferentialAGCodeUniqueDecoder(Decoder):
1011
1012
1012
1013
if Q.degree() > 1 :
1013
1014
circuit = DifferentialAGCodeDecoder_K_extension(code._pls, code._G, Q,
1014
- verbose = verbose)
1015
+ verbose = verbose)
1015
1016
else :
1016
1017
circuit = DifferentialAGCodeDecoder_K(code._pls, code._G, Q,
1017
- verbose = verbose)
1018
+ verbose = verbose)
1018
1019
1019
1020
if basis is None :
1020
1021
basis = code._basis_differentials
@@ -1054,7 +1055,7 @@ class DifferentialAGCodeUniqueDecoder(Decoder):
1054
1055
"""
1055
1056
return hash ((self .code(), self ._Q))
1056
1057
1057
- def __eq__ (self , other ):
1058
+ def __eq__ (self , other ) -> bool :
1058
1059
"""
1059
1060
Check whether ``other`` equals ``self``.
1060
1061
@@ -1084,7 +1085,7 @@ class DifferentialAGCodeUniqueDecoder(Decoder):
1084
1085
return (self .code() == other.code() and self ._Q == other._Q
1085
1086
and self ._basis == other._basis)
1086
1087
1087
- def _repr_ (self ):
1088
+ def _repr_ (self ) -> str :
1088
1089
r"""
1089
1090
Return the string representation of ``self``.
1090
1091
@@ -1106,7 +1107,7 @@ class DifferentialAGCodeUniqueDecoder(Decoder):
1106
1107
"""
1107
1108
return "Unique decoder for {}".format(self.code())
1108
1109
1109
- def _latex_ (self ):
1110
+ def _latex_(self ) -> str :
1110
1111
r"""
1111
1112
Return the latex representation of ``self``.
1112
1113
@@ -1164,13 +1165,13 @@ class DifferentialAGCodeUniqueDecoder(Decoder):
1164
1165
else :
1165
1166
return circuit.encode(vector(K, message) * C)
1166
1167
1167
- def _decode (self , vector , **kwargs ):
1168
+ def _decode (self , vect , **kwargs ):
1168
1169
r """
1169
- Return the message decoded from ``vector ``.
1170
+ Return the message decoded from the vector ``vect ``.
1170
1171
1171
1172
INPUT:
1172
1173
1173
- - ``vector `` -- a vector to be decoded to a message
1174
+ - ``vect `` -- a vector to be decoded to a message
1174
1175
1175
1176
TESTS::
1176
1177
@@ -1194,10 +1195,10 @@ class DifferentialAGCodeUniqueDecoder(Decoder):
1194
1195
circuit = self ._circuit
1195
1196
1196
1197
if self ._extension:
1197
- internal_message = circuit.decode(circuit._lift(vector ), ** kwargs) * Cinv
1198
+ internal_message = circuit.decode(circuit._lift(vect ), ** kwargs) * Cinv
1198
1199
return circuit._pull_back(internal_message)
1199
- else :
1200
- return circuit.decode(vector , ** kwargs) * Cinv
1200
+
1201
+ return circuit.decode(vect , ** kwargs) * Cinv
1201
1202
1202
1203
def connected_encoder (self , *args , **kwargs ):
1203
1204
r """
@@ -1423,7 +1424,7 @@ cdef class Decoder_K():
1423
1424
This modified the ``vec`` input.
1424
1425
"""
1425
1426
cdef Py_ssize_t j, m
1426
- cdef list a, d, s
1427
+ cdef list a, s
1427
1428
cdef FreeModuleElement temp
1428
1429
cdef Polynomial c
1429
1430
@@ -1507,7 +1508,6 @@ cdef class Decoder_K():
1507
1508
coeff_mat = self .coeff_mat
1508
1509
1509
1510
cdef list message_index = self .message_index
1510
- cdef list code_basis = self .code_basis
1511
1511
1512
1512
cdef int s0 = self .s0
1513
1513
cdef int tau = self .tau
@@ -1858,7 +1858,7 @@ cdef class EvaluationAGCodeDecoder_K(Decoder_K):
1858
1858
sage: circuit = EvaluationAGCodeDecoder_K(D, G, Q) # long time
1859
1859
sage: TestSuite(circuit).run(skip='_test_pickling') # long time
1860
1860
"""
1861
- cdef int i, j, s, s0, sk, si, n, r, d, num
1861
+ cdef int i, j, s, s0, sk, si, n, r, d
1862
1862
cdef int code_length, genus, gamma, dLO, tau
1863
1863
cdef list gaps, dR, yR, dRbar, yRbar, evyRbar, nus, mul_mat
1864
1864
cdef list message_index, code_basis
@@ -2113,7 +2113,7 @@ cdef class DifferentialAGCodeDecoder_K(Decoder_K):
2113
2113
sage: circuit = DifferentialAGCodeDecoder_K(D, G, Q) # long time
2114
2114
sage: TestSuite(circuit).run(skip='_test_pickling') # long time
2115
2115
"""
2116
- cdef int i, j, s, s0, sk, si, n, r, d, num
2116
+ cdef int i, j, s, s0, sk, si, n, r, d
2117
2117
cdef int code_length, genus, gamma, dLO, tau
2118
2118
cdef list gaps, dR, yR, dWbar, wWbar, reswWbar, nus, mul_mat
2119
2119
cdef list message_index, code_basis
@@ -2387,7 +2387,7 @@ cdef class Decoder_K_extension():
2387
2387
# construct constant field extension F_ext of F
2388
2388
def_poly = F.polynomial().base_extend(F_ext_base)
2389
2389
F_ext = F_ext_base.extension(def_poly, names = def_poly.variable_name())
2390
- else : # rational function field
2390
+ else : # rational function field
2391
2391
F_ext = F_ext_base
2392
2392
2393
2393
O_ext = F_ext.maximal_order()
0 commit comments