Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
sage.schemes: Consolidate imports from the same module
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Jan 30, 2023
1 parent e545dea commit 44af9b9
Show file tree
Hide file tree
Showing 10 changed files with 108 additions and 122 deletions.
26 changes: 13 additions & 13 deletions src/sage/schemes/elliptic_curves/ell_finite_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,24 @@
# https://www.gnu.org/licenses/
# ****************************************************************************

import sage.groups.generic as generic

from sage.schemes.curves.projective_curve import Hasse_bounds
from .ell_field import EllipticCurve_field
from .constructor import EllipticCurve
from sage.schemes.hyperelliptic_curves.hyperelliptic_finite_field import HyperellipticCurve_finite_field
from sage.arith.functions import lcm
from sage.arith.misc import binomial, GCD as gcd
from sage.groups.additive_abelian.additive_abelian_wrapper import AdditiveAbelianGroupWrapper
from sage.misc.cachefunc import cached_method
from sage.rings.finite_rings.element_base import is_FiniteFieldElement
from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF
from sage.rings.integer import Integer
from sage.rings.integer_ring import ZZ
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF
from sage.rings.polynomial.polynomial_ring import polygen
from sage.rings.finite_rings.element_base import is_FiniteFieldElement
import sage.groups.generic as generic
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.schemes.curves.projective_curve import Hasse_bounds
from sage.schemes.hyperelliptic_curves.hyperelliptic_finite_field import HyperellipticCurve_finite_field

from . import ell_point
from sage.arith.misc import GCD as gcd
from sage.arith.functions import lcm
from sage.arith.misc import binomial
from sage.misc.cachefunc import cached_method
from sage.groups.additive_abelian.additive_abelian_wrapper import AdditiveAbelianGroupWrapper
from .constructor import EllipticCurve
from .ell_field import EllipticCurve_field


class EllipticCurve_finite_field(EllipticCurve_field, HyperellipticCurve_finite_field):
Expand Down
20 changes: 10 additions & 10 deletions src/sage/schemes/elliptic_curves/ell_modular_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,22 +87,22 @@
# http://www.gnu.org/licenses/
#*****************************************************************************

from sage.structure.sage_object import SageObject
from sage.modular.modsym.all import ModularSymbols
from sage.arith.misc import (kronecker as kronecker_symbol,
next_prime,
prime_divisors,
valuation)
from sage.databases.cremona import parse_cremona_label

from sage.arith.misc import next_prime
from sage.arith.misc import kronecker as kronecker_symbol
from sage.arith.misc import prime_divisors
from sage.arith.misc import valuation
from sage.misc.verbose import verbose
from sage.modular.cusps import Cusps
from sage.modular.modsym.all import ModularSymbols
from sage.rings.infinity import unsigned_infinity as infinity
from sage.rings.integer import Integer
from sage.modular.cusps import Cusps
from sage.rings.integer_ring import ZZ
from sage.rings.rational_field import QQ
from sage.misc.verbose import verbose
from sage.structure.sage_object import SageObject

from .constructor import EllipticCurve

from sage.schemes.elliptic_curves.constructor import EllipticCurve

oo = Cusps(infinity)
zero = Integer(0)
Expand Down
3 changes: 1 addition & 2 deletions src/sage/schemes/elliptic_curves/ell_rational_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,9 @@
import sage.rings.all as rings
from sage.rings.power_series_ring import PowerSeriesRing
from sage.rings.infinity import Infinity as oo
from sage.rings.integer_ring import ZZ
from sage.rings.integer_ring import ZZ, IntegerRing
from sage.rings.rational_field import QQ
from sage.rings.integer import Integer
from sage.rings.integer_ring import IntegerRing
from sage.rings.real_mpfr import RealField
from sage.rings.complex_mpfr import ComplexField
from sage.rings.rational_field import RationalField
Expand Down
13 changes: 6 additions & 7 deletions src/sage/schemes/elliptic_curves/gal_reps_number_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,17 @@
# https://www.gnu.org/licenses/
# ****************************************************************************

from sage.structure.sage_object import SageObject
from sage.rings.number_field.number_field import NumberField
from sage.arith.misc import legendre_symbol, primes
from sage.misc.functional import cyclotomic_polynomial
from sage.modules.free_module import VectorSpace
from sage.rings.finite_rings.finite_field_constructor import GF
from sage.misc.functional import cyclotomic_polynomial
from sage.arith.misc import legendre_symbol
from sage.arith.misc import primes
from sage.sets.set import Set
from sage.rings.infinity import Infinity
from sage.rings.integer import Integer
from sage.rings.integer_ring import ZZ
from sage.rings.number_field.number_field import NumberField
from sage.rings.rational_field import QQ
from sage.rings.infinity import Infinity
from sage.sets.set import Set
from sage.structure.sage_object import SageObject


class GaloisRepresentation(SageObject):
Expand Down
45 changes: 19 additions & 26 deletions src/sage/schemes/elliptic_curves/heegner.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,41 +92,34 @@
# https://www.gnu.org/licenses/
# ****************************************************************************


