|
11 | 11 | """
|
12 | 12 |
|
13 | 13 | from sage.misc.fast_methods import WithEqualityById
|
| 14 | +from sage.misc.lazy_import import lazy_import |
14 | 15 | from sage.structure.sage_object import SageObject
|
15 | 16 | from sage.rings.finite_rings.finite_field_constructor import FiniteField
|
16 | 17 | from sage.rings.integer import Integer
|
17 |
| -import sage.databases.conway |
| 18 | + |
| 19 | +lazy_import('sage.databases.conway', 'ConwayPolynomials') |
| 20 | + |
18 | 21 |
|
19 | 22 | def conway_polynomial(p, n):
|
20 | 23 | """
|
@@ -57,7 +60,7 @@ def conway_polynomial(p, n):
|
57 | 60 | (p, n) = (int(p), int(n))
|
58 | 61 | R = FiniteField(p)['x']
|
59 | 62 | try:
|
60 |
| - return R(sage.databases.conway.ConwayPolynomials()[p][n]) |
| 63 | + return R(ConwayPolynomials()[p][n]) |
61 | 64 | except KeyError:
|
62 | 65 | raise RuntimeError("requested Conway polynomial not in database.")
|
63 | 66 |
|
@@ -91,7 +94,7 @@ def exists_conway_polynomial(p, n):
|
91 | 94 | sage: exists_conway_polynomial(6,6)
|
92 | 95 | False
|
93 | 96 | """
|
94 |
| - return sage.databases.conway.ConwayPolynomials().has_polynomial(p,n) |
| 97 | + return ConwayPolynomials().has_polynomial(p,n) |
95 | 98 |
|
96 | 99 | class PseudoConwayLattice(WithEqualityById, SageObject):
|
97 | 100 | r"""
|
@@ -171,7 +174,7 @@ def __init__(self, p, use_database=True):
|
171 | 174 | from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing
|
172 | 175 | self.ring = PolynomialRing(FiniteField(p), 'x')
|
173 | 176 | if use_database:
|
174 |
| - C = sage.databases.conway.ConwayPolynomials() |
| 177 | + C = ConwayPolynomials() |
175 | 178 | self.nodes = {n: self.ring(C.polynomial(p, n))
|
176 | 179 | for n in C.degrees(p)}
|
177 | 180 | else:
|
|
0 commit comments