Shared2018-07-31-Gibbons.sagewsOpen in CoCalc
SO(2,ZZ_p)
F = GF(19); K = GF(17, modulus="primitive")
G = SO(2,F,-1); G.order()     #should be 20
H = SO(2,K,1); H.order()      #should be 16
20 16
G.invariant_quadratic_form()
H.invariant_quadratic_form()
[1 1] [0 2] [0 1] [0 0]
HG.as_matrix_group()
H.as_matrix_group()
Matrix group over Finite Field of size 19 with 3 generators ( [18 10] [ 9 9] [1 0] [18 9], [ 1 18], [0 1] ) Matrix group over Finite Field of size 17 with 3 generators ( [3 0] [6 0] [1 0] [0 6], [0 3], [0 1] )
A = matrix(F,2,[18,10,18,9])
#B = G.random_element(); B # one choice: 
B = matrix(F,2,[8,16,6,5]);
AA = A.inverse();
C = AA*B; C.det()
1
G.as_matrix_group().as_permutation_group()
Permutation Group with generators [(1,2,4,6,8,10,12,14,16,18,20,19,17,15,13,11,9,7,5,3), (1,3,5,7,9,11,13,15,17,19,20,18,16,14,12,10,8,6,4,2), ()]
MSF = MatrixSpace(F,2,2); 
MSK = MatrixSpace(K,2,2);
A = MSF([18,10,18,9]); GG = MatrixGroup([A]); GG.order()
B = MSK([3,0,0,6]); HH = MatrixGroup([B]); HH.order()

20 16

Error in lines 1-1 Traceback (most recent call last): File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1044, in execute exec compile(block+'\n', '', 'single', flags=compile_flags) in namespace, locals File "", line 1, in <module> File "sage/structure/category_object.pyx", line 854, in sage.structure.category_object.CategoryObject.__getattr__ (build/cythonized/sage/structure/category_object.c:7996) return self.getattr_from_category(name) File "sage/structure/category_object.pyx", line 869, in sage.structure.category_object.CategoryObject.getattr_from_category (build/cythonized/sage/structure/category_object.c:8159) attr = getattr_from_other_class(self, cls, name) File "sage/cpython/getattr.pyx", line 228, in sage.cpython.getattr.getattr_from_other_class (build/cythonized/sage/cpython/getattr.c:1848) raise AttributeError(dummy_error_message) AttributeError: 'FiniteField_prime_modn_with_category' object has no attribute 'unity'

p = 29; #5,13,17, etc
if p % 4 == 1:
    e = +1
else:
    print "womp womp; this shouldn't work?"
L = GF(p,modulus="primitive");
a = L.gen()
I = SO(2,L,e);
I.as_matrix_group();
b = (1/a) % p
MSL = MatrixSpace(L,2,2);
II = MatrixGroup(MSL([a,0,0,b]));
II.order() == p - 1
Matrix group over Finite Field of size 29 with 3 generators ( [ 2 0] [15 0] [1 0] [ 0 15], [ 0 2], [0 1] ) True
p = 23
if p % 4 == 3:
    e = -1
else:
    print "womp womp; this shouldn't work?"
L = GF(p,modulus="primitive");
a = p-1; b = (p-1)/2; c = (p+1)/2
I = SO(2,L,e);
I.as_matrix_group();
L.gen()
Matrix group over Finite Field of size 23 with 3 generators ( [12 7] [19 16] [1 0] [16 19], [ 7 12], [0 1] ) 5
R.<x> = PolynomialRing(L)
Li = L.extension(x^2 + 1,'i'); Li.random_element()
22*i + 17

Error in lines 1-1 Traceback (most recent call last): File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1044, in execute exec compile(block+'\n', '', 'single', flags=compile_flags) in namespace, locals File "", line 1, in <module> File "sage/rings/finite_rings/finite_field_base.pyx", line 1332, in sage.rings.finite_rings.finite_field_base.FiniteField.extension (build/cythonized/sage/rings/finite_rings/finite_field_base.c:15794) E = GF(self.characteristic()**(modulus.degree()), name=name, modulus=modulus, **kwds) File "sage/structure/factory.pyx", line 366, in sage.structure.factory.UniqueFactory.__call__ (build/cythonized/sage/structure/factory.c:1936) key, kwds = self.create_key_and_extra_args(*args, **kwds) File "/ext/sage/sage-8.2_1604/local/lib/python2.7/site-packages/sage/rings/finite_rings/finite_field_constructor.py", line 544, in create_key_and_extra_args raise ValueError("no modulus may be specified if variable name not given") ValueError: no modulus may be specified if variable name not given