@@ -10,19 +10,19 @@ import (
1010// xxx rename CalGCayleyComplex?
1111// xxx genericise to use any group with comparable element type?
1212type CalGCayleyExpander struct {
13- gens []ElementCalG
14- maxDepth int
15- curDepth int
16- verbose bool
17- modulus * F2Polynomial
18- quotient bool
19- attendance map [ElementCalG ]vertexWrapper
20- vertexBasis []ZVertex [ElementCalG ]
21- todo calGTodoQueue
22- edgeSet map [ZEdge [ElementCalG ]]any
23- edgeBasis []ZEdge [ElementCalG ]
13+ gens []ElementCalG
14+ maxDepth int
15+ curDepth int
16+ verbose bool
17+ modulus * F2Polynomial
18+ quotient bool
19+ attendance map [ElementCalG ]vertexWrapper
20+ vertexBasis []ZVertex [ElementCalG ]
21+ todo calGTodoQueue
22+ edgeSet map [ZEdge [ElementCalG ]]any
23+ edgeBasis []ZEdge [ElementCalG ]
2424 congruenceSubgroupElements []ElementCalG
25- observer CalGObserver
25+ observer CalGObserver
2626}
2727
2828type CalGObserver interface {
@@ -35,7 +35,7 @@ type CalGObserver interface {
3535}
3636
3737type vertexWrapper struct {
38- id int
38+ id int
3939 // when a new vertex is created (i.e. we compute a new group
4040 // element that has not yet been seen, i.e. is not in the
4141 // attendance map), we store the generator that was used to
@@ -98,15 +98,15 @@ func (E *CalGCayleyExpander) Expand() {
9898 E .observer .EndVertices ()
9999 }
100100 // xxx experimental for debugging;
101- // checkCongruenceConsistency1 := true
102- // if checkCongruenceConsistency1 {
103- // log.Printf("checking for multiple congruence subgroup identities")
104- // for g, id := range E.attendance {
105- // if g.IsIdentityModf(*E.modulus) {
106- // log.Printf("found congruence subgroup identity: g=(%v) id=%d", g, id)
107- // }
108- // }
109- // }
101+ // checkCongruenceConsistency1 := true
102+ // if checkCongruenceConsistency1 {
103+ // log.Printf("checking for multiple congruence subgroup identities")
104+ // for g, id := range E.attendance {
105+ // if g.IsIdentityModf(*E.modulus) {
106+ // log.Printf("found congruence subgroup identity: g=(%v) id=%d", g, id)
107+ // }
108+ // }
109+ // }
110110}
111111
112112func (E * CalGCayleyExpander ) Complex () * ZComplex [ElementCalG ] {
@@ -139,12 +139,12 @@ func (E *CalGCayleyExpander) getOrSetVertex(u ElementCalG, genIndex int, uDepth
139139 }
140140 uId = len (E .attendance )
141141 wrapper = vertexWrapper {
142- id : uId ,
142+ id : uId ,
143143 generator : genIndex ,
144144 }
145145 E .attendance [u ] = wrapper
146146 E .vertexBasis = append (E .vertexBasis , u )
147-
147+
148148 // check for congruence subgroup element, unless we are doing a quotient
149149 if E .modulus != nil && ! E .quotient && ! u .IsIdentity () {
150150 c := u .Modf (* E .modulus )
@@ -361,12 +361,12 @@ func (E *CalGCayleyExpander) triangleToSortedVertexIndices(t ZTriangle[ElementCa
361361func (E * CalGCayleyExpander ) triangleBasis () []ZTriangle [ElementCalG ] {
362362 if E .verbose {
363363 log .Printf ("computing triangle basis" )
364- }
364+ }
365365 //
366366 // f g h
367367 // u --- v --- w --- x
368368 //
369- basis := make ([]ZTriangle [ElementCalG ], 0 )
369+ basis := make ([]ZTriangle [ElementCalG ], 0 )
370370 triangleSet := make (map [ZTriangle [ElementCalG ]]any )
371371 for _ , u := range E .vertexBasis {
372372 u := u .(ElementCalG )
@@ -467,7 +467,10 @@ func NewZComplexElementCalGFromBasisFiles(vertexBasisFile, edgeBasisFile, triang
467467 if verbose {
468468 log .Printf ("reading triangle basis file %s" , triangleBasisFile )
469469 }
470- triangleBasis := ReadElementCalGTriangleFile (triangleBasisFile )
470+ var triangleBasis []ZTriangle [ElementCalG ]
471+ if triangleBasisFile != "" {
472+ triangleBasis = ReadElementCalGTriangleFile (triangleBasisFile )
473+ }
471474 sortBases := false
472475 return NewZComplex (vertexBasis , edgeBasis , triangleBasis , sortBases , verbose )
473476}
0 commit comments