diff --git a/python/sage_helper.py b/python/sage_helper.py index 1d5a8e8a..f790378c 100644 --- a/python/sage_helper.py +++ b/python/sage_helper.py @@ -34,9 +34,11 @@ def sage_method(function): from sage.all import (cached_method, real_part, imag_part, round, ceil, floor, log, CDF, ComplexField, NumberField, PolynomialRing, identity_matrix) from sage.all import VectorSpace - from sage.all import ComplexBallField, exp, sin, block_matrix, prime_range + from sage.all import ComplexBallField, exp, sin, block_matrix, prime_range, det + from sage.all import LaurentPolynomialRing, AbelianGroup, GroupAlgebra except ImportError: # Modularized Sage library + from sage.algebras.group_algebra import GroupAlgebra from sage.arith.misc import gcd, xgcd from sage.combinat.subset import powerset from sage.functions.hyperbolic import arccosh @@ -46,11 +48,12 @@ def sage_method(function): ceil, floor) from sage.functions.trig import sin + from sage.groups.abelian_gps.abelian_group import AbelianGroup from sage.matrix.constructor import Matrix as matrix from sage.matrix.matrix_space import MatrixSpace from sage.matrix.special import block_matrix, identity_matrix from sage.misc.cachefunc import cached_method - from sage.misc.functional import log, round, sqrt + from sage.misc.functional import det, log, round, sqrt from sage.misc.misc_c import prod from sage.modules.free_module import VectorSpace from sage.modules.free_module_element import free_module_element as vector @@ -64,6 +67,7 @@ def sage_method(function): from sage.rings.infinity import Infinity from sage.rings.integer import Integer from sage.rings.integer_ring import ZZ + from sage.rings.polynomial.laurent_polynomial_ring import LaurentPolynomialRing from sage.rings.number_field.number_field import NumberField from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing from sage.rings.rational import Rational diff --git a/python/snap/nsagetools.py b/python/snap/nsagetools.py index 1c1edf35..6a759532 100644 --- a/python/snap/nsagetools.py +++ b/python/snap/nsagetools.py @@ -5,22 +5,8 @@ from ..sage_helper import _within_sage, sage_method if _within_sage: - import sage - from sage.rings.integer_ring import Z as ZZ - from sage.modules.free_module_element import free_module_element as vector - from sage.matrix.constructor import Matrix as matrix - from sage.matrix.special import block_matrix - from sage.matrix.special import identity_matrix - from sage.arith.misc import GCD as gcd - from sage.misc.misc_c import prod - from sage.misc.functional import det - from sage.matrix.matrix_space import MatrixSpace - from sage.groups.abelian_gps.abelian_group import AbelianGroup - from sage.algebras.group_algebra import GroupAlgebra - from sage.structure.sage_object import SageObject - from sage.rings.polynomial.polynomial_ring_constructor import PolynomialRing - from sage.rings.polynomial.laurent_polynomial_ring import LaurentPolynomialRing - + from ..sage_helper import ZZ, vector, matrix, block_matrix, identity_matrix, gcd, prod, det + from ..sage_helper import MatrixSpace, PolynomialRing, SageObject, AbelianGroup, GroupAlgebra from .polished_reps import polished_holonomy, MatrixRepresentation Id2 = MatrixSpace(ZZ, 2)(1) else: