kummer-notes-code

Notes and code from my early research in Kummer Theory for Elliptic Curves.
git clone https://git.tronto.net/kummer-notes-code
Download | Log | Files | Refs | README

GL2_ZN.py (521B)


      1 # Prints a list of matrices, the elements of GL_2(Z/nZ)
      2 
      3 def gcd( m, n ):
      4     if n == 0:
      5         return m
      6     return gcd( n, m%n )
      7 
      8 def print_mat( a, b, c, d ):
      9     print ""
     10     print "|", a, " ", b, "|"
     11     print "|", c, " ", d, "|"
     12 
     13 n = input("Choose n: ")
     14 
     15 count = 0
     16 for a in range(n):
     17     for b in range(n):
     18         for c in range(n):
     19             for d in range(n):
     20                 if gcd( n, abs(a*d-b*c)) == 1:
     21                     print_mat(a,b,c,d)
     22                     count += 1
     23 
     24 print "Found", count, "elements"