@@ -241,37 +241,6 @@ GAP.@install function GapObj(x::MatrixGroupElem)
241
241
return x. X
242
242
end
243
243
244
- # return the G.sym if isdefined(G, :sym); otherwise, the field :sym is computed and set using information from other defined fields
245
- function Base. getproperty (G:: MatrixGroup{T} , sym:: Symbol ) where T
246
-
247
- isdefined (G,sym) && return getfield (G,sym)
248
-
249
- if sym === :X
250
- if isdefined (G,:descr )
251
- assign_from_description (G)
252
- elseif isdefined (G,:gens )
253
- V = GapObj (gens (G); recursive= true )
254
- G. X = isempty (V) ? GAPWrap. Group (V, GapObj (one (G))) : GAPWrap. Group (V)
255
- else
256
- error (" Cannot determine underlying GAP object" )
257
- end
258
- end
259
-
260
- return getfield (G, sym)
261
-
262
- end
263
-
264
-
265
- function Base. getproperty (x:: MatrixGroupElem , sym:: Symbol )
266
-
267
- isdefined (x,sym) && return getfield (x,sym)
268
-
269
- if sym === :X
270
- x. X = map_entries (_ring_iso (parent (x)), x. elm)
271
- end
272
- return getfield (x,sym)
273
- end
274
-
275
244
Base. IteratorSize (:: Type{<:MatrixGroup} ) = Base. SizeUnknown ()
276
245
277
246
Base. iterate (G:: MatrixGroup ) = iterate (G, GAPWrap. Iterator (GapObj (G)))
@@ -530,13 +499,13 @@ degree(G::MatrixGroup) = G.deg
530
499
Base. one (G:: MatrixGroup ) = MatrixGroupElem (G, identity_matrix (base_ring (G), degree (G)))
531
500
532
501
function Base. rand (rng:: Random.AbstractRNG , G:: MatrixGroup )
533
- x_gap = GAP. Globals. Random (GAP. wrap_rng (rng), G . X ):: GapObj
502
+ x_gap = GAP. Globals. Random (GAP. wrap_rng (rng), GapObj (G) ):: GapObj
534
503
return MatrixGroupElem (G, x_gap)
535
504
end
536
505
537
506
function gens (G:: MatrixGroup )
538
507
if ! isdefined (G,:gens )
539
- L = GAPWrap. GeneratorsOfGroup (G . X ):: GapObj
508
+ L = GAPWrap. GeneratorsOfGroup (GapObj (G) ):: GapObj
540
509
G. gens = [MatrixGroupElem (G, a:: GapObj ) for a in L]
541
510
end
542
511
return G. gens:: Vector{elem_type(G)}
@@ -555,26 +524,26 @@ end
555
524
number_of_generators (G:: MatrixGroup ) = length (gens (G))
556
525
557
526
558
- compute_order (G:: GAPGroup ) = ZZRingElem (GAPWrap. Size (G . X ))
527
+ compute_order (G:: GAPGroup ) = ZZRingElem (GAPWrap. Size (GapObj (G) ))
559
528
560
529
function compute_order (G:: MatrixGroup{T} ) where {T <: Union{AbsSimpleNumFieldElem, QQFieldElem} }
561
530
#=
562
531
- For a matrix group G over the rationals or over a number field,
563
- the GAP group G.X does usually not store the flag `IsHandledByNiceMonomorphism`.
532
+ the GAP group GapObj(G) does usually not store the flag `IsHandledByNiceMonomorphism`.
564
533
- If we know a reasonable ("nice") faithful permutation action of `G` in advance,
565
- we can set this flag in `G.X ` to true and store the action homomorphism in `G.X `,
534
+ we can set this flag in `GapObj(G) ` to true and store the action homomorphism in `GapObj(G) `,
566
535
and then this information should be used in the computation of the order.
567
536
- If the flag is not known to be true then the Oscar code from
568
537
`isomorphic_group_over_finite_field` shall be preferred.
569
538
=#
570
- if GAP. Globals. HasIsHandledByNiceMonomorphism (G . X) && GAPWrap. IsHandledByNiceMonomorphism (G . X )
539
+ if GAP. Globals. HasIsHandledByNiceMonomorphism (GapObj (G)) && GAPWrap. IsHandledByNiceMonomorphism (GapObj (G) )
571
540
# The call to `IsHandledByNiceMonomorphism` triggers an expensive
572
541
# computation of `IsFinite` which we avoid by checking
573
542
# `HasIsHandledByNiceMonomorphism` first.
574
- return ZZRingElem (GAPWrap. Size (G . X ))
543
+ return ZZRingElem (GAPWrap. Size (GapObj (G) ))
575
544
else
576
545
n = order (isomorphic_group_over_finite_field (G)[1 ])
577
- GAP. Globals. SetSize (G . X , GAP. Obj (n))
546
+ GAP. Globals. SetSize (GapObj (G) , GAP. Obj (n))
578
547
return n
579
548
end
580
549
end
@@ -990,8 +959,8 @@ const SU = special_unitary_group
990
959
991
960
function sub (G:: MatrixGroup , elements:: Vector{S} ) where S <: GAPGroupElem
992
961
@assert elem_type (G) === S
993
- elems_in_GAP = GAP. Obj (GapObj[x . X for x in elements])
994
- H = GAP. Globals. Subgroup (G . X ,elems_in_GAP):: GapObj
962
+ elems_in_GAP = GAP. Obj (GapObj[GapObj (x) for x in elements])
963
+ H = GAP. Globals. Subgroup (GapObj (G) ,elems_in_GAP):: GapObj
995
964
# H is the group. I need to return the inclusion map too
996
965
K,f = _as_subgroup (G, H)
997
966
L = Vector {elem_type(K)} (undef, length (elements))
@@ -1028,7 +997,7 @@ function Base.:^(H::MatrixGroup, y::MatrixGroupElem)
1028
997
for k in gens (K) k. parent = K end
1029
998
else
1030
999
K = matrix_group (base_ring (H), degree (H))
1031
- K. X = H . X ^ y . X
1000
+ K. X = GapObj (H) ^ GapObj (y)
1032
1001
end
1033
1002
1034
1003
return K
0 commit comments