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

Commit

Permalink
trac 21496 fixing doc, plus little code cleanup of ;
Browse files Browse the repository at this point in the history
  • Loading branch information
Frédéric Chapoton committed Dec 14, 2016
1 parent b8defb6 commit 3f92ea1
Showing 1 changed file with 31 additions and 19 deletions.
50 changes: 31 additions & 19 deletions src/sage/modular/abvar/abvar.py
Expand Up @@ -777,7 +777,8 @@ def _Hom_(self, B, cat=None):
Category of modular abelian varieties over Rational Field
"""
if cat is None:
K = self.base_field(); L = B.base_field()
K = self.base_field()
L = B.base_field()
if K == L:
F = K
elif K == QQbar or L == QQbar:
Expand Down Expand Up @@ -3463,7 +3464,8 @@ def _classify_ambient_factors(self, simple=True, bound=None):
amb = self.ambient_variety()
S = self.vector_space()
X = amb.decomposition(simple=simple, bound=bound)
IN = []; OUT = []
IN = []
OUT = []
i = 0
V = 0
last_dimension = 0
Expand Down Expand Up @@ -4574,13 +4576,15 @@ def component_group_order(self, p):
if not self.is_simple():
raise ValueError("self must be simple")
p = Integer(p)
if not p.is_prime(): raise ValueError("p must be a prime integer")
try: return self.__component_group[p][0]
if not p.is_prime():
raise ValueError("p must be a prime integer")
try:
return self.__component_group[p][0]
except AttributeError:
self.__component_group = {}
except KeyError: pass
# Easy special case -- a prime of good reduction
if self.level() % p != 0:
if self.level() % p:
one = Integer(1)
self.__component_group[p] = (one,one,one)
return one
Expand Down Expand Up @@ -4725,20 +4729,20 @@ def tamagawa_number(self, p):

def tamagawa_number_bounds(self, p):
"""
Return a divisor and multiple of the Tamagawa number of self at p.
Return a divisor and multiple of the Tamagawa number of self at `p`.
NOTE: the input abelian variety must be simple
NOTE: the input abelian variety must be simple.
INPUT:
- p -- a prime number
- `p` -- a prime number
OUTPUT:
- div -- integer; divisor of Tamagawa number at p
- mul -- integer; multiple of Tamagawa number at p
- div -- integer; divisor of Tamagawa number at `p`
- mul -- integer; multiple of Tamagawa number at `p`
- mul_primes -- tuple; in case mul==0, a list of all
primes that can possibly divide the Tamagawa number at p.
primes that can possibly divide the Tamagawa number at `p`
EXAMPLES::
Expand All @@ -4749,15 +4753,21 @@ def tamagawa_number_bounds(self, p):
sage: A.tamagawa_number_bounds(3)
(1, 0, (2, 3, 5))
"""
try: return self.__tamagawa_number_bounds[p]
except AttributeError: self.__tamagawa_number_bounds = {}
except KeyError: pass
try:
return self.__tamagawa_number_bounds[p]
except AttributeError:
self.__tamagawa_number_bounds = {}
except KeyError:
pass
if not self.is_simple():
raise ValueError("self must be simple")
N = self.level()
div = 1; mul = 0; mul_primes = []
if N % p != 0:
div = 1; mul = 1
div = 1
mul = 0
mul_primes = []
if N % p:
div = 1
mul = 1
elif N.valuation(p) == 1:
M = self.modular_symbols(sign=1)
if is_Gamma0(M.group()):
Expand All @@ -4766,7 +4776,8 @@ def tamagawa_number_bounds(self, p):
cp = None
if W == -1:
# Frob acts trivially
div = g; mul = g
div = g
mul = g
elif W == 1:
# Frob acts by -1
n = g.valuation(2)
Expand Down Expand Up @@ -4950,7 +4961,8 @@ def factor_new_space(M):
Modular Symbols subspace of dimension 2 of Modular Symbols space of dimension 5 for Gamma_0(37) of weight 2 with sign 0 over Rational Field
]
"""
t = None; p = 2
t = None
p = 2
for i in range(200):
t, p = random_hecke_operator(M, t, p)
f = t.charpoly()
Expand Down

0 comments on commit 3f92ea1

Please sign in to comment.