From 178e35b670664c3b9888a3f592592b0d91edb64c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giulia=20Orr=C3=B9?= Date: Mon, 16 Feb 2026 10:30:08 +0000 Subject: [PATCH 1/2] Add new implementation of finite projective line --- lib/Orru/finiteProjectiveSpaces.gi | 43 +++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) diff --git a/lib/Orru/finiteProjectiveSpaces.gi b/lib/Orru/finiteProjectiveSpaces.gi index 6d36df75..ffe3b436 100644 --- a/lib/Orru/finiteProjectiveSpaces.gi +++ b/lib/Orru/finiteProjectiveSpaces.gi @@ -24,7 +24,7 @@ end); -InstallGlobalFunction(HAP_FiniteProjectiveLineIntegers, +InstallGlobalFunction(HAP_FiniteProjectiveLineIntegers_alt, function(n) local UnitEls, x, y, i, c, d, u, UnitsAction, Representatives, RepOf, r, v, w, m, min; @@ -113,4 +113,45 @@ function(n) ); end); +InstallGlobalFunction(HAP_FiniteProjectiveLineIntegers, +function(n) + local Rep, i, factors, Znd, d, z, p, l, toFill, t; + + Rep := [[0,1]]; + + for i in [1..n] do + Add(Rep,[1,i-1]); + od; + + factors := List(DivisorsInt(n)); + Remove(factors,1); + Remove(factors); + + for p in factors do + d := n/p; + + Znd := [0..d-1]; + toFill := []; + + for z in Znd do + if Gcd(p,z,d) = 1 then + Add(toFill, z); + fi; + od; + + t := 1; + while not IsEmpty(toFill) do + if Gcd(p,t) = 1 then + if (t mod d) in toFill then + Add(Rep,[p,t]); + Remove(toFill, Position(toFill,t mod d)); + fi; + fi; + t := t+1; + od; + od; + + return Rep; +end); + From 4bac73caab4fe62b4fde412045071ff523ffdbe5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Giulia=20Orr=C3=B9?= Date: Mon, 16 Feb 2026 11:18:10 +0000 Subject: [PATCH 2/2] New implementation of congruence subgroups for SL2 --- lib/Orru/decsOrru.gd | 2 + lib/Orru/subgroups.gi | 115 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 114 insertions(+), 3 deletions(-) diff --git a/lib/Orru/decsOrru.gd b/lib/Orru/decsOrru.gd index 7ebc62fd..94b5361c 100644 --- a/lib/Orru/decsOrru.gd +++ b/lib/Orru/decsOrru.gd @@ -4,9 +4,11 @@ DeclareGlobalFunction("HAP_GenericCongruenceSubgroup"); DeclareOperation("FiniteProjectiveLine",[IsInt]); DeclareOperation("FiniteProjectivePlane",[IsInt]); DeclareGlobalFunction("HAP_FiniteProjectiveLineIntegers"); +DeclareGlobalFunction("HAP_FiniteProjectiveLineIntegers_alt"); DeclareGlobalFunction("HAP_FiniteProjectivePlaneIntegers"); DeclareGlobalFunction("HAP_SL3ZSubgroupTree_fast"); DeclareOperation("HAPCongruenceSubgroupGamma0",[IsInt,IsInt]); +DeclareOperation("HAPCongruenceSubgroupGamma0_alt",[IsInt,IsInt]); DeclareOperation("HAPCongruenceSubgroupTree",[IsHapCongruenceSubgroup]); DeclareGlobalFunction("Gamma0_SL3ZTopRationalHomology"); diff --git a/lib/Orru/subgroups.gi b/lib/Orru/subgroups.gi index 4294517d..a1cdc3fa 100644 --- a/lib/Orru/subgroups.gi +++ b/lib/Orru/subgroups.gi @@ -71,11 +71,11 @@ end); ################################################################### ################################################################### -InstallMethod( HAPCongruenceSubgroupGamma0, +InstallMethod( HAPCongruenceSubgroupGamma0_alt, "for integer n and integer m", [IsInt, IsInt], function(n,m) - local G, sl, membership, membershipLight, CosetRep, CosetPos, ProjLine, + local G, sl, membership, membershipLight, CosetRep, CanonicalRep, CosetPos, ProjLine, CosetOfInt, S, T, U; if not (n=2 and m>0) then TryNextMethod(); fi; @@ -137,9 +137,11 @@ function(n,m) fi; od; end; + # CosetRep := function(i) #Should input a group element + CosetOfInt := function(i) - local a, c, b, d, gg; + local a, c, b, d, gg; a := ProjLine.Reps[i][1]; c := ProjLine.Reps[i][2]; if a = 0 then @@ -167,6 +169,113 @@ function(n,m) return G; end); ################################################################### +#NEW +InstallMethod( HAPCongruenceSubgroupGamma0, +"for integer n and integer m", +[IsInt, IsInt], +function(n,m) + local G, sl, membership, membershipLight, CosetRep, CanonicalRep, CosetPos, ProjLine, CosetOfInt, S, T, U; + if not (n=2 and m>0) then TryNextMethod(); fi; + + #The following implements G=Gamm0(m) < SL(2,Z) + + sl := SL(2,Integers); + G := HAP_GenericCongruenceSubgroup("SL",2,Integers,m); + + ################################################### + membership:=function(g) + if not g in sl then + return false; + fi; + if not g[2][1] mod m = 0 then + return false; + else + return true; + fi; + end; + ################################################### + ################################################### + membershipLight:=function(g) + if not g[2][1] mod m = 0 then + return false; + else + return true; + fi; + end; + ################################################### + #################### + S:=[[0,-1],[1,0]];; + T:=[[1,1],[0,1]]; + U:=S*T; + #################### + + + G!.membership := membership; + G!.membershipLight := membershipLight; + G!.level := m; + + G!.ugrp := Group([[1,0],[0,1]]); + G!.name := "CongruenceSubgroupGamma0"; + if m = 1 then + G!.index := m; + else + G!.index := m*Product(List(SSortedList(Factors(m)), p->1+1/p)); + fi; + + ProjLine := FiniteProjectiveLine(m); + + CanonicalRep := function(g) + local v, vv, U, d, dd; + v := [g[1][1], g[2][1]]; + vv := List(v, x -> x mod m); + U := Units(Integers mod m); + if vv[1] mod m = 0 then + return [0,1]; + elif ZmodnZObj(vv[1],m) in U then + return [1,(Inverse(vv[1]) mod m)*vv[2] mod m]; + else + d := Gcd(vv[1],m); + dd := m/d; + return [vv[1], vv[2] mod dd]; + fi; + end; + + CosetPos := function(g) + local w; + w := CanonicalRep(g); + return Position(ProjLine,w); + end; + +# CosetRep := function(i) #Should input a group element + + CosetOfInt := function(i) + local a, c, b, d, gg; + a := ProjLine[i][1]; + c := ProjLine[i][2]; + if a = 0 then + return [[0,-1],[1,0]]; + fi; + gg := Gcdex(a,c); + b := -gg.coeff2; + d := gg.coeff1; + return [[a,b],[c,d]]; + end; + + CosetRep:=function(g); + return CosetOfInt(CosetPos(g)); + end; + + G!.cosetRep := CosetRep; + G!.cosetPos := CosetPos; + G!.ambientGenerators:=[S,S*U]; + G!.transversal:=List([1..Length(ProjLine)],i->CosetOfInt(i)^-1); + + G := ObjectifyWithAttributes(G, TypeObj(G), + IsIntegerMatrixGroup, true, + IsFinite, false); + + return G; +end); ################################################################### ###################################################################