From 471d5551e74dc86c02051def347433f77634b72f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Chapoton?= Date: Sat, 26 Oct 2024 21:41:12 +0200 Subject: [PATCH] autopep8 fixes for E302 in matrix,rings,groups,dynamics --- .../dynamics/arithmetic_dynamics/affine_ds.py | 2 ++ .../dynamics/arithmetic_dynamics/berkovich_ds.py | 1 + .../endPN_automorphism_group.py | 14 ++++++++++++++ .../arithmetic_dynamics/endPN_minimal_model.py | 9 +++++++++ .../dynamics/arithmetic_dynamics/projective_ds.py | 2 ++ src/sage/dynamics/cellular_automata/elementary.py | 1 + src/sage/dynamics/cellular_automata/glca.py | 1 + .../dynamics/complex_dynamics/mandel_julia.py | 2 ++ src/sage/dynamics/finite_dynamical_system.py | 3 +++ .../dynamics/finite_dynamical_system_catalog.py | 3 +++ src/sage/dynamics/surface_dynamics_deprecation.py | 1 + src/sage/groups/abelian_gps/abelian_aut.py | 3 +++ src/sage/groups/abelian_gps/abelian_group_gap.py | 6 ++++++ src/sage/groups/finitely_presented_named.py | 6 ++++++ src/sage/groups/fqf_orthogonal.py | 1 + src/sage/groups/indexed_free_group.py | 2 ++ src/sage/groups/libgap_group.py | 1 + .../groups/matrix_gps/finitely_generated_gap.py | 1 + src/sage/groups/matrix_gps/heisenberg.py | 1 + src/sage/groups/matrix_gps/homset.py | 1 + src/sage/groups/matrix_gps/morphism.py | 1 + src/sage/groups/matrix_gps/named_group_gap.py | 1 + src/sage/groups/perm_gps/cubegroup.py | 2 ++ src/sage/matrix/benchmark.py | 15 +++++++++++++++ .../matrix/matrix_integer_dense_saturation.py | 3 +++ src/sage/matrix/matrix_space.py | 1 + src/sage/rings/asymptotic/growth_group.py | 1 + .../rings/asymptotic/growth_group_cartesian.py | 2 ++ src/sage/rings/complex_interval_field.py | 2 ++ src/sage/rings/finite_rings/conway_polynomials.py | 4 ++++ .../rings/finite_rings/finite_field_pari_ffelt.py | 1 + src/sage/rings/finite_rings/galois_group.py | 2 ++ src/sage/rings/finite_rings/homset.py | 1 + src/sage/rings/finite_rings/maps_finite_field.py | 3 +++ src/sage/rings/function_field/constructor.py | 1 + src/sage/rings/function_field/divisor.py | 2 ++ .../drinfeld_modules/charzero_drinfeld_module.py | 1 + .../drinfeld_modules/drinfeld_module.py | 1 + src/sage/rings/function_field/valuation.py | 1 + src/sage/rings/function_field/valuation_ring.py | 1 + src/sage/rings/ideal.py | 5 +++++ src/sage/rings/lazy_series.py | 3 +++ src/sage/rings/lazy_series_ring.py | 4 ++++ src/sage/rings/monomials.py | 1 + src/sage/rings/polynomial/complex_roots.py | 1 + src/sage/rings/polynomial/ideal.py | 1 + .../rings/polynomial/laurent_polynomial_ideal.py | 1 + .../rings/polynomial/laurent_polynomial_ring.py | 5 +++++ .../polynomial/laurent_polynomial_ring_base.py | 1 + src/sage/rings/polynomial/msolve.py | 3 +++ .../rings/polynomial/multi_polynomial_ideal.py | 2 ++ .../rings/polynomial/multi_polynomial_sequence.py | 2 ++ src/sage/rings/polynomial/ore_function_element.py | 1 + .../polynomial/polynomial_element_generic.py | 3 +++ .../rings/polynomial/polynomial_quotient_ring.py | 1 + src/sage/rings/polynomial/term_order.py | 1 + src/sage/rings/qqbar_decorators.py | 1 + src/sage/rings/quotient_ring.py | 1 + src/sage/rings/ring_extension_homset.py | 1 + 59 files changed, 145 insertions(+) diff --git a/src/sage/dynamics/arithmetic_dynamics/affine_ds.py b/src/sage/dynamics/arithmetic_dynamics/affine_ds.py index c2ad0f04cea..2096d734c85 100644 --- a/src/sage/dynamics/arithmetic_dynamics/affine_ds.py +++ b/src/sage/dynamics/arithmetic_dynamics/affine_ds.py @@ -884,6 +884,7 @@ def degree(self): """ return self.as_scheme_morphism().degree() + class DynamicalSystem_affine_field(DynamicalSystem_affine, SchemeMorphism_polynomial_affine_space_field): @cached_method @@ -985,6 +986,7 @@ def reduce_base_field(self): """ return self.as_scheme_morphism().reduce_base_field().as_dynamical_system() + class DynamicalSystem_affine_finite_field(DynamicalSystem_affine_field, SchemeMorphism_polynomial_affine_space_finite_field): diff --git a/src/sage/dynamics/arithmetic_dynamics/berkovich_ds.py b/src/sage/dynamics/arithmetic_dynamics/berkovich_ds.py index 0c27d8e2bde..f84ab7e94ed 100644 --- a/src/sage/dynamics/arithmetic_dynamics/berkovich_ds.py +++ b/src/sage/dynamics/arithmetic_dynamics/berkovich_ds.py @@ -960,6 +960,7 @@ def __call__(self, x, type_3_pole_check=True): new_radius = max(new_radius, p**(-valuation/prime.absolute_ramification_index())*r**i) return self.domain()(new_center, new_radius) + class DynamicalSystem_Berkovich_affine(DynamicalSystem_Berkovich): r""" A dynamical system of the affine Berkovich line over `\CC_p`. diff --git a/src/sage/dynamics/arithmetic_dynamics/endPN_automorphism_group.py b/src/sage/dynamics/arithmetic_dynamics/endPN_automorphism_group.py index 76ba5864fe6..196da8a081a 100644 --- a/src/sage/dynamics/arithmetic_dynamics/endPN_automorphism_group.py +++ b/src/sage/dynamics/arithmetic_dynamics/endPN_automorphism_group.py @@ -335,6 +335,7 @@ def height_bound(polynomial): return (6*(L2norm_sq)**3) + def PGL_repn(rational_function): r""" Take a linear fraction transformation and represent it as a 2x2 matrix. @@ -365,6 +366,7 @@ def PGL_repn(rational_function): g = rational_function.denominator() return matrix(F, 2, [f[1], f[0], g[1], g[0]]) + def PGL_order(A): r""" Find the multiplicative order of a linear fractional transformation that @@ -402,6 +404,7 @@ def PGL_order(A): return n + def CRT_helper(automorphisms, moduli): r""" Lift the given list of automorphisms to `Zmod(M)`. @@ -449,6 +452,7 @@ def CRT_helper(automorphisms, moduli): return autos, modulus*moduli[0] + def CRT_automorphisms(automorphisms, order_elts, degree, moduli): r""" Compute a maximal list of automorphisms over `Zmod(M)`. @@ -495,6 +499,7 @@ def CRT_automorphisms(automorphisms, order_elts, degree, moduli): # get list of CRT'ed automorphisms return CRT_helper(degree_d_autos, moduli) + def valid_automorphisms(automorphisms_CRT, rational_function, ht_bound, M, return_functions=False): r""" @@ -904,6 +909,7 @@ def automorphism_group_FF(rational_function, absolute=False, iso_type=False, ret else: return G, which_group(G[1]) + def field_descent(sigma, y): r""" Function for descending an element in a field `E` to a subfield `F`. @@ -961,6 +967,7 @@ def field_descent(sigma, y): return x + F(quotient)*a**(steps) + def rational_function_coefficient_descent(rational_function, sigma, poly_ring): r""" Function for descending the coefficients of a rational function from field `E` @@ -1059,6 +1066,7 @@ def rational_function_coerce(rational_function, sigma, S_polys): else: return S_polys([sigma(a) for a in f]) / S_polys([sigma(b) for b in g]) + def rational_function_reduce(rational_function): r""" Force Sage to divide out common factors in numerator and denominator @@ -1084,6 +1092,7 @@ def rational_function_reduce(rational_function): comm_factor = gcd(F,G) return (F.quo_rem(comm_factor)[0]) / (G.quo_rem(comm_factor)[0]) + def three_stable_points(rational_function, invariant_list): r""" Implementation of Algorithm 1 for automorphism groups from @@ -1157,6 +1166,7 @@ def three_stable_points(rational_function, invariant_list): automorphisms.append(s) return automorphisms + def automorphism_group_FF_alg2(rational_function): r""" Implementation of algorithm for determining the absolute automorphism @@ -1455,6 +1465,7 @@ def order_p_automorphisms(rational_function, pre_image): return automorphisms_p + def automorphisms_fixing_pair(rational_function, pair, quad): r""" Compute the set of automorphisms with order prime to the characteristic @@ -1535,6 +1546,7 @@ def automorphisms_fixing_pair(rational_function, pair, quad): return list(set(automorphisms_prime_to_p)) + def automorphism_group_FF_alg3(rational_function): r""" Implementation of Algorithm 3 in the paper by Faber/Manes/Viray [FMV]_ @@ -2125,6 +2137,7 @@ def greedy_independence_check(P, repeated_mult, point_to_mult): if len(source) == n+2: return source, corresponding + def conjugating_set_helper(f, g, num_cpus, source, possible_targets): r""" Return the set of elements in PGL over the base ring @@ -2270,6 +2283,7 @@ def find_conjugations_arrangement(tuples): Conj = find_conjugations_subset(product(*subset_iterators)) return Conj + def is_conjugate_helper(f, g, num_cpus, source, possible_targets): r""" Return if ``f`` is conjugate to ``g``. diff --git a/src/sage/dynamics/arithmetic_dynamics/endPN_minimal_model.py b/src/sage/dynamics/arithmetic_dynamics/endPN_minimal_model.py index c8528c4821f..902f83b55ae 100644 --- a/src/sage/dynamics/arithmetic_dynamics/endPN_minimal_model.py +++ b/src/sage/dynamics/arithmetic_dynamics/endPN_minimal_model.py @@ -473,6 +473,8 @@ def Min(Fun, p, ubRes, conj, all_orbits=False): ################################################### #modification of Bruin-Molnar for all representatives + + def BM_all_minimal(vp, return_transformation=False, D=None): r""" Determine a representative in each `SL(2,\ZZ)` orbit with minimal @@ -623,6 +625,8 @@ def BM_all_minimal(vp, return_transformation=False, D=None): ################################################### #find minimal model + + def HS_minimal(f, return_transformation=False, D=None): r""" Compute a minimal model for the given projective dynamical system. @@ -713,6 +717,8 @@ def HS_minimal(f, return_transformation=False, D=None): return F #find all representatives of orbits for one prime + + def HS_all_minimal_p(p, f, m=None, return_transformation=False): r""" Find a representative in each distinct `SL(2,\ZZ)` orbit with @@ -814,6 +820,8 @@ def HS_all_minimal_p(p, f, m=None, return_transformation=False): return [funct for funct, matr in reps] #find all representatives of orbits + + def HS_all_minimal(f, return_transformation=False, D=None): r""" Determine a representative in each `SL(2,\ZZ)` orbit with minimal resultant. @@ -906,6 +914,7 @@ def HS_all_minimal(f, return_transformation=False, D=None): # Ben Hutz July 2018 #####################################3 + def get_bound_dynamical(F, f, m=1, dynatomic=True, prec=53, emb=None): """ The hyperbolic distance from `j` which must contain the smallest map. diff --git a/src/sage/dynamics/arithmetic_dynamics/projective_ds.py b/src/sage/dynamics/arithmetic_dynamics/projective_ds.py index a74efd9129a..8cd24f6611d 100644 --- a/src/sage/dynamics/arithmetic_dynamics/projective_ds.py +++ b/src/sage/dynamics/arithmetic_dynamics/projective_ds.py @@ -7026,6 +7026,7 @@ def Lattes_to_curve(self, return_conjugation=False, check_lattes=False): return (M, E) return E + class DynamicalSystem_projective_field(DynamicalSystem_projective, SchemeMorphism_polynomial_projective_space_field): @@ -9117,6 +9118,7 @@ def is_newton(self, return_conjugation=False): else: return Npoly.derivative(z) == (z - N_aff[0]).denominator() + class DynamicalSystem_projective_finite_field(DynamicalSystem_projective_field, SchemeMorphism_polynomial_projective_space_finite_field): diff --git a/src/sage/dynamics/cellular_automata/elementary.py b/src/sage/dynamics/cellular_automata/elementary.py index 51f959ed237..1c91687db8c 100644 --- a/src/sage/dynamics/cellular_automata/elementary.py +++ b/src/sage/dynamics/cellular_automata/elementary.py @@ -25,6 +25,7 @@ lazy_import("sage.plot.matrix_plot", "matrix_plot") from sage.misc.constant_function import ConstantFunction + class ElementaryCellularAutomata(SageObject): r""" Elementary cellular automata. diff --git a/src/sage/dynamics/cellular_automata/glca.py b/src/sage/dynamics/cellular_automata/glca.py index ea84884755b..929f1131456 100644 --- a/src/sage/dynamics/cellular_automata/glca.py +++ b/src/sage/dynamics/cellular_automata/glca.py @@ -20,6 +20,7 @@ from sage.typeset.ascii_art import AsciiArt from sage.typeset.unicode_art import UnicodeArt + class GraftalLaceCellularAutomata(SageObject): r""" Graftal Lace Cellular Automata (GLCA). diff --git a/src/sage/dynamics/complex_dynamics/mandel_julia.py b/src/sage/dynamics/complex_dynamics/mandel_julia.py index f21ffca80e4..b95040c2da2 100644 --- a/src/sage/dynamics/complex_dynamics/mandel_julia.py +++ b/src/sage/dynamics/complex_dynamics/mandel_julia.py @@ -58,6 +58,7 @@ EPS = 0.00001 + def mandelbrot_plot(f=None, **kwds): r""" Plot of the Mandelbrot set for a one parameter family of polynomial maps. @@ -498,6 +499,7 @@ def kneading_sequence(theta): KS_str = ''.join(KS) + '*' return KS_str + def julia_plot(f=None, **kwds): r""" Plots the Julia set of a given polynomial ``f``. Users can specify whether diff --git a/src/sage/dynamics/finite_dynamical_system.py b/src/sage/dynamics/finite_dynamical_system.py index d6cfc29feb7..441a498f608 100644 --- a/src/sage/dynamics/finite_dynamical_system.py +++ b/src/sage/dynamics/finite_dynamical_system.py @@ -678,6 +678,7 @@ def is_homomesic(self, h, average=None, find_average=False, elements=None): return True return orbavgs[0] == average + class InvertibleDiscreteDynamicalSystem(DiscreteDynamicalSystem): r""" An invertible discrete dynamical system. @@ -969,6 +970,7 @@ def inverse_evolution_default(self, x): """ return self.orbit(x)[-1] + class FiniteDynamicalSystem(DiscreteDynamicalSystem): r""" A finite discrete dynamical system. @@ -1113,6 +1115,7 @@ def cycles(self): break return cycs + class InvertibleFiniteDynamicalSystem(InvertibleDiscreteDynamicalSystem, FiniteDynamicalSystem): r""" An invertible finite discrete dynamical system. diff --git a/src/sage/dynamics/finite_dynamical_system_catalog.py b/src/sage/dynamics/finite_dynamical_system_catalog.py index 74217178a29..c00083f56c4 100755 --- a/src/sage/dynamics/finite_dynamical_system_catalog.py +++ b/src/sage/dynamics/finite_dynamical_system_catalog.py @@ -28,6 +28,7 @@ FiniteDynamicalSystem, InvertibleDiscreteDynamicalSystem, \ InvertibleFiniteDynamicalSystem + def permutation(pi, invertible=True): r""" Return the invertible finite discrete dynamical system @@ -64,6 +65,7 @@ def permutation(pi, invertible=True): X = range(1, n+1) return InvertibleFiniteDynamicalSystem(X, pi, inverse=pi.inverse(), create_tuple=True) + def one_line(xs): r""" Return the finite discrete dynamical system @@ -148,6 +150,7 @@ def bitstring_rotation(n, ones=None): psi = lambda x: (x[-1],) + x[:-1] return InvertibleFiniteDynamicalSystem(X, phi, inverse=psi) + def striker_sweep(E, predicate, elements, lazy=False): r""" Return the invertible finite discrete dynamical system diff --git a/src/sage/dynamics/surface_dynamics_deprecation.py b/src/sage/dynamics/surface_dynamics_deprecation.py index 9da8f1d0be3..8f6e37fe1b2 100644 --- a/src/sage/dynamics/surface_dynamics_deprecation.py +++ b/src/sage/dynamics/surface_dynamics_deprecation.py @@ -9,6 +9,7 @@ "information at\n" \ " http://www.labri.fr/perso/vdelecro/surface-dynamics/latest/" + def surface_dynamics_deprecation(name): r""" TESTS:: diff --git a/src/sage/groups/abelian_gps/abelian_aut.py b/src/sage/groups/abelian_gps/abelian_aut.py index 7108f311a48..89551916589 100644 --- a/src/sage/groups/abelian_gps/abelian_aut.py +++ b/src/sage/groups/abelian_gps/abelian_aut.py @@ -205,6 +205,7 @@ def matrix(self): m.set_immutable() return m + class AbelianGroupAutomorphismGroup_gap(CachedRepresentation, GroupMixinLibGAP, Group, @@ -407,6 +408,7 @@ def is_subgroup_of(self, G): return False return G.gap().IsSubsemigroup(self).sage() + class AbelianGroupAutomorphismGroup(AbelianGroupAutomorphismGroup_gap): r""" The full automorphism group of a finite abelian group. @@ -467,6 +469,7 @@ def _repr_(self): """ return "Full group of automorphisms of %s" % self.domain() + class AbelianGroupAutomorphismGroup_subgroup(AbelianGroupAutomorphismGroup_gap): r""" Groups of automorphisms of abelian groups. diff --git a/src/sage/groups/abelian_gps/abelian_group_gap.py b/src/sage/groups/abelian_gps/abelian_group_gap.py index 199aa935f56..0c0d6a5f49b 100644 --- a/src/sage/groups/abelian_gps/abelian_group_gap.py +++ b/src/sage/groups/abelian_gps/abelian_group_gap.py @@ -39,6 +39,7 @@ from sage.structure.unique_representation import UniqueRepresentation from sage.categories.groups import Groups + class AbelianGroupElement_gap(ElementLibGAP): r""" An element of an abelian group via libgap. @@ -184,6 +185,7 @@ def order(self): """ return self.gap().Order().sage() + class AbelianGroupElement_polycyclic(AbelianGroupElement_gap): r""" An element of an abelian group using the GAP package ``Polycyclic``. @@ -220,6 +222,7 @@ def exponents(self): """ return tuple(self.gap().Exponents().sage()) + class AbelianGroup_gap(UniqueRepresentation, GroupMixinLibGAP, ParentLibGAP, AbelianGroupBase): r""" Finitely generated abelian groups implemented in GAP. @@ -620,6 +623,7 @@ def subgroup(self, gens): gens = tuple([self(g) for g in gens]) return AbelianGroupSubgroup_gap(self.ambient(), gens) + class AbelianGroupGap(AbelianGroup_gap): r""" Abelian groups implemented using GAP. @@ -730,6 +734,7 @@ def __reduce__(self): """ return AbelianGroupGap, (self.gens_orders(),) + class AbelianGroupSubgroup_gap(AbelianGroup_gap): r""" Subgroups of abelian groups with GAP. @@ -879,6 +884,7 @@ def retract(self, x): """ return self(x) + class AbelianGroupQuotient_gap(AbelianGroup_gap): r""" Quotients of abelian groups by a subgroup. diff --git a/src/sage/groups/finitely_presented_named.py b/src/sage/groups/finitely_presented_named.py index 8b07c5af7df..940d761ef49 100644 --- a/src/sage/groups/finitely_presented_named.py +++ b/src/sage/groups/finitely_presented_named.py @@ -202,6 +202,7 @@ def FinitelyGeneratedAbelianPresentation(int_list): ret_rls = ret_rls + [x[0]**(-1)*x[1]**(-1)*x[0]*x[1] for x in gen_pairs] return FinitelyPresentedGroup(F, tuple(ret_rls)) + def FinitelyGeneratedHeisenbergPresentation(n=1, p=0): r""" Return a finite presentation of the Heisenberg group. @@ -292,6 +293,7 @@ def commutator(a, b): rls += [w**p for w in F.gens()] return FinitelyPresentedGroup(F, tuple(rls)) + def DihedralPresentation(n): r""" Build the Dihedral group of order `2n` as a finitely presented group. @@ -327,6 +329,7 @@ def DihedralPresentation(n): rls = F([1])**n, F([2])**2, (F([1])*F([2]))**2 return FinitelyPresentedGroup( F, rls ) + def DiCyclicPresentation(n): r""" Build the dicyclic group of order `4n`, for `n \geq 2`, as a finitely @@ -455,6 +458,7 @@ def QuaternionPresentation(): rls = F([1])**4, F([2,2,-1,-1]), F([1,2,1,-2]) return FinitelyPresentedGroup(F, rls) + def AlternatingPresentation(n): r""" Build the Alternating group of order `n!/2` as a finitely presented group. @@ -521,6 +525,7 @@ def KleinFourPresentation(): rls = F([1])**2, F([2])**2, F([-1])*F([-2])*F([1])*F([2]) return FinitelyPresentedGroup(F, rls) + def BinaryDihedralPresentation(n): r""" Build a binary dihedral group of order `4n` as a finitely presented group. @@ -561,6 +566,7 @@ def BinaryDihedralPresentation(n): rls = (x**-2 * y**2, x**-2 * z**n, x**-2 * x*y*z) return FinitelyPresentedGroup(F, rls) + def CactusPresentation(n): r""" Build the `n`-fruit cactus group as a finitely presented group. diff --git a/src/sage/groups/fqf_orthogonal.py b/src/sage/groups/fqf_orthogonal.py index 5da64f03212..e5ebd06ccdb 100644 --- a/src/sage/groups/fqf_orthogonal.py +++ b/src/sage/groups/fqf_orthogonal.py @@ -381,6 +381,7 @@ def _repr_(self): """ return "Group of isometries of \n%s\ngenerated by %s elements" % (self.invariant_form(), len(self.gens())) + class ActionOnFqf(Action): r""" Action on a finite quadratic module. diff --git a/src/sage/groups/indexed_free_group.py b/src/sage/groups/indexed_free_group.py index ad484532f13..67a3308d787 100644 --- a/src/sage/groups/indexed_free_group.py +++ b/src/sage/groups/indexed_free_group.py @@ -137,6 +137,7 @@ def group_generators(self): gens = group_generators + class IndexedFreeGroup(IndexedGroup, Group): """ An indexed free group. @@ -297,6 +298,7 @@ def to_word_list(self): return [ (k, sign(e)) for k,e in self._sorted_items() for dummy in range(abs(e))] + class IndexedFreeAbelianGroup(IndexedGroup, AbelianGroup): """ An indexed free abelian group. diff --git a/src/sage/groups/libgap_group.py b/src/sage/groups/libgap_group.py index 09889de4af5..81c7b9dd1df 100644 --- a/src/sage/groups/libgap_group.py +++ b/src/sage/groups/libgap_group.py @@ -36,6 +36,7 @@ from sage.groups.libgap_wrapper import ParentLibGAP, ElementLibGAP from sage.groups.libgap_mixin import GroupMixinLibGAP + class GroupLibGAP(GroupMixinLibGAP, Group, ParentLibGAP): Element = ElementLibGAP diff --git a/src/sage/groups/matrix_gps/finitely_generated_gap.py b/src/sage/groups/matrix_gps/finitely_generated_gap.py index d3403f22f40..70f409b2b54 100644 --- a/src/sage/groups/matrix_gps/finitely_generated_gap.py +++ b/src/sage/groups/matrix_gps/finitely_generated_gap.py @@ -924,6 +924,7 @@ def invariants_of_degree(self, deg, chi=None, R=None): break return list(inv) + def _new_invariant_is_linearly_independent(F, invariants): """ EXAMPLES:: diff --git a/src/sage/groups/matrix_gps/heisenberg.py b/src/sage/groups/matrix_gps/heisenberg.py index f101c27153b..ed71925c5ed 100644 --- a/src/sage/groups/matrix_gps/heisenberg.py +++ b/src/sage/groups/matrix_gps/heisenberg.py @@ -26,6 +26,7 @@ from sage.rings.integer_ring import ZZ from copy import copy + class HeisenbergGroup(UniqueRepresentation, FinitelyGeneratedMatrixGroup_gap): r""" The Heisenberg group of degree `n`. diff --git a/src/sage/groups/matrix_gps/homset.py b/src/sage/groups/matrix_gps/homset.py index b9d25ae0727..02818275424 100644 --- a/src/sage/groups/matrix_gps/homset.py +++ b/src/sage/groups/matrix_gps/homset.py @@ -21,6 +21,7 @@ from sage.misc.lazy_import import lazy_import from sage.misc.superseded import deprecation + def is_MatrixGroupHomset(x): r""" Test whether ``x`` is a matrix group homset. diff --git a/src/sage/groups/matrix_gps/morphism.py b/src/sage/groups/matrix_gps/morphism.py index e2fc2e0fd59..e73ba7e945a 100644 --- a/src/sage/groups/matrix_gps/morphism.py +++ b/src/sage/groups/matrix_gps/morphism.py @@ -15,6 +15,7 @@ from sage.misc.lazy_import import lazy_import + def to_libgap(x): """ Helper to convert ``x`` to a LibGAP matrix or matrix group diff --git a/src/sage/groups/matrix_gps/named_group_gap.py b/src/sage/groups/matrix_gps/named_group_gap.py index 699e351f06d..926ae0649a0 100644 --- a/src/sage/groups/matrix_gps/named_group_gap.py +++ b/src/sage/groups/matrix_gps/named_group_gap.py @@ -18,6 +18,7 @@ from sage.groups.matrix_gps.matrix_group_gap import MatrixGroup_gap from sage.groups.matrix_gps.named_group import NamedMatrixGroup_generic + class NamedMatrixGroup_gap(NamedMatrixGroup_generic, MatrixGroup_gap): def __init__(self, degree, base_ring, special, sage_name, latex_string, diff --git a/src/sage/groups/perm_gps/cubegroup.py b/src/sage/groups/perm_gps/cubegroup.py index 8eadbac39f1..7603da471f9 100644 --- a/src/sage/groups/perm_gps/cubegroup.py +++ b/src/sage/groups/perm_gps/cubegroup.py @@ -128,6 +128,7 @@ ######################################################### # written by Tom Boothby, placed in the public domain + def xproj(x, y, z, r): r""" Return the `x`-projection of `(x,y,z)` rotated by `r`. @@ -347,6 +348,7 @@ def create_poly(face, color): 32: "rbd", } + def index2singmaster(facet): """ Translate index used (eg, 43) to Singmaster facet notation (eg, diff --git a/src/sage/matrix/benchmark.py b/src/sage/matrix/benchmark.py index 8567f869511..b411de7d119 100644 --- a/src/sage/matrix/benchmark.py +++ b/src/sage/matrix/benchmark.py @@ -121,6 +121,7 @@ def report_ZZ(**kwds): # Integer Nullspace + def nullspace_ZZ(n=200, min=0, max=2**32, system='sage'): """ Nullspace over ZZ: @@ -240,6 +241,7 @@ def rank_ZZ(n=700, min=0, max=9, system='sage'): else: raise ValueError('unknown system "%s"' % system) + def rank2_ZZ(n=400, min=0, max=2**64, system='sage'): """ Rank 2 over ZZ: @@ -281,6 +283,7 @@ def rank2_ZZ(n=400, min=0, max=2**64, system='sage'): # Smith Form + def smithform_ZZ(n=128, min=0, max=9, system='sage'): """ Smith Form over ZZ: @@ -366,6 +369,7 @@ def matrix_multiply_ZZ(n=300, min=-9, max=9, system='sage', times=1): else: raise ValueError('unknown system "%s"' % system) + def matrix_add_ZZ(n=200, min=-9, max=9, system='sage', times=50): """ Matrix addition over ZZ @@ -413,6 +417,7 @@ def matrix_add_ZZ(n=200, min=-9, max=9, system='sage', times=50): else: raise ValueError('unknown system "%s"' % system) + def matrix_add_ZZ_2(n=200, bits=16, system='sage', times=50): """ Matrix addition over ZZ. @@ -435,6 +440,7 @@ def matrix_add_ZZ_2(n=200, bits=16, system='sage', times=50): b = 2**bits return matrix_add_ZZ(n=n, min=-b, max=b,system=system, times=times) + def det_ZZ(n=200, min=1, max=100, system='sage'): """ Dense integer determinant over ZZ. @@ -602,6 +608,7 @@ def report_GF(p=16411, **kwds): # Nullspace over GF + def nullspace_GF(n=300, p=16411, system='sage'): """ Given a n+1 x n matrix over GF(p) with random @@ -679,6 +686,7 @@ def charpoly_GF(n=100, p=16411, system='sage'): else: raise ValueError('unknown system "%s"' % system) + def matrix_add_GF(n=1000, p=16411, system='sage',times=100): """ Given two n x n matrix over GF(p) with random entries, add them. @@ -805,6 +813,7 @@ def rank_GF(n=500, p=16411, system='sage'): else: raise ValueError('unknown system "%s"' % system) + def rank2_GF(n=500, p=16411, system='sage'): """ Rank over GF(p): Given a (n + 10) x n matrix over GF(p) with @@ -842,6 +851,7 @@ def rank2_GF(n=500, p=16411, system='sage'): else: raise ValueError('unknown system "%s"' % system) + def det_GF(n=400, p=16411 , system='sage'): """ Dense determinant over GF(p). @@ -905,6 +915,7 @@ def hilbert_matrix(n): # Reduced row echelon form over QQ + def echelon_QQ(n=100, min=0, max=9, system='sage'): """ Given a n x (2*n) matrix over QQ with random integer entries @@ -945,6 +956,7 @@ def echelon_QQ(n=100, min=0, max=9, system='sage'): # Invert a matrix over QQ. + def inverse_QQ(n=100, min=0, max=9, system='sage'): """ Given a n x n matrix over QQ with random integer entries @@ -1067,6 +1079,8 @@ def det_hilbert_QQ(n=80, system='sage'): return float(magma.eval('s')) # inverse of Hilbert matrix + + def invert_hilbert_QQ(n=40, system='sage'): """ Run the benchmark for calculating the inverse of the hilbert @@ -1101,6 +1115,7 @@ def invert_hilbert_QQ(n=40, system='sage'): magma.eval(code) return float(magma.eval('s')) + def MatrixVector_QQ(n=1000,h=100,system='sage',times=1): """ Compute product of square ``n`` matrix by random vector with num and diff --git a/src/sage/matrix/matrix_integer_dense_saturation.py b/src/sage/matrix/matrix_integer_dense_saturation.py index b537b041e08..fdd812597f5 100644 --- a/src/sage/matrix/matrix_integer_dense_saturation.py +++ b/src/sage/matrix/matrix_integer_dense_saturation.py @@ -68,6 +68,7 @@ def p_saturation(A, p, proof=True): H = H.stack(C).hermite_form(include_zero_rows=False, proof=proof) verbose("done saturating", tm) + def random_sublist_of_size(k, n): """ INPUT: @@ -181,6 +182,7 @@ def solve_system_with_difficult_last_row(B, A): verbose("Done getting linear combinations.", tm) return X + def saturation(A, proof=True, p=0, max_dets=5): r""" Compute a saturation matrix of `A`. @@ -283,6 +285,7 @@ def saturation(A, proof=True, p=0, max_dets=5): C = solve_system_with_difficult_last_row(B, A) return C.change_ring(ZZ)._insert_zero_columns(zero_cols) + def index_in_saturation(A, proof=True): r""" The index of A in its saturation. diff --git a/src/sage/matrix/matrix_space.py b/src/sage/matrix/matrix_space.py index 267a818c433..2ba59292d54 100644 --- a/src/sage/matrix/matrix_space.py +++ b/src/sage/matrix/matrix_space.py @@ -2664,6 +2664,7 @@ def _from_dict(self, d, coerce=True, remove_zeros=True): """ return self.element_class(self, d, coerce=coerce) + def dict_to_list(entries, nrows, ncols): r""" Given a dictionary of coordinate tuples, return the list given by diff --git a/src/sage/rings/asymptotic/growth_group.py b/src/sage/rings/asymptotic/growth_group.py index cf9cf74ca70..ca2afc2b92c 100644 --- a/src/sage/rings/asymptotic/growth_group.py +++ b/src/sage/rings/asymptotic/growth_group.py @@ -3671,6 +3671,7 @@ def non_growth_group(self): J = ImaginaryGroup(self.base()) return self._non_growth_group_class_(J, self._var_) + class MonomialGrowthGroupFunctor(AbstractGrowthGroupFunctor): r""" A :class:`construction functor ` diff --git a/src/sage/rings/asymptotic/growth_group_cartesian.py b/src/sage/rings/asymptotic/growth_group_cartesian.py index 0bdb3d4a1eb..19bb7d975a6 100644 --- a/src/sage/rings/asymptotic/growth_group_cartesian.py +++ b/src/sage/rings/asymptotic/growth_group_cartesian.py @@ -253,6 +253,8 @@ def create_object(self, version, args, **kwds): from sage.combinat.posets.cartesian_product import CartesianProductPoset from .growth_group import GenericGrowthGroup + + class GenericProduct(CartesianProductPoset, GenericGrowthGroup): r""" A Cartesian product of growth groups. diff --git a/src/sage/rings/complex_interval_field.py b/src/sage/rings/complex_interval_field.py index 0b6981cf07b..c090d6cdae2 100644 --- a/src/sage/rings/complex_interval_field.py +++ b/src/sage/rings/complex_interval_field.py @@ -49,6 +49,8 @@ from sage.structure.parent import Parent cache = {} + + def ComplexIntervalField(prec=53, names=None): """ Return the complex interval field with real and imaginary parts having diff --git a/src/sage/rings/finite_rings/conway_polynomials.py b/src/sage/rings/finite_rings/conway_polynomials.py index ff5873ee14b..70a851990ad 100644 --- a/src/sage/rings/finite_rings/conway_polynomials.py +++ b/src/sage/rings/finite_rings/conway_polynomials.py @@ -64,6 +64,7 @@ def conway_polynomial(p, n): except KeyError: raise RuntimeError("requested Conway polynomial not in database.") + def exists_conway_polynomial(p, n): """ Check whether the Conway polynomial of degree `n` over ``GF(p)`` @@ -99,6 +100,7 @@ def exists_conway_polynomial(p, n): except ImportError: return False + class PseudoConwayLattice(WithEqualityById, SageObject): r""" A pseudo-Conway lattice over a given finite prime field. @@ -328,6 +330,7 @@ def _find_pow_of_frobenius(p, n, x, y): raise RuntimeError("No appropriate power of Frobenius found") return mod(i, n) + def _crt_non_coprime(running, a): """ Extension of the ``crt`` method of ``IntegerMod`` to the case of @@ -361,6 +364,7 @@ def _crt_non_coprime(running, a): a_modulus = a_val_unit[1] return (running % running_modulus).crt(a % a_modulus) + def _frobenius_shift(K, generators, check_only=False): """ Given a field `K` of degree `n` over ``GF(p)`` and a dictionary diff --git a/src/sage/rings/finite_rings/finite_field_pari_ffelt.py b/src/sage/rings/finite_rings/finite_field_pari_ffelt.py index 9549dbc94b4..6bc637c94b3 100644 --- a/src/sage/rings/finite_rings/finite_field_pari_ffelt.py +++ b/src/sage/rings/finite_rings/finite_field_pari_ffelt.py @@ -21,6 +21,7 @@ from .finite_field_base import FiniteField from .finite_field_constructor import GF + class FiniteField_pari_ffelt(FiniteField): """ Finite fields whose cardinality is a prime power (not a prime), diff --git a/src/sage/rings/finite_rings/galois_group.py b/src/sage/rings/finite_rings/galois_group.py index 32e23a40c44..1cdd70fcbb2 100644 --- a/src/sage/rings/finite_rings/galois_group.py +++ b/src/sage/rings/finite_rings/galois_group.py @@ -8,6 +8,7 @@ from sage.rings.integer_ring import ZZ from sage.rings.finite_rings.hom_finite_field import FiniteFieldHomomorphism_generic, FrobeniusEndomorphism_finite_field + class GaloisGroup_GFElement(AbelianGroupElement): def as_hom(self): r""" @@ -52,6 +53,7 @@ def fixed_field(self): """ return self.as_hom().fixed_field() + class GaloisGroup_GF(GaloisGroup_cyc): r""" The Galois group of a finite field. diff --git a/src/sage/rings/finite_rings/homset.py b/src/sage/rings/finite_rings/homset.py index 6c15d725f43..617f9da0086 100644 --- a/src/sage/rings/finite_rings/homset.py +++ b/src/sage/rings/finite_rings/homset.py @@ -43,6 +43,7 @@ from sage.rings.morphism import RingHomomorphism_im_gens from sage.structure.sequence import Sequence + class FiniteFieldHomset(RingHomset_generic): """ Set of homomorphisms with domain a given finite field. diff --git a/src/sage/rings/finite_rings/maps_finite_field.py b/src/sage/rings/finite_rings/maps_finite_field.py index e68bd5c7b94..dff8679dd1e 100644 --- a/src/sage/rings/finite_rings/maps_finite_field.py +++ b/src/sage/rings/finite_rings/maps_finite_field.py @@ -21,6 +21,7 @@ from sage.categories.morphism import Morphism + class FiniteFieldVectorSpaceIsomorphism(Morphism): """ Base class of the vector space isomorphism between a finite field @@ -70,6 +71,7 @@ def is_surjective(self): """ return True + class MorphismVectorSpaceToFiniteField(FiniteFieldVectorSpaceIsomorphism): """ Isomorphisms from vector spaces to finite fields. @@ -130,6 +132,7 @@ def _call_(self, v): w[i*n:(i+1)*n] = v[i]._vector_() return E(w * self._C) + class MorphismFiniteFieldToVectorSpace(FiniteFieldVectorSpaceIsomorphism): """ Isomorphisms from finite fields to vector spaces diff --git a/src/sage/rings/function_field/constructor.py b/src/sage/rings/function_field/constructor.py index a316c384bd1..098da7b59da 100644 --- a/src/sage/rings/function_field/constructor.py +++ b/src/sage/rings/function_field/constructor.py @@ -39,6 +39,7 @@ from sage.structure.factory import UniqueFactory + class FunctionFieldFactory(UniqueFactory): """ Return the function field in one variable with constant field ``F``. The diff --git a/src/sage/rings/function_field/divisor.py b/src/sage/rings/function_field/divisor.py index 13247abe3b0..8c72b4cdb98 100644 --- a/src/sage/rings/function_field/divisor.py +++ b/src/sage/rings/function_field/divisor.py @@ -74,6 +74,7 @@ from .place import PlaceSet + def divisor(field, data): """ Construct a divisor from the data. @@ -98,6 +99,7 @@ def divisor(field, data): divisor_group = field.divisor_group() return divisor_group.element_class(divisor_group, data) + def prime_divisor(field, place, m=1): """ Construct a prime divisor from the place. diff --git a/src/sage/rings/function_field/drinfeld_modules/charzero_drinfeld_module.py b/src/sage/rings/function_field/drinfeld_modules/charzero_drinfeld_module.py index d183848f296..06a0afdaa41 100644 --- a/src/sage/rings/function_field/drinfeld_modules/charzero_drinfeld_module.py +++ b/src/sage/rings/function_field/drinfeld_modules/charzero_drinfeld_module.py @@ -31,6 +31,7 @@ lazy_import('sage.rings.lazy_series_ring', 'LazyPowerSeriesRing') + class DrinfeldModule_charzero(DrinfeldModule): r""" This class implements Drinfeld `\mathbb{F}_q[T]`-modules defined diff --git a/src/sage/rings/function_field/drinfeld_modules/drinfeld_module.py b/src/sage/rings/function_field/drinfeld_modules/drinfeld_module.py index d225820ab18..c4ad9f1376d 100644 --- a/src/sage/rings/function_field/drinfeld_modules/drinfeld_module.py +++ b/src/sage/rings/function_field/drinfeld_modules/drinfeld_module.py @@ -46,6 +46,7 @@ lazy_import('sage.rings.ring_extension', 'RingExtension_generic') + class DrinfeldModule(Parent, UniqueRepresentation): r""" This class implements Drinfeld `\mathbb{F}_q[T]`-modules. diff --git a/src/sage/rings/function_field/valuation.py b/src/sage/rings/function_field/valuation.py index a192a76beb6..e92600e55b6 100644 --- a/src/sage/rings/function_field/valuation.py +++ b/src/sage/rings/function_field/valuation.py @@ -157,6 +157,7 @@ from sage.rings.valuation.trivial_valuation import TrivialValuation from sage.rings.valuation.mapped_valuation import FiniteExtensionFromLimitValuation, MappedValuation_base + class FunctionFieldValuationFactory(UniqueFactory): r""" Create a valuation on ``domain`` corresponding to ``prime``. diff --git a/src/sage/rings/function_field/valuation_ring.py b/src/sage/rings/function_field/valuation_ring.py index e1fe9751b0b..9269d21ea2d 100644 --- a/src/sage/rings/function_field/valuation_ring.py +++ b/src/sage/rings/function_field/valuation_ring.py @@ -72,6 +72,7 @@ from sage.categories.homset import Hom from sage.categories.rings import Rings + class FunctionFieldValuationRing(UniqueRepresentation, Parent): """ Base class for valuation rings of function fields. diff --git a/src/sage/rings/ideal.py b/src/sage/rings/ideal.py index 4208c63c55c..dc785891828 100644 --- a/src/sage/rings/ideal.py +++ b/src/sage/rings/ideal.py @@ -1457,6 +1457,7 @@ def divides(self, other): return self.gen().divides(other.gen()) raise NotImplementedError + class Ideal_pid(Ideal_principal): """ An ideal of a principal ideal domain. @@ -1694,6 +1695,7 @@ def residue_field(self): return ZZ.residue_field(self, check=False) raise NotImplementedError("residue_field() is only implemented for ZZ and rings of integers of number fields.") + class Ideal_fractional(Ideal_generic): """ Fractional ideal of a ring. @@ -1717,6 +1719,7 @@ def _repr_(self): # constructors for standard (benchmark) ideals, written uppercase as # these are constructors + def Cyclic(R, n=None, homog=False, singular=None): """ Ideal of cyclic ``n``-roots from 1-st ``n`` variables of ``R`` if ``R`` is @@ -1782,6 +1785,7 @@ def Cyclic(R, n=None, homog=False, singular=None): I = singular.cyclic(n).homog(R2.gen(n-1)) return R2.ideal(I).change_ring(R) + def Katsura(R, n=None, homog=False, singular=None): r""" `n`-th katsura ideal of `R` if `R` is coercible to @@ -1832,6 +1836,7 @@ def Katsura(R, n=None, homog=False, singular=None): I = singular.katsura(n).homog(R2.gen(n-1)) return R2.ideal(I).change_ring(R) + def FieldIdeal(R): r""" Let ``q = R.base_ring().order()`` and `(x_0,...,x_n)` ``= R.gens()`` then diff --git a/src/sage/rings/lazy_series.py b/src/sage/rings/lazy_series.py index 8520ad33f68..b48e0e6bc38 100644 --- a/src/sage/rings/lazy_series.py +++ b/src/sage/rings/lazy_series.py @@ -4866,6 +4866,7 @@ def _format_series(self, formatter, format_strings=False): return strformat("O({})".format(formatter(z**m))) return formatter(poly) + strformat(" + O({})".format(formatter(z**m))) + class LazyPowerSeries(LazyCauchyProductSeries): r""" A Taylor series where the coefficients are computed lazily. @@ -6149,6 +6150,7 @@ def _floordiv_(self, other): left._approximate_order += 1 return super()._floordiv_(other) + class LazyPowerSeries_gcd_mixin: """ A lazy power series that also implements the GCD algorithm. @@ -6266,6 +6268,7 @@ def xgcd(self, f): unit = ~unit return (x**val, unit, unit) + class LazyCompletionGradedAlgebraElement(LazyCauchyProductSeries): """ An element of a completion of a graded algebra that is computed lazily. diff --git a/src/sage/rings/lazy_series_ring.py b/src/sage/rings/lazy_series_ring.py index ee3e463e988..7c61f8861b3 100644 --- a/src/sage/rings/lazy_series_ring.py +++ b/src/sage/rings/lazy_series_ring.py @@ -93,6 +93,7 @@ from types import GeneratorType + class LazySeriesRing(UniqueRepresentation, Parent): """ Abstract base class for lazy series. @@ -1233,6 +1234,7 @@ def _test_revert(self, **options): # we want to test at least 2 elements tester.assertGreater(count, 1, msg="only %s elements in %s.some_elements() have a compositional inverse" % (count, self)) + class LazyLaurentSeriesRing(LazySeriesRing): r""" The ring of lazy Laurent series. @@ -3040,6 +3042,7 @@ def some_elements(self): ###################################################################### + class LazySymmetricFunctions(LazyCompletionGradedAlgebra): """ The ring of lazy symmetric functions. @@ -3417,6 +3420,7 @@ def _monomial(self, c, n): except (ValueError, TypeError): return '({})/{}^{}'.format(self.base_ring()(c), n, self.variable_name()) + def _skip_leading_zeros(iterator): """ Return an iterator which discards all leading zeros. diff --git a/src/sage/rings/monomials.py b/src/sage/rings/monomials.py index ed154ab8c06..b10d599b6b3 100644 --- a/src/sage/rings/monomials.py +++ b/src/sage/rings/monomials.py @@ -1,5 +1,6 @@ "Monomials" + def _monomials(gens, R, n, i): """ Given two lists ``gens`` and ``n`` of exactly the same length, diff --git a/src/sage/rings/polynomial/complex_roots.py b/src/sage/rings/polynomial/complex_roots.py index 0c94bac6035..42cf47cad86 100644 --- a/src/sage/rings/polynomial/complex_roots.py +++ b/src/sage/rings/polynomial/complex_roots.py @@ -90,6 +90,7 @@ def interval_roots(p, rts, prec): return irts + def intervals_disjoint(intvs): """ Given a list of complex intervals, check whether they are pairwise diff --git a/src/sage/rings/polynomial/ideal.py b/src/sage/rings/polynomial/ideal.py index 9eba00860b5..bf575cb0339 100644 --- a/src/sage/rings/polynomial/ideal.py +++ b/src/sage/rings/polynomial/ideal.py @@ -19,6 +19,7 @@ from sage.rings.ideal import Ideal_pid + class Ideal_1poly_field(Ideal_pid): """ An ideal in a univariate polynomial ring over a field. diff --git a/src/sage/rings/polynomial/laurent_polynomial_ideal.py b/src/sage/rings/polynomial/laurent_polynomial_ideal.py index ae21901fee1..0403526ae15 100644 --- a/src/sage/rings/polynomial/laurent_polynomial_ideal.py +++ b/src/sage/rings/polynomial/laurent_polynomial_ideal.py @@ -26,6 +26,7 @@ from sage.structure.richcmp import op_EQ, op_NE, op_LT, op_LE, op_GT, op_GE from sage.arith.misc import GCD + class LaurentPolynomialIdeal( Ideal_generic ): def __init__(self, ring, gens, coerce=True, hint=None): r""" diff --git a/src/sage/rings/polynomial/laurent_polynomial_ring.py b/src/sage/rings/polynomial/laurent_polynomial_ring.py index 40b09bbfb6e..2e4cf5ce6ea 100644 --- a/src/sage/rings/polynomial/laurent_polynomial_ring.py +++ b/src/sage/rings/polynomial/laurent_polynomial_ring.py @@ -77,6 +77,8 @@ def is_LaurentPolynomialRing(R): _cache = {} + + def LaurentPolynomialRing(base_ring, *args, **kwds): r""" Return the globally unique univariate or multivariate Laurent polynomial @@ -251,6 +253,7 @@ def LaurentPolynomialRing(base_ring, *args, **kwds): _cache[R] = P return P + def _split_dict_(D, indices, group_by=None): r""" Split the dictionary ``D`` by ``indices`` and ``group_by``. @@ -331,6 +334,7 @@ def extract(T, indices): else: return result + def _split_laurent_polynomial_dict_(P, M, d): r""" Helper function for splitting a multivariate Laurent polynomial @@ -391,6 +395,7 @@ def value(d, R): return sum(P({k: 1}) * value(v, P) for k, v in D.items()).monomial_coefficients() + def from_fraction_field(L, x): r""" Helper function to construct a Laurent polynomial from an element of its diff --git a/src/sage/rings/polynomial/laurent_polynomial_ring_base.py b/src/sage/rings/polynomial/laurent_polynomial_ring_base.py index b4f4f13289e..d9984a656b1 100644 --- a/src/sage/rings/polynomial/laurent_polynomial_ring_base.py +++ b/src/sage/rings/polynomial/laurent_polynomial_ring_base.py @@ -30,6 +30,7 @@ from sage.structure.parent import Parent from sage.combinat.integer_vector import IntegerVectors + class LaurentPolynomialRing_generic(CommutativeRing, Parent): """ Laurent polynomial ring (base class). diff --git a/src/sage/rings/polynomial/msolve.py b/src/sage/rings/polynomial/msolve.py index fb22236fba9..d261bfd70b9 100644 --- a/src/sage/rings/polynomial/msolve.py +++ b/src/sage/rings/polynomial/msolve.py @@ -33,6 +33,7 @@ from sage.rings.real_mpfi import RealIntervalField_class, RealIntervalField from sage.structure.sequence import Sequence + def _run_msolve(ideal, options): r""" Internal utility function @@ -63,6 +64,7 @@ def _run_msolve(ideal, options): return msolve_out.stdout + def groebner_basis_degrevlex(ideal, proof=True): r""" Compute a degrevlex Gröbner basis using msolve @@ -111,6 +113,7 @@ def groebner_basis_degrevlex(ideal, proof=True): gbasis = sage_eval(msolve_out[:-2], locals=drlpolring.gens_dict()) return Sequence(gbasis) + def variety(ideal, ring, *, proof=True): r""" Compute the variety of a zero-dimensional ideal using msolve. diff --git a/src/sage/rings/polynomial/multi_polynomial_ideal.py b/src/sage/rings/polynomial/multi_polynomial_ideal.py index 222da435df2..8e358652be3 100644 --- a/src/sage/rings/polynomial/multi_polynomial_ideal.py +++ b/src/sage/rings/polynomial/multi_polynomial_ideal.py @@ -450,6 +450,7 @@ def _groebner_basis_magma(self, deg_bound=None, prot=False, magma=magma_default) B = PolynomialSequence([R(e) for e in mgb], R, immutable=True) return B + class MPolynomialIdeal_singular_base_repr: @require_field def syzygy_module(self): @@ -3493,6 +3494,7 @@ def _reduce_using_macaulay2(self, f): R = self.ring() return R(k) + class NCPolynomialIdeal(MPolynomialIdeal_singular_repr, Ideal_nc): def __init__(self, ring, gens, coerce=True, side='left'): r""" diff --git a/src/sage/rings/polynomial/multi_polynomial_sequence.py b/src/sage/rings/polynomial/multi_polynomial_sequence.py index 37381c084ac..ff1ec275633 100644 --- a/src/sage/rings/polynomial/multi_polynomial_sequence.py +++ b/src/sage/rings/polynomial/multi_polynomial_sequence.py @@ -377,6 +377,7 @@ def PolynomialSequence(arg1, arg2=None, immutable=False, cr=False, cr_str=None): elif K.degree() > 1: return PolynomialSequence_gf2e(parts, ring, immutable=immutable, cr=cr, cr_str=cr_str) + class PolynomialSequence_generic(Sequence_generic): def __init__(self, parts, ring, immutable=False, cr=False, cr_str=None): """ @@ -1257,6 +1258,7 @@ def is_groebner(self, singular=singular): """ return self.ideal().basis_is_groebner() + class PolynomialSequence_gf2(PolynomialSequence_generic): r""" Polynomial Sequences over `\GF{2}`. diff --git a/src/sage/rings/polynomial/ore_function_element.py b/src/sage/rings/polynomial/ore_function_element.py index fd871fa3b76..d858838f53c 100644 --- a/src/sage/rings/polynomial/ore_function_element.py +++ b/src/sage/rings/polynomial/ore_function_element.py @@ -715,6 +715,7 @@ def _call_(self, x): return numerator.leading_coefficient() / denominator.leading_coefficient() raise TypeError(f"{x} is not a constant function") + class OreFunctionBaseringInjection(Morphism): r""" Representation of the canonical homomorphism from a field `k` into a Ore diff --git a/src/sage/rings/polynomial/polynomial_element_generic.py b/src/sage/rings/polynomial/polynomial_element_generic.py index c3df26200e2..7bbd4e611a9 100644 --- a/src/sage/rings/polynomial/polynomial_element_generic.py +++ b/src/sage/rings/polynomial/polynomial_element_generic.py @@ -1049,6 +1049,7 @@ def number_of_terms(self): """ return len(self.__coeffs) + class Polynomial_generic_domain(Polynomial, IntegralDomainElement): def __init__(self, parent, is_gen=False, construct=False): Polynomial.__init__(self, parent, is_gen=is_gen) @@ -1082,6 +1083,7 @@ def is_unit(self): return False return self[0].is_unit() + class Polynomial_generic_field(Polynomial_singular_repr, Polynomial_generic_domain, EuclideanDomainElement): @@ -1588,6 +1590,7 @@ def _roots(self, secure, minval, hint): class Polynomial_generic_dense_cdv(Polynomial_generic_dense_inexact, Polynomial_generic_cdv): pass + class Polynomial_generic_sparse_cdv(Polynomial_generic_sparse, Polynomial_generic_cdv): pass diff --git a/src/sage/rings/polynomial/polynomial_quotient_ring.py b/src/sage/rings/polynomial/polynomial_quotient_ring.py index e12977e8464..027a8997067 100644 --- a/src/sage/rings/polynomial/polynomial_quotient_ring.py +++ b/src/sage/rings/polynomial/polynomial_quotient_ring.py @@ -262,6 +262,7 @@ def create_object(self, version, key): PolynomialQuotientRing = PolynomialQuotientRingFactory("PolynomialQuotientRing") + def is_PolynomialQuotientRing(x): from sage.misc.superseded import deprecation deprecation(38266, diff --git a/src/sage/rings/polynomial/term_order.py b/src/sage/rings/polynomial/term_order.py index 1bed10ba867..cd5cad00f8f 100644 --- a/src/sage/rings/polynomial/term_order.py +++ b/src/sage/rings/polynomial/term_order.py @@ -539,6 +539,7 @@ 'block' : block_description, } + class TermOrder(SageObject): """ A term order. diff --git a/src/sage/rings/qqbar_decorators.py b/src/sage/rings/qqbar_decorators.py index 7343a0b9b08..9abca887218 100644 --- a/src/sage/rings/qqbar_decorators.py +++ b/src/sage/rings/qqbar_decorators.py @@ -14,6 +14,7 @@ from sage.misc.decorators import decorator_keywords, sage_wraps + @decorator_keywords def handle_AA_and_QQbar(func): r""" diff --git a/src/sage/rings/quotient_ring.py b/src/sage/rings/quotient_ring.py index 4cf3979265f..f98322c2183 100644 --- a/src/sage/rings/quotient_ring.py +++ b/src/sage/rings/quotient_ring.py @@ -1545,6 +1545,7 @@ def _contains_(self, other): J = R.cover_ring().ideal(Igens) return other.lift() in J + class QuotientRingIdeal_principal(ideal.Ideal_principal, QuotientRingIdeal_generic): r""" Specialized class for principal quotient-ring ideals. diff --git a/src/sage/rings/ring_extension_homset.py b/src/sage/rings/ring_extension_homset.py index d2c13a11f0e..1ba55906d9c 100644 --- a/src/sage/rings/ring_extension_homset.py +++ b/src/sage/rings/ring_extension_homset.py @@ -20,6 +20,7 @@ from sage.rings.homset import RingHomset_generic from sage.rings.ring_extension_morphism import RingExtensionHomomorphism + class RingExtensionHomset(RingHomset_generic): r""" A generic class for homsets between ring extensions.