From 487bd40ca8ff16921131b5d6b49fb76bb8a923df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Fri, 17 Feb 2023 15:09:22 +0100 Subject: [PATCH] fix all pycodestyle E303 warnings in all folders c* --- src/sage/calculus/calculus.py | 1 - src/sage/categories/affine_weyl_groups.py | 1 - src/sage/categories/algebras_with_basis.py | 1 - src/sage/categories/category.py | 2 -- src/sage/categories/classical_crystals.py | 1 - src/sage/categories/coalgebras.py | 1 - ...x_reflection_or_generalized_coxeter_groups.py | 1 - src/sage/categories/crystals.py | 1 - .../graded_connected_hopf_algebras_with_basis.py | 1 - src/sage/categories/examples/sets_cat.py | 6 ------ .../categories/examples/with_realizations.py | 1 - .../filtered_hopf_algebras_with_basis.py | 1 - .../finite_dimensional_algebras_with_basis.py | 2 -- ...dimensional_semisimple_algebras_with_basis.py | 1 - .../categories/generalized_coxeter_groups.py | 1 - src/sage/categories/graded_modules_with_basis.py | 1 - src/sage/categories/hecke_modules.py | 1 - src/sage/categories/semigroups.py | 1 - src/sage/categories/sets_cat.py | 1 - src/sage/categories/topological_spaces.py | 1 - src/sage/categories/weyl_groups.py | 2 -- src/sage/coding/encoder.py | 1 - src/sage/coding/extended_code.py | 16 ---------------- src/sage/coding/golay_code.py | 2 -- src/sage/coding/guruswami_sudan/gs_decoder.py | 3 --- src/sage/coding/information_set_decoder.py | 4 ---- src/sage/coding/linear_code_no_metric.py | 1 - src/sage/coding/punctured_code.py | 9 --------- src/sage/coding/self_dual_codes.py | 1 - src/sage/combinat/designs/bibd.py | 2 -- src/sage/combinat/designs/database.py | 1 - src/sage/combinat/designs/difference_family.py | 4 ---- src/sage/combinat/designs/ext_rep.py | 1 - .../combinat/designs/incidence_structures.py | 1 - .../designs/orthogonal_arrays_build_recursive.py | 1 - .../designs/steiner_quadruple_systems.py | 5 ----- src/sage/combinat/k_tableau.py | 1 - src/sage/combinat/matrices/hadamard_matrix.py | 2 -- src/sage/combinat/root_system/type_B.py | 1 - src/sage/combinat/root_system/type_D.py | 1 - src/sage/combinat/t_sequences.py | 2 -- src/sage/combinat/vector_partition.py | 1 - src/sage/crypto/block_cipher/miniaes.py | 1 - src/sage/crypto/lwe.py | 2 -- src/sage/crypto/mq/sr.py | 7 ------- 45 files changed, 99 deletions(-) diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py index 00da3f9d4af..4fe341a76ca 100644 --- a/src/sage/calculus/calculus.py +++ b/src/sage/calculus/calculus.py @@ -2442,7 +2442,6 @@ def maxima_options(**kwds): syms_default = dict(syms_cur) - def _find_var(name, interface=None): """ Function to pass to Parser for constructing diff --git a/src/sage/categories/affine_weyl_groups.py b/src/sage/categories/affine_weyl_groups.py index 285fe9e45ab..6bc26562b8e 100644 --- a/src/sage/categories/affine_weyl_groups.py +++ b/src/sage/categories/affine_weyl_groups.py @@ -14,7 +14,6 @@ from sage.categories.finite_enumerated_sets import FiniteEnumeratedSets - class AffineWeylGroups(Category_singleton): """ The category of affine Weyl groups diff --git a/src/sage/categories/algebras_with_basis.py b/src/sage/categories/algebras_with_basis.py index dbd7a9a43a1..d2296873b59 100644 --- a/src/sage/categories/algebras_with_basis.py +++ b/src/sage/categories/algebras_with_basis.py @@ -274,7 +274,6 @@ def one(self): # version of module morphism, this would not take # advantage of the block structure - class TensorProducts(TensorProductsCategory): """ The category of algebras with basis constructed by tensor product of algebras with basis diff --git a/src/sage/categories/category.py b/src/sage/categories/category.py index f70455cf1a0..9c6c53470c0 100644 --- a/src/sage/categories/category.py +++ b/src/sage/categories/category.py @@ -1470,7 +1470,6 @@ def _test_category(self, **options): _cmp_key = _cmp_key - ########################################################################## # Construction of the associated abstract classes for parents, elements, ... ########################################################################## @@ -2817,7 +2816,6 @@ def _make_named_class(self, name, method_provider, cache=False, **options): self._make_named_class_cache[key] = result return result - @abstract_method def _make_named_class_key(self, name): r""" diff --git a/src/sage/categories/classical_crystals.py b/src/sage/categories/classical_crystals.py index 490337d0bda..9650dae15a2 100644 --- a/src/sage/categories/classical_crystals.py +++ b/src/sage/categories/classical_crystals.py @@ -107,7 +107,6 @@ def additional_structure(self): """ return None - class ParentMethods: def demazure_character(self, w, f=None): diff --git a/src/sage/categories/coalgebras.py b/src/sage/categories/coalgebras.py index 22a385d5f0d..6e23888617e 100644 --- a/src/sage/categories/coalgebras.py +++ b/src/sage/categories/coalgebras.py @@ -79,7 +79,6 @@ def counit(self, x): and Hopf algebras using the counit. """ - @abstract_method def coproduct(self, x): """ diff --git a/src/sage/categories/complex_reflection_or_generalized_coxeter_groups.py b/src/sage/categories/complex_reflection_or_generalized_coxeter_groups.py index 6ddd62e0099..004bc2331ce 100644 --- a/src/sage/categories/complex_reflection_or_generalized_coxeter_groups.py +++ b/src/sage/categories/complex_reflection_or_generalized_coxeter_groups.py @@ -842,7 +842,6 @@ def is_reducible(self): """ return not self.is_irreducible() - class ElementMethods: def apply_simple_reflection_left(self, i): r""" diff --git a/src/sage/categories/crystals.py b/src/sage/categories/crystals.py index 980bebc9f84..f74340cf25d 100644 --- a/src/sage/categories/crystals.py +++ b/src/sage/categories/crystals.py @@ -388,7 +388,6 @@ def __iter__(self, index_set=None, max_depth=float('inf')): R = RecursivelyEnumeratedSet(self.module_generators, succ, structure=None) return R.breadth_first_search_iterator(max_depth) - def subcrystal(self, index_set=None, generators=None, max_depth=float("inf"), direction="both", contained=None, virtualization=None, scaling_factors=None, diff --git a/src/sage/categories/examples/graded_connected_hopf_algebras_with_basis.py b/src/sage/categories/examples/graded_connected_hopf_algebras_with_basis.py index 4e044441d2c..b67e01a4b02 100644 --- a/src/sage/categories/examples/graded_connected_hopf_algebras_with_basis.py +++ b/src/sage/categories/examples/graded_connected_hopf_algebras_with_basis.py @@ -44,7 +44,6 @@ def __init__(self, base_ring): CombinatorialFreeModule.__init__(self, base_ring, NonNegativeIntegers(), category=GradedHopfAlgebrasWithBasis(base_ring).Connected()) - @cached_method def one_basis(self): """ diff --git a/src/sage/categories/examples/sets_cat.py b/src/sage/categories/examples/sets_cat.py index 93cc264580d..cd5201e2c43 100644 --- a/src/sage/categories/examples/sets_cat.py +++ b/src/sage/categories/examples/sets_cat.py @@ -149,9 +149,6 @@ def _element_constructor_(self, e): element_class = Integer - - - from sage.misc.abstract_method import abstract_method class PrimeNumbers_Abstract(UniqueRepresentation, Parent): """ @@ -556,9 +553,6 @@ def _integer_(self, IntRing): return IntRing(self.value) - - - #*************************************************************************# class PrimeNumbers_Facade(PrimeNumbers_Abstract): r""" diff --git a/src/sage/categories/examples/with_realizations.py b/src/sage/categories/examples/with_realizations.py index 06e060f8925..d99cfba3a3a 100644 --- a/src/sage/categories/examples/with_realizations.py +++ b/src/sage/categories/examples/with_realizations.py @@ -301,7 +301,6 @@ def super_categories(self): return [A.Realizations(), category.Realizations().WithBasis()] - class ParentMethods: def from_set(self, *args): diff --git a/src/sage/categories/filtered_hopf_algebras_with_basis.py b/src/sage/categories/filtered_hopf_algebras_with_basis.py index d93f89422da..08888c78313 100644 --- a/src/sage/categories/filtered_hopf_algebras_with_basis.py +++ b/src/sage/categories/filtered_hopf_algebras_with_basis.py @@ -65,7 +65,6 @@ def super_categories(self): R = self.base_category().base_ring() return [HopfAlgebras(R).Filtered()] - class Connected(CategoryWithAxiom_over_base_ring): class ParentMethods: @cached_method diff --git a/src/sage/categories/finite_dimensional_algebras_with_basis.py b/src/sage/categories/finite_dimensional_algebras_with_basis.py index 6d2a713ece1..542cf09d425 100644 --- a/src/sage/categories/finite_dimensional_algebras_with_basis.py +++ b/src/sage/categories/finite_dimensional_algebras_with_basis.py @@ -313,7 +313,6 @@ def semisimple_quotient(self): result.rename("Semisimple quotient of {}".format(self)) return result - @cached_method def center_basis(self): r""" @@ -819,7 +818,6 @@ def peirce_summand(self, ei, ej): return self.submodule([self.from_vector(v) for v in ideal.basis()], already_echelonized=True) - def peirce_decomposition(self, idempotents=None, check=True): r""" Return a Peirce decomposition of ``self``. diff --git a/src/sage/categories/finite_dimensional_semisimple_algebras_with_basis.py b/src/sage/categories/finite_dimensional_semisimple_algebras_with_basis.py index 36ad56fdaae..59ab6a9a8ad 100644 --- a/src/sage/categories/finite_dimensional_semisimple_algebras_with_basis.py +++ b/src/sage/categories/finite_dimensional_semisimple_algebras_with_basis.py @@ -105,7 +105,6 @@ def central_orthogonal_idempotents(self): return tuple([x.lift() for x in self.center().central_orthogonal_idempotents()]) - class Commutative(CategoryWithAxiom_over_base_ring): class ParentMethods: diff --git a/src/sage/categories/generalized_coxeter_groups.py b/src/sage/categories/generalized_coxeter_groups.py index 8a92209299e..a59da41b3f1 100644 --- a/src/sage/categories/generalized_coxeter_groups.py +++ b/src/sage/categories/generalized_coxeter_groups.py @@ -68,7 +68,6 @@ def additional_structure(self): """ return None - class Finite(CategoryWithAxiom): """ The category of finite generalized Coxeter groups. diff --git a/src/sage/categories/graded_modules_with_basis.py b/src/sage/categories/graded_modules_with_basis.py index a53b1de91dd..1868147bedb 100644 --- a/src/sage/categories/graded_modules_with_basis.py +++ b/src/sage/categories/graded_modules_with_basis.py @@ -67,7 +67,6 @@ def degree_negation(self, element): for key, value in element.monomial_coefficients(copy=False).items()]) - def submodule(self, gens, check=True, already_echelonized=False, unitriangular=False, support_order=None, category=None, *args, **opts): diff --git a/src/sage/categories/hecke_modules.py b/src/sage/categories/hecke_modules.py index 88331973496..6b593d4fb3a 100644 --- a/src/sage/categories/hecke_modules.py +++ b/src/sage/categories/hecke_modules.py @@ -84,7 +84,6 @@ def super_categories(self): R = self.base_ring() return [ModulesWithBasis(R)] - def _repr_object_names(self): """ Return the names of the objects of this category. diff --git a/src/sage/categories/semigroups.py b/src/sage/categories/semigroups.py index d053b20e3c0..8e60690e631 100644 --- a/src/sage/categories/semigroups.py +++ b/src/sage/categories/semigroups.py @@ -510,7 +510,6 @@ def _pow_int(self, n): raise ArithmeticError("only positive powers are supported in a semigroup") return generic_power(self, n) - class SubcategoryMethods: @cached_method diff --git a/src/sage/categories/sets_cat.py b/src/sage/categories/sets_cat.py index 9f9bab84e23..bc3c55e9029 100644 --- a/src/sage/categories/sets_cat.py +++ b/src/sage/categories/sets_cat.py @@ -2215,7 +2215,6 @@ def example(self): S3 = FiniteEnumeratedSets().example() return cartesian_product([S1, S2, S3]) - class ParentMethods: def __iter__(self): r""" diff --git a/src/sage/categories/topological_spaces.py b/src/sage/categories/topological_spaces.py index 409e6cdcd8f..7ab806e6a2b 100644 --- a/src/sage/categories/topological_spaces.py +++ b/src/sage/categories/topological_spaces.py @@ -141,7 +141,6 @@ def extra_super_categories(self): """ return [TopologicalSpaces().Connected()] - class Compact(CategoryWithAxiom): """ The category of compact topological spaces. diff --git a/src/sage/categories/weyl_groups.py b/src/sage/categories/weyl_groups.py index c6b0338e441..ed094d6554d 100644 --- a/src/sage/categories/weyl_groups.py +++ b/src/sage/categories/weyl_groups.py @@ -349,7 +349,6 @@ def is_pieri_factor(self): return self in self.parent().pieri_factors() - def left_pieri_factorizations(self, max_length=None): r""" Returns all factorizations of ``self`` as `uv`, where `u` @@ -494,7 +493,6 @@ def stanley_symmetric_function_as_polynomial(self, max_length=None): for (u,v) in self.left_pieri_factorizations(max_length) if u != W.one())) - def stanley_symmetric_function(self): r""" Return the affine Stanley symmetric function indexed by ``self``. diff --git a/src/sage/coding/encoder.py b/src/sage/coding/encoder.py index 56f244e3ab9..ba1070633fd 100644 --- a/src/sage/coding/encoder.py +++ b/src/sage/coding/encoder.py @@ -194,7 +194,6 @@ def __call__(self, m): """ return self.encode(m) - def unencode(self, c, nocheck=False): r""" Return the message corresponding to the codeword ``c``. diff --git a/src/sage/coding/extended_code.py b/src/sage/coding/extended_code.py index 83c3c0143c4..6065d4c2c96 100644 --- a/src/sage/coding/extended_code.py +++ b/src/sage/coding/extended_code.py @@ -179,14 +179,6 @@ def random_element(self): return vector(F, c_list) - - - - - - - - class ExtendedCodeExtendedMatrixEncoder(Encoder): r""" Encoder using original code's generator matrix to compute the extended code's one. @@ -286,14 +278,6 @@ def generator_matrix(self): return M - - - - - - - - class ExtendedCodeOriginalCodeDecoder(Decoder): r""" Decoder which decodes through a decoder over the original code. diff --git a/src/sage/coding/golay_code.py b/src/sage/coding/golay_code.py index 029c572209e..16d395ffc15 100644 --- a/src/sage/coding/golay_code.py +++ b/src/sage/coding/golay_code.py @@ -396,8 +396,6 @@ def parity_check_matrix(self): return H - - ####################### registration ############################### GolayCode._registered_encoders["GeneratorMatrix"] = LinearCodeGeneratorMatrixEncoder diff --git a/src/sage/coding/guruswami_sudan/gs_decoder.py b/src/sage/coding/guruswami_sudan/gs_decoder.py index bfc04fee8ed..830d49238dc 100644 --- a/src/sage/coding/guruswami_sudan/gs_decoder.py +++ b/src/sage/coding/guruswami_sudan/gs_decoder.py @@ -534,8 +534,6 @@ def gs_satisfactory(tau, s, l, C = None, n_k = None): n,k = n_k_params(C, n_k) return l > 0 and s > 0 and n * s * (s+1) < (l+1) * (2*s*(n-tau) - (k-1) * l) - - ####################### decoder itself ############################### def __init__(self, code, tau = None, parameters = None, interpolation_alg = None, root_finder = None): r""" @@ -712,7 +710,6 @@ def parameters(self): """ return (self._s, self._ell) - def multiplicity(self): r""" Returns the multiplicity parameter of ``self``. diff --git a/src/sage/coding/information_set_decoder.py b/src/sage/coding/information_set_decoder.py index a2cbf94fc5e..31f6a255643 100644 --- a/src/sage/coding/information_set_decoder.py +++ b/src/sage/coding/information_set_decoder.py @@ -341,8 +341,6 @@ def _latex_(self): return "\\textnormal{{ISD Algorithm ({}) for }}{} \\textnormal{{decoding {} errors}}".format(self._algorithm_name, self.code()._latex_(), _format_decoding_interval(self.decoding_interval())) - - class LeeBrickellISDAlgorithm(InformationSetAlgorithm): r""" The Lee-Brickell algorithm for information-set decoding. @@ -625,8 +623,6 @@ def _calibrate_select(self, estimates): self._time_estimate = estimates[search_size] - - class LinearCodeInformationSetDecoder(Decoder): r""" Information-set decoder for any linear code. diff --git a/src/sage/coding/linear_code_no_metric.py b/src/sage/coding/linear_code_no_metric.py index 9610c4e31ce..5072be89a0e 100644 --- a/src/sage/coding/linear_code_no_metric.py +++ b/src/sage/coding/linear_code_no_metric.py @@ -1148,7 +1148,6 @@ def __init__(self, code, systematic_positions=None): # Test that the systematic positions are an information set self.generator_matrix() - def __eq__(self, other): r""" Tests equality between LinearCodeSystematicEncoder objects. diff --git a/src/sage/coding/punctured_code.py b/src/sage/coding/punctured_code.py index 4b3ae5f0a39..0c85dddbd77 100644 --- a/src/sage/coding/punctured_code.py +++ b/src/sage/coding/punctured_code.py @@ -92,7 +92,6 @@ def _insert_punctured_positions(l, punctured_points, value = None): return final - class PuncturedCode(AbstractLinearCode): r""" Representation of a punctured code. @@ -425,13 +424,6 @@ def generator_matrix(self): return M - - - - - - - class PuncturedCodeOriginalCodeDecoder(Decoder): r""" Decoder decoding through a decoder over the original code of its punctured code. @@ -580,7 +572,6 @@ def _repr_(self): """ return "Decoder of %s through %s" % (self.code(), self.original_decoder()) - def _latex_(self): r""" Returns a latex representation of ``self``. diff --git a/src/sage/coding/self_dual_codes.py b/src/sage/coding/self_dual_codes.py index 49125e8fb01..4dcdcdff82f 100644 --- a/src/sage/coding/self_dual_codes.py +++ b/src/sage/coding/self_dual_codes.py @@ -606,7 +606,6 @@ def self_dual_binary_codes(n): "6":self_dual_codes_18_6,"7":self_dual_codes_18_7,"8":self_dual_codes_18_8} return self_dual_codes - if n == 20: # all of these of these are Type I; 2 of these codes # are formally equivalent but with different automorphism groups; diff --git a/src/sage/combinat/designs/bibd.py b/src/sage/combinat/designs/bibd.py index 72be454ec63..2d93c5d3833 100644 --- a/src/sage/combinat/designs/bibd.py +++ b/src/sage/combinat/designs/bibd.py @@ -333,7 +333,6 @@ def balanced_incomplete_block_design(v, k, lambd=1, existence=False, use_LJCR=Fa else: return BIBD(B.ground_set(), B.blocks(), k=k, lambd=1, copy=False) - if ( (k+lambd)*(k+lambd-1) == lambd*(v+k+lambd-1) and balanced_incomplete_block_design(v+k+lambd, k+lambd, lambd, existence=True) is True): # By removing a block and all points of that block from the @@ -661,7 +660,6 @@ def BIBD_from_TD(v,k,existence=False): return BIBD - def BIBD_from_difference_family(G, D, lambd=None, check=True): r""" Return the BIBD associated to the difference family ``D`` on the group ``G``. diff --git a/src/sage/combinat/designs/database.py b/src/sage/combinat/designs/database.py index 564f1ea141a..d13823082ec 100644 --- a/src/sage/combinat/designs/database.py +++ b/src/sage/combinat/designs/database.py @@ -543,7 +543,6 @@ def OA_8_69(): for BB in OA_8_7: OA.append([B[i] for i in BB]) - # Adding the missing 0..0,1..1,... rows done = sum(O1,[])+sum(O2,[]) missing = [x for x in range(73) if x not in done and x not in oval] diff --git a/src/sage/combinat/designs/difference_family.py b/src/sage/combinat/designs/difference_family.py index ed9bb493616..277c27af950 100644 --- a/src/sage/combinat/designs/difference_family.py +++ b/src/sage/combinat/designs/difference_family.py @@ -923,7 +923,6 @@ def radical_difference_family(K, k, l=1, existence=False, check=True): elif existence: return True - if check and not is_difference_family(K, D, v, k, l): raise RuntimeError("radical_difference_family produced a wrong " "difference family with parameters v={}, " @@ -1807,7 +1806,6 @@ def supplementary_difference_set(q, existence=False, check=True): psi1 = ((1 + P.monomial((q-1)//2)) * theta1).mod(P.monomial(q-1) - 1) psi2 = (1 + (1 + P.monomial((q-1)//2)) * theta2).mod(P.monomial(q-1) - 1) - K1 = list(map(Integer, psi1.exponents())) K2 = list(map(Integer, psi2.exponents())) K3 = list(map(Integer, psi3.exponents())) @@ -1991,7 +1989,6 @@ def skew_supplementary_difference_set(n, existence=False, check=True): True """ - indices = { 67: [[0,3,5,6,9,10,13,14,17,18,20], [0,2,4,9,11,12,13,16,19,21], @@ -2061,7 +2058,6 @@ def generate_set(index_set, cosets): S += cosets[idx] return S - if existence: return n in indices diff --git a/src/sage/combinat/designs/ext_rep.py b/src/sage/combinat/designs/ext_rep.py index 2a463bc793e..6b02f95f2ac 100644 --- a/src/sage/combinat/designs/ext_rep.py +++ b/src/sage/combinat/designs/ext_rep.py @@ -660,7 +660,6 @@ def __init__(self, node): ('block', {}, [[6, 8, 10]])] """ - if isinstance(node, str): node = (node, {}, []) name, attributes, children = node diff --git a/src/sage/combinat/designs/incidence_structures.py b/src/sage/combinat/designs/incidence_structures.py index dfb6c90f652..8ed80d70171 100644 --- a/src/sage/combinat/designs/incidence_structures.py +++ b/src/sage/combinat/designs/incidence_structures.py @@ -2000,7 +2000,6 @@ def is_resolvable(self, certificate=False, solver=None, verbose=0, check=True, else: return True - def coloring(self, k=None, solver=None, verbose=0, *, integrality_tolerance=1e-3): r""" diff --git a/src/sage/combinat/designs/orthogonal_arrays_build_recursive.py b/src/sage/combinat/designs/orthogonal_arrays_build_recursive.py index 526487adb97..833136dbfe9 100644 --- a/src/sage/combinat/designs/orthogonal_arrays_build_recursive.py +++ b/src/sage/combinat/designs/orthogonal_arrays_build_recursive.py @@ -1604,7 +1604,6 @@ def brouwer_separable_design(k,t,q,x,check=False,verbose=False,explain_construct # The set of size x OA.extend([N-xx-1 for xx in B] for B in orthogonal_array(k,x)) - # iv) elif (x == q**2+1 and orthogonal_array( k , x ,existence=True) and # d0 diff --git a/src/sage/combinat/designs/steiner_quadruple_systems.py b/src/sage/combinat/designs/steiner_quadruple_systems.py index 2a8713fe323..ee8d8102f28 100644 --- a/src/sage/combinat/designs/steiner_quadruple_systems.py +++ b/src/sage/combinat/designs/steiner_quadruple_systems.py @@ -190,7 +190,6 @@ def three_n_minus_eight(B): for i in range(3): Y.append([r(i,x) if x<= n-5 else x+2*(n-4) for x in s]) - # Line 3. for a in range(4): for aa in range(n-4): @@ -198,7 +197,6 @@ def three_n_minus_eight(B): aaaa = -(a+aa+aaa)%(n-4) Y.append([r(0,aa),r(1,aaa), r(2,aaaa),3*(n-4)+a]) - # Line 4. k = (n-14) // 12 for i in range(3): @@ -335,8 +333,6 @@ def four_n_minus_six(B): Y.append([r(h,0,2*c+eps) , r(h,1,2*cc-eps), r(h+1,0,rc), r(h+1,0,sc)]) Y.append([r(h,0,2*c-1+eps), r(h,1,2*cc-eps), r(h+1,1,rc), r(h+1,1,sc)]) - - # Line 8/9 for h in range(2): for eps in range(2): @@ -347,7 +343,6 @@ def four_n_minus_six(B): Y.append([r(h,0,2*c+eps) , r(h,1,2*cc-eps), r(h+1,1,rc), r(h+1,1,sc)]) Y.append([r(h,0,2*c-1+eps), r(h,1,2*cc-eps), r(h+1,0,rc), r(h+1,0,sc)]) - # Line 10 for h in range(2): for alpha in range(n-3): diff --git a/src/sage/combinat/k_tableau.py b/src/sage/combinat/k_tableau.py index 24f00e12926..5fb1d56b82c 100644 --- a/src/sage/combinat/k_tableau.py +++ b/src/sage/combinat/k_tableau.py @@ -1215,7 +1215,6 @@ def _height_of_restricted_subword(self, sw, r): return max(v[0] for v in L + R) - class WeakTableaux_core(WeakTableaux_abstract): r""" The class of (skew) weak `k`-tableaux in the core representation of shape ``shape`` diff --git a/src/sage/combinat/matrices/hadamard_matrix.py b/src/sage/combinat/matrices/hadamard_matrix.py index 91f73d29101..fa21194866b 100644 --- a/src/sage/combinat/matrices/hadamard_matrix.py +++ b/src/sage/combinat/matrices/hadamard_matrix.py @@ -937,7 +937,6 @@ def _get_baumert_hall_units(n, existence=False): """ assert n%4 == 0 and n > 0 - delta_codes_len = n//4 if not four_symbol_delta_code_smallcases(delta_codes_len, existence=True): if existence: @@ -1037,7 +1036,6 @@ def hadamard_matrix_turyn_type(a, b, c, d, e1, e2, e3, e4, check=True): for j in range(i+1, len(units)): assert units[i]*units[j].T + units[j]*units[i].T == 0*I(t4) - H = e1.tensor_product(A) + e2.tensor_product(B) + e3.tensor_product(C) + e4.tensor_product(D) if check: assert is_hadamard_matrix(H) diff --git a/src/sage/combinat/root_system/type_B.py b/src/sage/combinat/root_system/type_B.py index 9175d87bfa7..7a9b634b207 100644 --- a/src/sage/combinat/root_system/type_B.py +++ b/src/sage/combinat/root_system/type_B.py @@ -340,7 +340,6 @@ def _default_folded_cartan_type(self): [[i] for i in range(1, n)] + [[n, n + 1]]) - # For unpickling backward compatibility (Sage <= 4.1) from sage.misc.persist import register_unpickle_override register_unpickle_override('sage.combinat.root_system.type_B', diff --git a/src/sage/combinat/root_system/type_D.py b/src/sage/combinat/root_system/type_D.py index be106a845a7..d250a3643b6 100644 --- a/src/sage/combinat/root_system/type_D.py +++ b/src/sage/combinat/root_system/type_D.py @@ -116,7 +116,6 @@ def fundamental_weight(self, i): return self.sum(self.monomial(j) for j in range(i)) - from sage.misc.persist import register_unpickle_override register_unpickle_override('sage.combinat.root_system.type_A', 'ambient_space', AmbientSpace) diff --git a/src/sage/combinat/t_sequences.py b/src/sage/combinat/t_sequences.py index 883d55c87bd..73993267638 100644 --- a/src/sage/combinat/t_sequences.py +++ b/src/sage/combinat/t_sequences.py @@ -215,7 +215,6 @@ def is_T_sequences_set(sequences, verbose=False): print(f"T-Sequence should contain 4 sequences, found {len(sequences)} instead") return False - t = len(sequences[0]) for i in range(t): @@ -684,7 +683,6 @@ def is_base_sequences_tuple(base_sequences, verbose=False): print(f'Base sequences should only contiain -1, +1, found {el}') return False - for j in range(1, n+p): autocorr = _nonperiodic_autocorrelation(A, j) + _nonperiodic_autocorrelation(B, j) + _nonperiodic_autocorrelation(C, j) + _nonperiodic_autocorrelation(D, j) if autocorr != 0: diff --git a/src/sage/combinat/vector_partition.py b/src/sage/combinat/vector_partition.py index ba1a51c29d4..03a142c8034 100644 --- a/src/sage/combinat/vector_partition.py +++ b/src/sage/combinat/vector_partition.py @@ -102,7 +102,6 @@ def IntegerVectorsIterator(vect, min = None): yield [j] + vec - class VectorPartition(CombinatorialElement): r""" A vector partition is a multiset of integer vectors. diff --git a/src/sage/crypto/block_cipher/miniaes.py b/src/sage/crypto/block_cipher/miniaes.py index 49cb0564d2c..95fcf1a258c 100644 --- a/src/sage/crypto/block_cipher/miniaes.py +++ b/src/sage/crypto/block_cipher/miniaes.py @@ -1510,7 +1510,6 @@ def shift_row(self, block): [block[1][1], block[1][0]] ] ) return mat - ### conversion functions to convert between different data formats def GF_to_binary(self, G): diff --git a/src/sage/crypto/lwe.py b/src/sage/crypto/lwe.py index bc027e97362..4c6ef830987 100644 --- a/src/sage/crypto/lwe.py +++ b/src/sage/crypto/lwe.py @@ -345,7 +345,6 @@ def _repr_(self): else: return "LWE(%d, %d, %s, %s, %s)"%(self.n,self.K.order(),self.D,self.secret_dist, self.m) - def __call__(self): """ EXAMPLES:: @@ -581,7 +580,6 @@ def _repr_(self): else: return "RingLWE(%d, %d, %s, %s, %s, %s)"%(self.N, self.K.order(), self.D, self.poly, self.secret_dist, self.m) - def __call__(self): """ EXAMPLES:: diff --git a/src/sage/crypto/mq/sr.py b/src/sage/crypto/mq/sr.py index 81ae146e204..9f28d216923 100644 --- a/src/sage/crypto/mq/sr.py +++ b/src/sage/crypto/mq/sr.py @@ -963,7 +963,6 @@ def mix_columns(self, d): # AES uses the column major ordering return Matrix(k, d.ncols(), d.nrows(), ret).transpose() - def add_round_key(self, d, key): r""" Perform the ``AddRoundKey`` operation on @@ -1509,7 +1508,6 @@ def _insert_matrix_into_matrix(self, dst, src, row, col): dst[row+i, col+j] = src[i, j] return dst - def varformatstr(self, name, n=None, rc=None, e=None): r""" Return a format string which is understood by print et al. @@ -1799,7 +1797,6 @@ def ring(self, order=None, reverse_variables=None): else: names = self.varstrs("k", 0, r*c, e) - for _n in process(list(range(n))): names += self.varstrs("k", _n+1, r*c, e) names += self.varstrs("x", _n+1, r*c, e) @@ -1880,7 +1877,6 @@ def round_polynomials(self, i, plaintext=None, ciphertext=None): lin = (wj + ki + M * xj + rcon).list() - wi = Matrix(R, r*c*e, 1, _vars("w", i, r*c, e)) xi = Matrix(R, r*c*e, 1, _vars("x", i, r*c, e)) sbox = [] @@ -2713,8 +2709,6 @@ def mix_columns_matrix(self): k = self.k a = k.gen() - - if r == 1: M = Matrix(k, r, r, 1) @@ -2777,7 +2771,6 @@ def lin_matrix(self, length=None): 1, 0, 1, 1, \ 1, 1, 0, 1]) - Z = Z.transpose() # account for endianess mismatch lin = Matrix(GF(2), length*e, length*e)