aboutsummaryrefslogtreecommitdiff
path: root/parameters_Q4_new.sage
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano.tronto@gmail.com>2019-09-17 10:29:15 +0200
committerSebastiano Tronto <sebastiano.tronto@gmail.com>2019-09-17 10:29:15 +0200
commit6b80453f9f7cd302899ee62eb068d1bfe0bc9ba5 (patch)
treea3cf87852e2d00b2767b43337db931c2c900ecaf /parameters_Q4_new.sage
parent31f855d9a13e237e81c46d1c363a9c74e443af43 (diff)
downloadkummer-degrees-6b80453f9f7cd302899ee62eb068d1bfe0bc9ba5.tar.gz
kummer-degrees-6b80453f9f7cd302899ee62eb068d1bfe0bc9ba5.zip
Removed some commented code, changed README.md
Diffstat (limited to 'parameters_Q4_new.sage')
-rw-r--r--parameters_Q4_new.sage60
1 files changed, 0 insertions, 60 deletions
diff --git a/parameters_Q4_new.sage b/parameters_Q4_new.sage
deleted file mode 100644
index 554cc0a..0000000
--- a/parameters_Q4_new.sage
+++ /dev/null
@@ -1,60 +0,0 @@
1# Returns the l-dvisibility parameters of G over Q, given a good basis gb of G,
2# as a list of pairs (di,hi).
3def parameters_Q( gb, l ):
4 ret = []
5 for i in range( len( gb ) ):
6 for j in gb[i]:
7 ret.append( (i,0) )
8 return ret
9
10# Computes the l-divisibility parameters of G over Q4, given a good basis gb
11# over Q for G. Returns a list of pairs (di,hi).
12# If l is odd it just uses the good basis given to compute the parameters.
13# If l=2, it uses the results of PST-2.
14def parameters_Q4_new( gb, l ):
15 if l != 2:
16 return parameters_Q( gb, l )
17 else:
18 # Converts from "good basis format" to simple list
19 b = []
20 for x in gb:
21 b += x
22
23 M = exponent_matrix( b )
24
25 # Thanks to my terrible notation, the elements of b are what are called
26 # g_i in the article, while the elements of bb will be the b_i's.
27 bb = [ abs(b[i]) ^ (2^(-divisibility(M[i],2))) for i in range(len(b)) ]
28
29 # Computing a combination of bb elements of the form 2 * square.
30 MM = exponent_matrix( bb + [2] ).change_ring( GF( 2 ) )
31
32 for a in MM.kernel().basis():
33 if a[-1] != 0:
34 # the vector a[0:-1] gives the coefficients for a combination
35 # of the b_i's of the form 2 * square
36
37 # Basis elements that actually appear in the combination
38 c = [ b[i] for i in range(len(a[0:-1])) if a[i] != 0 ]
39
40 # Return the parameters, changing only the ones fo the element
41 # of highest divisibility that appears in the combination.
42 ret = []
43 div_max = -1
44 ind_max = -1
45 for i in range(len(b)):
46 ret.append( (divisibility(M[i],2), 1-max(0,sgn(b[i]))) )
47 if a[i] != 0 and ret[i][0] > div_max:
48 div_max = ret[i][0]
49 ind_max = i
50 d1, h1 = ret[ind_max]
51 if d1 == 1:
52 h1 = 1 - h1
53 elif d1 == 0:
54 h1 = 2
55 ret[ind_max] = ( d1+1, h1 )
56
57 return ret
58
59 return parameters_Q( gb, 2 )
60

Generated with cgit - Back to sebastiano.tronto.net