from sage.misc.misc_c import prod
from sage.misc.verbose import verbose
from sage.misc.cachefunc import cached_method

from sage.structure.sage_object import SageObject
from sage.structure.richcmp import (richcmp_method, richcmp,
richcmp_not_equal, rich_to_bool)

import sage.rings.abc
import sage.rings.number_field.number_field_element
import sage.rings.number_field.number_field as number_field
import sage.rings.all as rings
from sage.rings.integer_ring import ZZ
from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF
from sage.rings.rational_field import QQ

from sage.arith.functions import lcm
from sage.arith.misc import (binomial, factorial, prime_divisors,
GCD as gcd, XGCD as xgcd)
from sage.matrix.constructor import Matrix as matrix
from sage.matrix.matrix_space import MatrixSpace
from sage.misc.cachefunc import cached_method
from sage.misc.misc_c import prod
from sage.misc.verbose import verbose
from sage.modular.modsym.p1list import P1List
from sage.rings.complex_double import CDF
from sage.rings.finite_rings.integer_mod_ring import IntegerModRing as Integers
from sage.rings.real_mpfr import RealField
from sage.rings.complex_mpfr import ComplexField
from sage.rings.number_field.number_field import QuadraticField
from sage.arith.misc import GCD as gcd
from sage.arith.misc import XGCD as xgcd
from sage.arith.functions import lcm
from sage.arith.misc import prime_divisors
from sage.arith.misc import factorial
from sage.arith.misc import binomial
from sage.rings.factorint import factor_trial_division
from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF
from sage.rings.finite_rings.integer_mod_ring import IntegerModRing as Integers
from sage.rings.integer_ring import ZZ
from sage.rings.number_field.number_field import QuadraticField
from sage.rings.rational_field import QQ
from sage.rings.real_mpfr import RealField
from sage.quadratic_forms.all import (BinaryQF,
BinaryQF_reduced_representatives)
from sage.matrix.matrix_space import MatrixSpace
from sage.matrix.constructor import Matrix as matrix

from sage.modular.modsym.p1list import P1List

from sage.structure.sage_object import SageObject
from sage.structure.richcmp import (richcmp_method, richcmp,
richcmp_not_equal, rich_to_bool)

###############################################################################
#
Expand Down
20 changes: 8 additions & 12 deletions src/sage/schemes/elliptic_curves/hom_velusqrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,16 @@
# https://www.gnu.org/licenses/
# ****************************************************************************

from sage.structure.sequence import Sequence
from sage.structure.all import coercion_model as cm

from sage.misc.cachefunc import cached_method

from sage.misc.misc_c import prod

from sage.structure.richcmp import op_EQ

from sage.rings.integer import Integer
from sage.structure.all import coercion_model as cm
from sage.structure.richcmp import op_EQ
from sage.structure.sequence import Sequence

from sage.schemes.elliptic_curves.constructor import EllipticCurve
from sage.schemes.elliptic_curves.ell_finite_field import EllipticCurve_finite_field
from sage.schemes.elliptic_curves.hom import EllipticCurveHom, compare_via_evaluation
from .constructor import EllipticCurve
from .ell_finite_field import EllipticCurve_finite_field
from .hom import EllipticCurveHom, compare_via_evaluation


