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

Commit

Permalink
Call the factorial() method of an Integer
Browse files Browse the repository at this point in the history
  • Loading branch information
jdemeyer committed Nov 26, 2014
1 parent c47dbd4 commit a486db2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sage/modular/modform_hecketriangle/abstract_space.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from sage.modules.free_module_element import is_FreeModuleElement
from sage.matrix.constructor import matrix
from sage.modules.free_module_element import vector
from sage.rings.all import Integer

from sage.misc.cachefunc import cached_method

Expand Down Expand Up @@ -2153,7 +2154,7 @@ def q_basis(self, m=None, min_exp=0, order_1=ZZ(0)):

column_len = len(q_basis)
if (m >= column_len + min_exp):
raise ValueError("Index out of range: m={} >= {}=dimension + min_exp".format(m, size + min_exp))
raise ValueError("Index out of range: m={} >= {}=dimension + min_exp".format(m, column_len + min_exp))

return q_basis[m - min_exp]
else:
Expand Down Expand Up @@ -2268,9 +2269,8 @@ def rationalize_series(self, laurent_series, coeff_bound = 1e-10, denom_factor =
True
"""

from sage.rings.all import FractionField, PolynomialRing, PowerSeriesRing, prime_range
from sage.rings.all import prime_range
from sage.misc.all import prod
from sage.functions.other import factorial
from warnings import warn

denom_factor = ZZ(denom_factor)
Expand Down Expand Up @@ -2336,7 +2336,7 @@ def denominator_estimate(m):
return ZZ(1/dvalue)**m

hecke_n = self.hecke_n()
bad_factors = [fac for fac in factorial(m).factor() if (fac[0] % hecke_n) not in [1, hecke_n-1] and fac[0] > 2]
bad_factors = [fac for fac in Integer(m).factorial().factor() if (fac[0] % hecke_n) not in [1, hecke_n-1] and fac[0] > 2]
bad_factorial = prod([fac[0]**fac[1] for fac in bad_factors])

return ZZ(2**(6*m) * hecke_n**(2*m) * prod([ p**m for p in prime_range(m+1) if hecke_n % p == 0 and p > 2 ]) * bad_factorial)**(cor_exp + 1)
Expand Down

0 comments on commit a486db2

Please sign in to comment.