aboutsummaryrefslogtreecommitdiff
path: root/kummer_degree.sage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--kummer_degree.sage41
1 files changed, 26 insertions, 15 deletions
diff --git a/kummer_degree.sage b/kummer_degree.sage
index 59c0929..161e8c9 100644
--- a/kummer_degree.sage
+++ b/kummer_degree.sage
@@ -288,7 +288,12 @@ def l_adic_failure_from_data( B, l, tablel, M, N ):
288# Returns the l-dvisibility parameters of G over Q, given a good basis b of 288# Returns the l-dvisibility parameters of G over Q, given a good basis b of
289# G, as a list of pairs (di,hi). 289# G, as a list of pairs (di,hi).
290def parameters_Q( b, l ): 290def parameters_Q( b, l ):
291 return [x for a in [[(i,0)]*len(b[i]) for i in range(len(b))] for x in a] 291 if l != 2:
292 return [x for a in [[(i,0)]*len(b[i]) for i in range(len(b))] \
293 for x in a]
294 else:
295 return [x for a in [[(i,1-max(0,sgn(g))) for g in b[i]] \
296 for i in range(len(b))] for x in a]
292 297
293# Computes the l-divisibility parameters of G over Q4, given a good basis gb 298# Computes the l-divisibility parameters of G over Q4, given a good basis gb
294# over Q for G. Returns a list of pairs (di,hi). 299# over Q for G. Returns a list of pairs (di,hi).
@@ -309,31 +314,37 @@ def parameters_Q4( gb, l ):
309 314
310 # Computing a combination of bb elements of the form 2 * square. 315 # Computing a combination of bb elements of the form 2 * square.
311 MM = exponent_matrix( bb + [2] ).change_ring( GF( 2 ) ) 316 MM = exponent_matrix( bb + [2] ).change_ring( GF( 2 ) )
312 317
313 for a in MM.kernel().basis(): 318 for a in MM.kernel().basis():
314 if a[-1] != 0: 319 if a[-1] != 0:
315 # the vector a[0:-1] gives the coefficients for a combination 320 # the vector a[0:-1] gives the coefficients for a combination
316 # of the b_i's of the form 2 * square 321 # of the b_i's of the form 2 * square.
317 322
318 # Basis elements that actually appear in the combination 323 # Index of asis elements that do appear in the combination
319 c = [ b[i] for i in range(len(a[0:-1])) if a[i] != 0 ] 324 c = [ i for i in range(len(a[0:-1])) if a[i] != 0 ]
325
326 # Change of basis to include the element of the form
327 # 2 * square to some power.
328 div_max = -1
329 i_max = -1
330 for j in c:
331 if divisibility(M[j],2) > div_max:
332 div_max = divisibility(M[j],2)
333 i_max = j
334 b[i_max] = prod([b[j]^(2^(div_max-divisibility(M[j],2))) \
335 for j in c])
336 M = exponent_matrix(b)
320 337
321 # Return the parameters, changing only those of the element 338 # Return the parameters, changing only those of the element
322 # of highest divisibility that appears in the combination. 339 # of highest divisibility that appears in the combination.
323 ret = [] 340 ret = [(divisibility(M[i],2),1-max(0,sgn(b[i]))) \
324 div_max = -1 341 for i in range(len(b)) ]
325 ind_max = -1 342 d1, h1 = ret[i_max]
326 for i in range(len(b)):
327 ret.append( (divisibility(M[i],2), 1-max(0,sgn(b[i]))) )
328 if a[i] != 0 and ret[i][0] > div_max:
329 div_max = ret[i][0]
330 ind_max = i
331 d1, h1 = ret[ind_max]
332 if d1 == 1: 343 if d1 == 1:
333 h1 = 1 - h1 344 h1 = 1 - h1
334 elif d1 == 0: 345 elif d1 == 0:
335 h1 = 2 346 h1 = 2
336 ret[ind_max] = ( d1+1, h1 ) 347 ret[i_max] = ( d1+1, h1 )
337 348
338 return ret 349 return ret
339 350

Generated with cgit - Back to sebastiano.tronto.net