# TODO: This is general. It should be elsewhere.
Expand Down Expand Up @@ -1406,11 +1402,11 @@ def _random_example_for_testing():
True
"""
from sage.rings.fast_arith import prime_range
from sage.misc.prandom import choice
from sage.misc.prandom import randrange
from sage.misc.prandom import choice, randrange
from sage.rings.finite_rings.finite_field_constructor import FiniteField as GF
from sage.arith.functions import lcm
from sage.rings.finite_rings.integer_mod import Mod

while True:
p = choice(prime_range(2, 100))
e = randrange(1,5)
Expand Down
12 changes: 5 additions & 7 deletions src/sage/schemes/elliptic_curves/mod_sym_num.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -164,18 +164,16 @@ AUTHORS:
from cysignals.memory cimport sig_malloc, sig_free, sig_realloc
from cysignals.signals cimport sig_check

from sage.arith.misc import euler_phi, kronecker as kronecker_symbol
from sage.misc.cachefunc import cached_method

from sage.misc.misc_c import prod
from sage.misc.verbose import verbose
from sage.rings.complex_mpfr cimport ComplexNumber
from sage.rings.complex_mpfr import ComplexField
from sage.rings.real_mpfr cimport RealNumber, RealField
from sage.rings.rational cimport Rational
from sage.rings.integer cimport Integer
from sage.rings.rational cimport Rational
from sage.rings.real_mpfr cimport RealNumber, RealField

from sage.misc.misc_c import prod
from sage.misc.verbose import verbose
from sage.arith.misc import kronecker as kronecker_symbol
from sage.arith.misc import euler_phi

cdef extern from "<math.h>":
double log(double)
Expand Down
46 changes: 22 additions & 24 deletions src/sage/schemes/elliptic_curves/padic_lseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,35 +61,33 @@
# https://www.gnu.org/licenses/
######################################################################

from sage.rings.integer_ring import ZZ
from sage.rings.rational_field import QQ
from sage.rings.padics.factory import Qp
from sage.rings.infinity import infinity
from sage.rings.laurent_series_ring import LaurentSeriesRing
from sage.rings.power_series_ring import PowerSeriesRing
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.rings.finite_rings.integer_mod_ring import IntegerModRing as Integers

from sage.rings.integer import Integer
from sage.arith.misc import valuation
from sage.arith.misc import binomial
from sage.arith.misc import kronecker as kronecker_symbol
from sage.arith.misc import GCD as gcd
from sage.arith.misc import prime_divisors
from sage.arith.functions import lcm as LCM

from sage.structure.sage_object import SageObject
from sage.structure.richcmp import richcmp_method, richcmp

from sage.misc.functional import denominator
from sage.misc.verbose import verbose, get_verbose

from sage.modules.free_module_element import vector
import sage.matrix.all as matrix
import sage.schemes.hyperelliptic_curves.monsky_washnitzer

from sage.arith.functions import lcm as LCM
from sage.arith.misc import (binomial,
GCD as gcd,
prime_divisors,
kronecker as kronecker_symbol,
valuation)
from sage.functions.log import log
from sage.functions.other import floor
from sage.misc.cachefunc import cached_method
from sage.misc.functional import denominator
from sage.misc.verbose import get_verbose, verbose
from sage.modules.free_module_element import vector
from sage.rings.finite_rings.integer_mod_ring import IntegerModRing as Integers
from sage.rings.infinity import infinity
from sage.rings.integer import Integer
from sage.rings.integer_ring import ZZ
from sage.rings.laurent_series_ring import LaurentSeriesRing
from sage.rings.padics.factory import Qp
from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
from sage.rings.power_series_ring import PowerSeriesRing
from sage.rings.rational_field import QQ
from sage.structure.richcmp import richcmp_method, richcmp
from sage.structure.sage_object import SageObject


@richcmp_method
class pAdicLseries(SageObject):
Expand Down
27 changes: 15 additions & 12 deletions src/sage/schemes/elliptic_curves/padics.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,28 @@
# https://www.gnu.org/licenses/
######################################################################

import math

import sage.rings.all as rings
from . import padic_lseries as plseries
import sage.arith.all as arith
from sage.rings.padics.factory import Qp
from sage.rings.padics.factory import Zp
import sage.matrix.all as matrix
import sage.misc.misc as misc
import sage.rings.all as rings
import sage.schemes.hyperelliptic_curves.hypellfrob
import sage.schemes.hyperelliptic_curves.monsky_washnitzer

from sage.misc.cachefunc import cached_method
from sage.rings.big_oh import O
from sage.rings.finite_rings.integer_mod_ring import IntegerModRing as Integers
from sage.rings.integer import Integer
from sage.rings.big_oh import O
from sage.rings.power_series_ring import PowerSeriesRing
from sage.rings.laurent_series_ring import LaurentSeriesRing
from sage.rings.padics.factory import Qp, Zp
from sage.rings.power_series_ring import PowerSeriesRing
from sage.rings.rational_field import RationalField
import math
import sage.misc.misc as misc
import sage.matrix.all as matrix

from . import padic_lseries as plseries

sqrt = math.sqrt
import sage.schemes.hyperelliptic_curves.monsky_washnitzer
import sage.schemes.hyperelliptic_curves.hypellfrob
from sage.misc.cachefunc import cached_method


def __check_padic_hypotheses(self, p):
r"""
Expand Down
18 changes: 9 additions & 9 deletions src/sage/schemes/elliptic_curves/period_lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,22 @@
"""

import sage.rings.abc

from sage.libs.pari.all import pari
from sage.misc.cachefunc import cached_method
from sage.modules.free_module import FreeModule_generic_pid
from sage.rings.complex_mpfr import ComplexField
from sage.rings.complex_mpfr import ComplexNumber
from sage.rings.infinity import Infinity
from sage.rings.integer_ring import ZZ
from sage.rings.number_field.number_field import refine_embedding
from sage.rings.qqbar import AA, QQbar
from sage.rings.rational_field import QQ
from sage.rings.real_mpfr import RealField
from sage.rings.complex_mpfr import ComplexField
from sage.rings.qqbar import QQbar
from sage.rings.qqbar import AA
import sage.rings.abc
from sage.rings.complex_mpfr import ComplexNumber
from sage.rings.real_mpfr import RealNumber as RealNumber
from sage.rings.number_field.number_field import refine_embedding
from sage.rings.infinity import Infinity
from sage.schemes.elliptic_curves.constructor import EllipticCurve
from sage.misc.cachefunc import cached_method
from sage.structure.richcmp import richcmp_method, richcmp, richcmp_not_equal
from sage.libs.pari.all import pari


class PeriodLattice(FreeModule_generic_pid):
Expand Down

0 comments on commit 44af9b9

Please sign in to comment.