Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagesmc
Path: blob/master/src/sage/groups/class_function.py
8814 views
1
r"""
2
Class functions of groups.
3
4
This module implements a wrapper of GAP's ClassFunction function.
5
6
NOTE: The ordering of the columns of the character table of a group
7
corresponds to the ordering of the list. However, in general there is
8
no way to canonically list (or index) the conjugacy classes of a group.
9
Therefore the ordering of the columns of the character table of
10
a group is somewhat random.
11
12
AUTHORS:
13
14
- Franco Saliola (November 2008): initial version
15
16
- Volker Braun (October 2010): Bugfixes, exterior and symmetric power.
17
"""
18
19
#*****************************************************************************
20
# Copyright (C) 2008 Franco Saliola <[email protected]>
21
#
22
# Distributed under the terms of the GNU General Public License (GPL)
23
# http://www.gnu.org/licenses/
24
#*****************************************************************************
25
26
from sage.structure.sage_object import SageObject
27
from sage.interfaces.gap import gap, GapElement
28
from sage.rings.all import Integer
29
from sage.rings.all import CyclotomicField
30
from sage.libs.gap.element import GapElement, GapElement_List
31
32
# TODO:
33
#
34
# This module needs to be rewritten to implement the ring of class
35
# functions in the usual parent/element pattern. But
36
# http://trac.sagemath.org/14014 is already too long...
37
38
39
def ClassFunction(group, values):
40
"""
41
Construct a class function.
42
43
INPUT:
44
45
- ``group`` -- a group.
46
47
- ``values`` -- list/tuple/iterable of numbers. The values of the
48
class function on the conjugacy classes, in that order.
49
50
51
EXAMPLES::
52
53
sage: G = CyclicPermutationGroup(4)
54
sage: G.conjugacy_classes()
55
[Conjugacy class of () in Cyclic group of order 4 as a permutation group,
56
Conjugacy class of (1,2,3,4) in Cyclic group of order 4 as a permutation group,
57
Conjugacy class of (1,3)(2,4) in Cyclic group of order 4 as a permutation group,
58
Conjugacy class of (1,4,3,2) in Cyclic group of order 4 as a permutation group]
59
sage: values = [1, -1, 1, -1]
60
sage: chi = ClassFunction(G, values); chi
61
Character of Cyclic group of order 4 as a permutation group
62
"""
63
try:
64
return group.class_function(values)
65
except AttributeError:
66
pass
67
return ClassFunction_gap(group, values)
68
69
70
71
#####################################################################
72
###
73
### GAP Interface-based Class Function
74
###
75
### This is old code that should be deleted once we have transitioned
76
### everything to libGAP.
77
###
78
#####################################################################
79
80
class ClassFunction_gap(SageObject):
81
"""
82
A wrapper of GAP's ClassFunction function.
83
84
.. NOTE::
85
86
It is *not* checked whether the given values describes a character,
87
since GAP does not do this.
88
89
EXAMPLES::
90
91
sage: G = CyclicPermutationGroup(4)
92
sage: values = [1, -1, 1, -1]
93
sage: chi = ClassFunction(G, values); chi
94
Character of Cyclic group of order 4 as a permutation group
95
sage: loads(dumps(chi)) == chi
96
True
97
"""
98
def __init__(self, G, values):
99
r"""
100
Return the character of the group ``G`` with values given by the list
101
values. The order of the values must correspond to the output of
102
``G.conjugacy_classes_representatives()``.
103
104
EXAMPLES::
105
106
sage: G = CyclicPermutationGroup(4)
107
sage: values = [1, -1, 1, -1]
108
sage: chi = ClassFunction(G, values); chi
109
Character of Cyclic group of order 4 as a permutation group
110
"""
111
self._group = G
112
if isinstance(values, GapElement) and gap.IsClassFunction(values):
113
self._gap_classfunction = values
114
else:
115
self._gap_classfunction = gap.ClassFunction(G, list(values))
116
e = self._gap_classfunction.Conductor()
117
self._base_ring = CyclotomicField(e)
118
119
120
def _gap_init_(self):
121
r"""
122
Returns a string showing how to declare / initialize self in Gap.
123
Stored in the \code{self._gap_string} attribute.
124
125
EXAMPLES::
126
127
sage: G = CyclicPermutationGroup(4)
128
sage: values = [1, -1, 1, -1]
129
sage: ClassFunction(G, values)._gap_init_()
130
'ClassFunction( CharacterTable( Group( [ (1,2,3,4) ] ) ), [ 1, -1, 1, -1 ] )'
131
"""
132
return str(self._gap_classfunction)
133
134
135
def _gap_(self, *args):
136
r"""
137
Coerce self into a GAP element.
138
139
EXAMPLES::
140
141
sage: G = CyclicPermutationGroup(4)
142
sage: values = [1, -1, 1, -1]
143
sage: chi = ClassFunction(G, values); chi
144
Character of Cyclic group of order 4 as a permutation group
145
sage: type(_)
146
<class 'sage.groups.class_function.ClassFunction_gap'>
147
sage: chi._gap_()
148
ClassFunction( CharacterTable( Group( [ (1,2,3,4) ] ) ), [ 1, -1, 1, -1 ] )
149
sage: type(_)
150
<class 'sage.interfaces.gap.GapElement'>
151
"""
152
return self._gap_classfunction
153
154
155
def __repr__(self):
156
r"""
157
Return a string representation.
158
159
OUTPUT:
160
161
A string.
162
163
EXAMPLES::
164
165
sage: G = SymmetricGroup(4)
166
sage: values = [1, -1, 1, 1, -1]
167
sage: ClassFunction(G, values)
168
Character of Symmetric group of order 4! as a permutation group
169
"""
170
return "Character of %s" % repr(self._group)
171
172
173
def __iter__(self):
174
r"""
175
Iterate through the values of self evaluated on the conjugacy
176
classes.
177
178
EXAMPLES::
179
180
sage: xi = ClassFunction(SymmetricGroup(4), [1, -1, 1, 1, -1])
181
sage: list(xi)
182
[1, -1, 1, 1, -1]
183
"""
184
for v in self._gap_classfunction:
185
yield self._base_ring(v)
186
187
188
def __cmp__(self, other):
189
r"""
190
Rich comparison for class functions.
191
192
Compares groups and then the values of the class function on the
193
conjugacy classes. Otherwise, compares types of objects.
194
195
EXAMPLES::
196
197
sage: G = PermutationGroup([[(1,2,3),(4,5)],[(3,4)]])
198
sage: chi = G.character([1, 1, 1, 1, 1, 1, 1])
199
sage: H = PermutationGroup([[(1,2,3),(4,5)]])
200
sage: xi = H.character([1, 1, 1, 1, 1, 1])
201
sage: chi == chi
202
True
203
sage: xi == xi
204
True
205
sage: xi == chi
206
False
207
sage: chi < xi
208
False
209
sage: xi < chi
210
True
211
212
"""
213
if isinstance(other, ClassFunction_gap):
214
return cmp((self._group, self.values()),
215
(other._group, other.values()))
216
else:
217
return cmp(type(self), type(other))
218
219
220
def __reduce__(self):
221
r"""
222
Add pickle support.
223
224
EXAMPLES::
225
226
sage: G = PermutationGroup([[(1,2,3),(4,5)],[(3,4)]])
227
sage: chi = G.character([1, 1, 1, 1, 1, 1, 1])
228
sage: type(chi)
229
<class 'sage.groups.class_function.ClassFunction_gap'>
230
sage: loads(dumps(chi)) == chi
231
True
232
"""
233
return ClassFunction_gap, (self._group, self.values())
234
235
236
def domain(self):
237
r"""
238
Returns the domain of the self.
239
240
OUTPUT:
241
242
The underlying group of the class function.
243
244
EXAMPLES::
245
246
sage: ClassFunction(SymmetricGroup(4), [1,-1,1,1,-1]).domain()
247
Symmetric group of order 4! as a permutation group
248
"""
249
return self._group
250
251
252
def __call__(self, g):
253
"""
254
Evaluate the character on the group element g. Returns an error if
255
g is not in G.
256
257
EXAMPLES::
258
259
sage: G = GL(2,7)
260
sage: values = G.gap().CharacterTable().Irr()[2].List().sage()
261
sage: chi = ClassFunction(G, values)
262
sage: z = G([[3,0],[0,3]]); z
263
[3 0]
264
[0 3]
265
sage: chi(z)
266
zeta3
267
sage: G = GL(2,3)
268
sage: chi = G.irreducible_characters()[3]
269
sage: g = G.conjugacy_class_representatives()[6]
270
sage: chi(g)
271
zeta8^3 + zeta8
272
273
sage: G = SymmetricGroup(3)
274
sage: h = G((2,3))
275
sage: triv = G.trivial_character()
276
sage: triv(h)
277
1
278
"""
279
return self._base_ring(gap(g)._operation("^", self._gap_classfunction))
280
281
282
def __add__(self, other):
283
r"""
284
Returns the sum of the characters self and other.
285
286
INPUT:
287
288
- ``other`` -- a :class:`ClassFunction` of the same group as
289
``self``.
290
291
OUTPUT:
292
293
A :class:`ClassFunction`
294
295
EXAMPLES::
296
297
sage: chi = ClassFunction(SymmetricGroup(4), [3, 1, -1, 0, -1])
298
sage: s = chi+chi
299
sage: s
300
Character of Symmetric group of order 4! as a permutation group
301
sage: s.values()
302
[6, 2, -2, 0, -2]
303
"""
304
if not isinstance(other, ClassFunction_gap):
305
raise NotImplementedError
306
s = self._gap_classfunction + other._gap_classfunction
307
return ClassFunction(self._group, s)
308
309
310
def __sub__(self, other):
311
r"""
312
Returns the difference of the characters ``self`` and ``other``.
313
314
INPUT:
315
316
- ``other`` -- a :class:`ClassFunction` of the same group as
317
``self``.
318
319
OUTPUT:
320
321
A :class:`ClassFunction`
322
323
EXAMPLES::
324
325
sage: G = SymmetricGroup(4)
326
sage: chi1 = ClassFunction(G, [3, 1, -1, 0, -1])
327
sage: chi2 = ClassFunction(G, [1, -1, 1, 1, -1])
328
sage: s = chi1 - chi2
329
sage: s
330
Character of Symmetric group of order 4! as a permutation group
331
sage: s.values()
332
[2, 2, -2, -1, 0]
333
"""
334
if not isinstance(other, ClassFunction_gap):
335
raise NotImplementedError
336
s = self._gap_classfunction - other._gap_classfunction
337
return ClassFunction(self._group, s)
338
339
340
def __mul__(self, other):
341
r"""
342
Return the product of the character with ``other``.
343
344
INPUT:
345
346
- ``other`` -- either a number or a :class:`ClassFunction` of
347
the same group as ``self``. A number can be anything that
348
can be converted into GAP: integers, rational, and elements
349
of certain number fields.
350
351
OUTPUT:
352
353
A :class:`ClassFunction`
354
355
EXAMPLES::
356
357
sage: G = SymmetricGroup(4)
358
sage: chi1 = ClassFunction(G, [3, 1, -1, 0, -1])
359
sage: 3*chi1
360
Character of Symmetric group of order 4! as a permutation group
361
sage: 3*chi1 == chi1+chi1+chi1
362
True
363
sage: (3*chi1).values()
364
[9, 3, -3, 0, -3]
365
366
367
sage: (1/2*chi1).values()
368
[3/2, 1/2, -1/2, 0, -1/2]
369
370
sage: CF3 = CyclotomicField(3)
371
sage: CF3.inject_variables()
372
Defining zeta3
373
sage: (zeta3 * chi1).values()
374
[3*zeta3, zeta3, -zeta3, 0, -zeta3]
375
376
sage: chi2 = ClassFunction(G, [1, -1, 1, 1, -1])
377
sage: p = chi1*chi2
378
sage: p
379
Character of Symmetric group of order 4! as a permutation group
380
sage: p.values()
381
[3, -1, -1, 0, 1]
382
"""
383
if isinstance(other, ClassFunction_gap):
384
p = self._gap_classfunction * other._gap_classfunction
385
return ClassFunction(self._group, p)
386
else:
387
return ClassFunction(self._group, other * self._gap_classfunction)
388
389
390
def __rmul__(self, other):
391
r"""
392
Return the reverse multiplication of ``self`` and ``other``.
393
394
EXAMPLES::
395
396
sage: G = SymmetricGroup(4)
397
sage: chi = ClassFunction(G, [3, 1, -1, 0, -1])
398
sage: chi * 4 # calls chi.__mul__
399
Character of Symmetric group of order 4! as a permutation group
400
sage: 4 * chi # calls chi.__rmul__
401
Character of Symmetric group of order 4! as a permutation group
402
sage: (4 * chi).values()
403
[12, 4, -4, 0, -4]
404
"""
405
return self.__mul__(other)
406
407
408
def __pos__(self):
409
r"""
410
Return ``self``.
411
412
OUTPUT:
413
414
A :class:`ClassFunction`
415
416
EXAMPLES::
417
418
sage: chi = ClassFunction(SymmetricGroup(4), [3, 1, -1, 0, -1])
419
sage: +chi
420
Character of Symmetric group of order 4! as a permutation group
421
sage: _.values()
422
[3, 1, -1, 0, -1]
423
sage: chi.__pos__() == +chi
424
True
425
"""
426
return ClassFunction(self._group, self._gap_classfunction)
427
428
429
def __neg__(self):
430
r"""
431
Return the additive inverse of ``self``.
432
433
OUTPUT:
434
435
A :class:`ClassFunction`
436
437
EXAMPLES::
438
439
sage: chi = ClassFunction(SymmetricGroup(4), [3, 1, -1, 0, -1])
440
sage: -chi
441
Character of Symmetric group of order 4! as a permutation group
442
sage: _.values()
443
[-3, -1, 1, 0, 1]
444
sage: chi.__neg__() == -chi
445
True
446
"""
447
return ClassFunction(self._group, -self._gap_classfunction)
448
449
450
def __pow__(self, other):
451
r"""
452
Returns the product of self with itself other times.
453
454
EXAMPLES::
455
456
sage: chi = ClassFunction(SymmetricGroup(4), [3, 1, -1, 0, -1])
457
sage: p = chi**3
458
sage: p
459
Character of Symmetric group of order 4! as a permutation group
460
sage: p.values()
461
[27, 1, -1, 0, -1]
462
"""
463
if not isinstance(other, (int,Integer)):
464
raise NotImplementedError
465
return ClassFunction(self._group, self._gap_classfunction ** other)
466
467
468
def symmetric_power(self, n):
469
r"""
470
Returns the symmetrized product of self with itself ``n`` times.
471
472
INPUT:
473
474
- ``n`` -- a positive integer.
475
476
OUTPUT:
477
478
The ``n``-th symmetrized power of ``self`` as a
479
:class:`ClassFunction`.
480
481
EXAMPLES::
482
483
sage: chi = ClassFunction(SymmetricGroup(4), [3, 1, -1, 0, -1])
484
sage: p = chi.symmetric_power(3)
485
sage: p
486
Character of Symmetric group of order 4! as a permutation group
487
sage: p.values()
488
[10, 2, -2, 1, 0]
489
"""
490
n = Integer(n)
491
tbl = gap.UnderlyingCharacterTable(self)
492
return ClassFunction(self._group, gap.SymmetricParts(tbl,[self],n)[1])
493
494
495
def exterior_power(self, n):
496
r"""
497
Returns the anti-symmetrized product of self with itself ``n`` times.
498
499
INPUT:
500
501
- ``n`` -- a positive integer.
502
503
OUTPUT:
504
505
The ``n``-th anti-symmetrized power of ``self`` as a
506
:class:`ClassFunction`.
507
508
EXAMPLES::
509
510
sage: chi = ClassFunction(SymmetricGroup(4), [3, 1, -1, 0, -1])
511
sage: p = chi.exterior_power(3) # the highest anti-symmetric power for a 3-d character
512
sage: p
513
Character of Symmetric group of order 4! as a permutation group
514
sage: p.values()
515
[1, -1, 1, 1, -1]
516
sage: p == chi.determinant_character()
517
True
518
"""
519
n = Integer(n)
520
tbl = gap.UnderlyingCharacterTable(self)
521
return ClassFunction(self._group, gap.AntiSymmetricParts(tbl,[self],n)[1])
522
523
524
def scalar_product(self, other):
525
r"""
526
Returns the scalar product of self with other.
527
528
EXAMPLES::
529
530
sage: S4 = SymmetricGroup(4)
531
sage: irr = S4.irreducible_characters()
532
sage: [[x.scalar_product(y) for x in irr] for y in irr]
533
[[1, 0, 0, 0, 0],
534
[0, 1, 0, 0, 0],
535
[0, 0, 1, 0, 0],
536
[0, 0, 0, 1, 0],
537
[0, 0, 0, 0, 1]]
538
"""
539
return self._gap_classfunction.ScalarProduct(other)
540
541
542
def is_irreducible(self):
543
r"""
544
Returns True if self cannot be written as the sum of two nonzero
545
characters of self.
546
547
EXAMPLES::
548
549
sage: S4 = SymmetricGroup(4)
550
sage: irr = S4.irreducible_characters()
551
sage: [x.is_irreducible() for x in irr]
552
[True, True, True, True, True]
553
"""
554
return bool(self._gap_classfunction.IsIrreducible())
555
556
557
def degree(self):
558
r"""
559
Returns the degree of the character self.
560
561
EXAMPLES::
562
563
sage: S5 = SymmetricGroup(5)
564
sage: irr = S5.irreducible_characters()
565
sage: [x.degree() for x in irr]
566
[1, 4, 5, 6, 5, 4, 1]
567
"""
568
return Integer(self._gap_classfunction.DegreeOfCharacter())
569
570
571
def irreducible_constituents(self):
572
r"""
573
Returns a list of the characters that appear in the decomposition
574
of chi.
575
576
EXAMPLES::
577
578
sage: S5 = SymmetricGroup(5)
579
sage: chi = ClassFunction(S5, [22, -8, 2, 1, 1, 2, -3])
580
sage: irr = chi.irreducible_constituents(); irr
581
(Character of Symmetric group of order 5! as a permutation group,
582
Character of Symmetric group of order 5! as a permutation group)
583
sage: map(list, irr)
584
[[4, -2, 0, 1, 1, 0, -1], [5, -1, 1, -1, -1, 1, 0]]
585
sage: G = GL(2,3)
586
sage: chi = ClassFunction(G, [-1, -1, -1, -1, -1, -1, -1, -1])
587
sage: chi.irreducible_constituents()
588
(Character of General Linear Group of degree 2 over Finite Field of size 3,)
589
sage: chi = ClassFunction(G, [1, 1, 1, 1, 1, 1, 1, 1])
590
sage: chi.irreducible_constituents()
591
(Character of General Linear Group of degree 2 over Finite Field of size 3,)
592
sage: chi = ClassFunction(G, [2, 2, 2, 2, 2, 2, 2, 2])
593
sage: chi.irreducible_constituents()
594
(Character of General Linear Group of degree 2 over Finite Field of size 3,)
595
sage: chi = ClassFunction(G, [-1, -1, -1, -1, 3, -1, -1, 1])
596
sage: ic = chi.irreducible_constituents(); ic
597
(Character of General Linear Group of degree 2 over Finite Field of size 3,
598
Character of General Linear Group of degree 2 over Finite Field of size 3)
599
sage: map(list, ic)
600
[[2, -1, 2, -1, 2, 0, 0, 0], [3, 0, 3, 0, -1, 1, 1, -1]]
601
"""
602
L = self._gap_classfunction.ConstituentsOfCharacter()
603
return tuple(ClassFunction(self._group, list(l)) for l in L)
604
605
606
def decompose(self):
607
r"""
608
Returns a list of the characters that appear in the decomposition
609
of chi.
610
611
EXAMPLES::
612
613
sage: S5 = SymmetricGroup(5)
614
sage: chi = ClassFunction(S5, [22, -8, 2, 1, 1, 2, -3])
615
sage: chi.decompose()
616
((3, Character of Symmetric group of order 5! as a permutation group),
617
(2, Character of Symmetric group of order 5! as a permutation group))
618
"""
619
L = []
620
for irr in self.irreducible_constituents():
621
L.append((self.scalar_product(irr), irr))
622
return tuple(L)
623
624
625
def norm(self):
626
r"""
627
Returns the norm of self.
628
629
EXAMPLES::
630
631
sage: A5 = AlternatingGroup(5)
632
sage: [x.norm() for x in A5.irreducible_characters()]
633
[1, 1, 1, 1, 1]
634
"""
635
return self._gap_classfunction.Norm()
636
637
638
def values(self):
639
r"""
640
Return the list of values of self on the conjugacy classes.
641
642
EXAMPLES::
643
644
sage: G = GL(2,3)
645
sage: [x.values() for x in G.irreducible_characters()] #random
646
[[1, 1, 1, 1, 1, 1, 1, 1],
647
[1, 1, 1, 1, 1, -1, -1, -1],
648
[2, -1, 2, -1, 2, 0, 0, 0],
649
[2, 1, -2, -1, 0, -zeta8^3 - zeta8, zeta8^3 + zeta8, 0],
650
[2, 1, -2, -1, 0, zeta8^3 + zeta8, -zeta8^3 - zeta8, 0],
651
[3, 0, 3, 0, -1, -1, -1, 1],
652
[3, 0, 3, 0, -1, 1, 1, -1],
653
[4, -1, -4, 1, 0, 0, 0, 0]]
654
655
TESTS::
656
657
sage: G = GL(2,3)
658
sage: k = CyclotomicField(8)
659
sage: zeta8 = k.gen()
660
sage: v = [tuple(x.values()) for x in G.irreducible_characters()]
661
sage: set(v) == set([(1, 1, 1, 1, 1, 1, 1, 1), (1, 1, 1, 1, 1, -1, -1, -1), (2, -1, 2, -1, 2, 0, 0, 0), (2, 1, -2, -1, 0, -zeta8^3 - zeta8, zeta8^3 + zeta8, 0), (2, 1, -2, -1, 0, zeta8^3 + zeta8, -zeta8^3 - zeta8, 0), (3, 0, 3, 0, -1, -1, -1, 1), (3, 0, 3, 0, -1, 1, 1, -1), (4, -1, -4, 1, 0, 0, 0, 0)])
662
True
663
"""
664
return list(self)
665
666
667
def central_character(self):
668
r"""
669
Returns the central character of self.
670
671
EXAMPLES::
672
673
sage: t = SymmetricGroup(4).trivial_character()
674
sage: t.central_character().values()
675
[1, 6, 3, 8, 6]
676
"""
677
return ClassFunction(self._group, self._gap_classfunction.CentralCharacter())
678
679
680
def determinant_character(self):
681
r"""
682
Returns the determinant character of self.
683
684
EXAMPLES::
685
686
sage: t = ClassFunction(SymmetricGroup(4), [1, -1, 1, 1, -1])
687
sage: t.determinant_character().values()
688
[1, -1, 1, 1, -1]
689
"""
690
return ClassFunction(self._group, self._gap_classfunction.DeterminantOfCharacter())
691
692
693
def tensor_product(self, other):
694
r"""
695
EXAMPLES::
696
697
sage: S3 = SymmetricGroup(3)
698
sage: chi1, chi2, chi3 = S3.irreducible_characters()
699
sage: chi1.tensor_product(chi3).values()
700
[1, -1, 1]
701
"""
702
return ClassFunction(self._group, gap.Tensored([self],[other])[1])
703
704
705
def restrict(self, H):
706
r"""
707
Return the restricted character.
708
709
INPUT:
710
711
- ``H`` -- a subgroup of the underlying group of ``self``.
712
713
OUTPUT:
714
715
A :class:`ClassFunction` of ``H`` defined by restriction.
716
717
EXAMPLES::
718
719
sage: G = SymmetricGroup(5)
720
sage: chi = ClassFunction(G, [3, -3, -1, 0, 0, -1, 3]); chi
721
Character of Symmetric group of order 5! as a permutation group
722
sage: H = G.subgroup([(1,2,3), (1,2), (4,5)])
723
sage: chi.restrict(H)
724
Character of Subgroup of (Symmetric group of order 5! as a permutation group) generated by [(4,5), (1,2), (1,2,3)]
725
sage: chi.restrict(H).values()
726
[3, -3, -3, -1, 0, 0]
727
"""
728
rest = self._gap_classfunction.RestrictedClassFunction(H._gap_())
729
return ClassFunction(H, rest)
730
731
732
def induct(self, G):
733
r"""
734
Return the induced character.
735
736
INPUT:
737
738
- ``G`` -- A supergroup of the underlying group of ``self``.
739
740
OUTPUT:
741
742
A :class:`ClassFunction` of ``G`` defined by
743
induction. Induction is the adjoint functor to restriction,
744
see :meth:`restrict`.
745
746
EXAMPLES::
747
748
sage: G = SymmetricGroup(5)
749
sage: H = G.subgroup([(1,2,3), (1,2), (4,5)])
750
sage: xi = H.trivial_character(); xi
751
Character of Subgroup of (Symmetric group of order 5! as a permutation group) generated by [(4,5), (1,2), (1,2,3)]
752
sage: xi.induct(G)
753
Character of Symmetric group of order 5! as a permutation group
754
sage: xi.induct(G).values()
755
[10, 4, 2, 1, 1, 0, 0]
756
"""
757
rest = self._gap_classfunction.InducedClassFunction(G._gap_())
758
return ClassFunction(G, rest)
759
760
761
762
763
764
765
#####################################################################
766
###
767
### libGAP-based Class function
768
###
769
#####################################################################
770
771
class ClassFunction_libgap(SageObject):
772
"""
773
A wrapper of GAP's ClassFunction function.
774
775
.. NOTE::
776
777
It is *not* checked whether the given values describes a character,
778
since GAP does not do this.
779
780
EXAMPLES::
781
782
sage: G = SO(3,3)
783
sage: values = [1, -1, -1, 1, 2]
784
sage: chi = ClassFunction(G, values); chi
785
Character of Special Orthogonal Group of degree 3 over Finite Field of size 3
786
sage: loads(dumps(chi)) == chi
787
True
788
"""
789
790
def __init__(self, G, values):
791
r"""
792
Return the character of the group ``G`` with values given by the list
793
values. The order of the values must correspond to the output of
794
``G.conjugacy_classes_representatives()``.
795
796
EXAMPLES::
797
798
sage: G = CyclicPermutationGroup(4)
799
sage: values = [1, -1, 1, -1]
800
sage: chi = ClassFunction(G, values); chi
801
Character of Cyclic group of order 4 as a permutation group
802
"""
803
self._group = G
804
if isinstance(values, GapElement) and values.IsClassFunction():
805
self._gap_classfunction = values
806
else:
807
from sage.libs.gap.libgap import libgap
808
self._gap_classfunction = libgap.ClassFunction(G.gap(), list(values))
809
e = self._gap_classfunction.Conductor().sage()
810
self._base_ring = CyclotomicField(e)
811
812
813
def gap(self):
814
r"""
815
Return the underlying LibGAP element.
816
817
EXAMPLES::
818
819
sage: G = CyclicPermutationGroup(4)
820
sage: values = [1, -1, 1, -1]
821
sage: chi = ClassFunction(G, values); chi
822
Character of Cyclic group of order 4 as a permutation group
823
sage: type(chi)
824
<class 'sage.groups.class_function.ClassFunction_gap'>
825
sage: gap(chi)
826
ClassFunction( CharacterTable( Group( [ (1,2,3,4) ] ) ), [ 1, -1, 1, -1 ] )
827
sage: type(_)
828
<class 'sage.interfaces.gap.GapElement'>
829
"""
830
return self._gap_classfunction
831
832
833
def _repr_(self):
834
r"""
835
Return a string representation.
836
837
OUTPUT:
838
839
A string.
840
841
EXAMPLES::
842
843
sage: G = SymmetricGroup(4)
844
sage: values = [1, -1, 1, 1, -1]
845
sage: ClassFunction(G, values)
846
Character of Symmetric group of order 4! as a permutation group
847
"""
848
return "Character of %s" % repr(self._group)
849
850
851
def __iter__(self):
852
r"""
853
Iterate through the values.
854
855
A class function assigns values to each conjugacy class. This
856
method iterates over the values, in the same order as the
857
conjugacy classes of the group.
858
859
EXAMPLES::
860
861
sage: xi = ClassFunction(SymmetricGroup(4), [1, -1, 1, 1, -1])
862
sage: list(xi)
863
[1, -1, 1, 1, -1]
864
"""
865
for v in self._gap_classfunction.List():
866
yield v.sage(ring=self._base_ring)
867
868
869
def __cmp__(self, other):
870
r"""
871
Rich comparison for class functions.
872
873
Compares groups and then the values of the class function on the
874
conjugacy classes. Otherwise, compares types of objects.
875
876
EXAMPLES::
877
878
sage: G = PermutationGroup([[(1,2,3),(4,5)],[(3,4)]])
879
sage: chi = G.character([1, 1, 1, 1, 1, 1, 1])
880
sage: H = PermutationGroup([[(1,2,3),(4,5)]])
881
sage: xi = H.character([1, 1, 1, 1, 1, 1])
882
sage: chi == chi
883
True
884
sage: xi == xi
885
True
886
sage: xi == chi
887
False
888
sage: chi < xi
889
False
890
sage: xi < chi
891
True
892
893
"""
894
if isinstance(other, ClassFunction_libgap):
895
return cmp((self._group, self.values()),
896
(other._group, other.values()))
897
else:
898
return cmp(type(self), type(other))
899
900
901
def __reduce__(self):
902
r"""
903
Add pickle support.
904
905
EXAMPLES::
906
907
sage: G = GL(2,7)
908
sage: values = G.gap().CharacterTable().Irr()[2].List().sage()
909
sage: chi = ClassFunction(G, values)
910
sage: type(chi)
911
<class 'sage.groups.class_function.ClassFunction_libgap'>
912
sage: loads(dumps(chi)) == chi
913
True
914
"""
915
return ClassFunction_libgap, (self._group, self.values())
916
917
918
def domain(self):
919
r"""
920
Return the domain of ``self``.
921
922
OUTPUT:
923
924
The underlying group of the class function.
925
926
EXAMPLES::
927
928
sage: ClassFunction(SymmetricGroup(4), [1,-1,1,1,-1]).domain()
929
Symmetric group of order 4! as a permutation group
930
"""
931
return self._group
932
933
934
def __call__(self, g):
935
"""
936
Evaluate the character on the group element ``g``. Returns an error if
937
``g`` is not in ``G`.
938
939
EXAMPLES::
940
941
sage: G = GL(2,7)
942
sage: values = G.gap().CharacterTable().Irr()[2].List().sage()
943
sage: chi = ClassFunction(G, values)
944
sage: z = G([[3,0],[0,3]]); z
945
[3 0]
946
[0 3]
947
sage: chi(z)
948
zeta3
949
950
sage: G = GL(2,3)
951
sage: chi = G.irreducible_characters()[3]
952
sage: g = G.conjugacy_class_representatives()[6]
953
sage: chi(g)
954
zeta8^3 + zeta8
955
956
sage: G = SymmetricGroup(3)
957
sage: h = G((2,3))
958
sage: triv = G.trivial_character()
959
sage: triv(h)
960
1
961
"""
962
value = g.gap() ** self.gap()
963
return value.sage(self._base_ring)
964
965
966
def __add__(self, other):
967
r"""
968
Return the sum of the characters ``self`` and ``other``.
969
970
INPUT:
971
972
- ``other`` -- a :class:`ClassFunction` of the same group as
973
``self``.
974
975
OUTPUT:
976
977
A :class:`ClassFunction`
978
979
EXAMPLES::
980
981
sage: chi = ClassFunction(SymmetricGroup(4), [3, 1, -1, 0, -1])
982
sage: s = chi+chi
983
sage: s
984
Character of Symmetric group of order 4! as a permutation group
985
sage: s.values()
986
[6, 2, -2, 0, -2]
987
"""
988
if not isinstance(other, ClassFunction_libgap):
989
raise NotImplementedError
990
s = self._gap_classfunction + other._gap_classfunction
991
return ClassFunction(self._group, s)
992
993
994
def __sub__(self, other):
995
r"""
996
Return the difference of the characters ``self`` and ``other``.
997
998
INPUT:
999
1000
- ``other`` -- a :class:`ClassFunction` of the same group as
1001
``self``.
1002
1003
OUTPUT:
1004
1005
A :class:`ClassFunction`
1006
1007
EXAMPLES::
1008
1009
sage: G = SymmetricGroup(4)
1010
sage: chi1 = ClassFunction(G, [3, 1, -1, 0, -1])
1011
sage: chi2 = ClassFunction(G, [1, -1, 1, 1, -1])
1012
sage: s = chi1 - chi2
1013
sage: s
1014
Character of Symmetric group of order 4! as a permutation group
1015
sage: s.values()
1016
[2, 2, -2, -1, 0]
1017
"""
1018
if not isinstance(other, ClassFunction_libgap):
1019
raise NotImplementedError
1020
s = self._gap_classfunction - other._gap_classfunction
1021
return ClassFunction(self._group, s)
1022
1023
1024
def __mul__(self, other):
1025
r"""
1026
Return the product of the character with ``other``.
1027
1028
INPUT:
1029
1030
- ``other`` -- either a number or a :class:`ClassFunction` of
1031
the same group as ``self``. A number can be anything that
1032
can be converted into GAP: integers, rational, and elements
1033
of certain number fields.
1034
1035
OUTPUT:
1036
1037
A :class:`ClassFunction`
1038
1039
EXAMPLES::
1040
1041
sage: G = SymmetricGroup(4)
1042
sage: chi1 = ClassFunction(G, [3, 1, -1, 0, -1])
1043
sage: 3*chi1
1044
Character of Symmetric group of order 4! as a permutation group
1045
sage: 3*chi1 == chi1+chi1+chi1
1046
True
1047
sage: (3*chi1).values()
1048
[9, 3, -3, 0, -3]
1049
1050
1051
sage: (1/2*chi1).values()
1052
[3/2, 1/2, -1/2, 0, -1/2]
1053
1054
sage: CF3 = CyclotomicField(3)
1055
sage: CF3.inject_variables()
1056
Defining zeta3
1057
sage: (zeta3 * chi1).values()
1058
[3*zeta3, zeta3, -zeta3, 0, -zeta3]
1059
1060
sage: chi2 = ClassFunction(G, [1, -1, 1, 1, -1])
1061
sage: p = chi1*chi2
1062
sage: p
1063
Character of Symmetric group of order 4! as a permutation group
1064
sage: p.values()
1065
[3, -1, -1, 0, 1]
1066
"""
1067
if isinstance(other, ClassFunction_libgap):
1068
p = self._gap_classfunction * other._gap_classfunction
1069
return ClassFunction(self._group, p)
1070
else:
1071
return ClassFunction(self._group, other * self._gap_classfunction)
1072
1073
1074
def __rmul__(self, other):
1075
r"""
1076
Return the reverse multiplication of ``self`` and ``other``.
1077
1078
EXAMPLES::
1079
1080
sage: G = SymmetricGroup(4)
1081
sage: chi = ClassFunction(G, [3, 1, -1, 0, -1])
1082
sage: chi * 4 # calls chi.__mul__
1083
Character of Symmetric group of order 4! as a permutation group
1084
sage: 4 * chi # calls chi.__rmul__
1085
Character of Symmetric group of order 4! as a permutation group
1086
sage: (4 * chi).values()
1087
[12, 4, -4, 0, -4]
1088
"""
1089
return self.__mul__(other)
1090
1091
1092
def __pos__(self):
1093
r"""
1094
Return ``self``.
1095
1096
OUTPUT:
1097
1098
A :class:`ClassFunction`
1099
1100
EXAMPLES::
1101
1102
sage: chi = ClassFunction(SymmetricGroup(4), [3, 1, -1, 0, -1])
1103
sage: +chi
1104
Character of Symmetric group of order 4! as a permutation group
1105
sage: _.values()
1106
[3, 1, -1, 0, -1]
1107
sage: chi.__pos__() == +chi
1108
True
1109
"""
1110
return ClassFunction(self._group, self._gap_classfunction)
1111
1112
1113
def __neg__(self):
1114
r"""
1115
Return the additive inverse of ``self``.
1116
1117
OUTPUT:
1118
1119
A :class:`ClassFunction`
1120
1121
EXAMPLES::
1122
1123
sage: chi = ClassFunction(SymmetricGroup(4), [3, 1, -1, 0, -1])
1124
sage: -chi
1125
Character of Symmetric group of order 4! as a permutation group
1126
sage: _.values()
1127
[-3, -1, 1, 0, 1]
1128
sage: chi.__neg__() == -chi
1129
True
1130
"""
1131
return ClassFunction(self._group, -self._gap_classfunction)
1132
1133
1134
def __pow__(self, other):
1135
r"""
1136
Return the product of ``self`` with itself ``other`` times.
1137
1138
EXAMPLES::
1139
1140
sage: chi = ClassFunction(SymmetricGroup(4), [3, 1, -1, 0, -1])
1141
sage: p = chi**3
1142
sage: p
1143
Character of Symmetric group of order 4! as a permutation group
1144
sage: p.values()
1145
[27, 1, -1, 0, -1]
1146
"""
1147
if not isinstance(other, (int,Integer)):
1148
raise NotImplementedError
1149
return ClassFunction(self._group, self._gap_classfunction ** other)
1150
1151
1152
def symmetric_power(self, n):
1153
r"""
1154
Return the symmetrized product of ``self`` with itself ``n`` times.
1155
1156
INPUT:
1157
1158
- ``n`` -- a positive integer
1159
1160
OUTPUT:
1161
1162
The ``n``-th symmetrized power of ``self`` as a
1163
:class:`ClassFunction`.
1164
1165
EXAMPLES::
1166
1167
sage: chi = ClassFunction(SymmetricGroup(4), [3, 1, -1, 0, -1])
1168
sage: p = chi.symmetric_power(3)
1169
sage: p
1170
Character of Symmetric group of order 4! as a permutation group
1171
sage: p.values()
1172
[10, 2, -2, 1, 0]
1173
"""
1174
n = Integer(n)
1175
tbl = self._gap_classfunction.UnderlyingCharacterTable(self)
1176
return ClassFunction(self._group, tbl.SymmetricParts([self],n)[1])
1177
1178
1179
def exterior_power(self, n):
1180
r"""
1181
Return the anti-symmetrized product of ``self`` with itself ``n`` times.
1182
1183
INPUT:
1184
1185
- ``n`` -- a positive integer
1186
1187
OUTPUT:
1188
1189
The ``n``-th anti-symmetrized power of ``self`` as a
1190
:class:`ClassFunction`.
1191
1192
EXAMPLES::
1193
1194
sage: chi = ClassFunction(SymmetricGroup(4), [3, 1, -1, 0, -1])
1195
sage: p = chi.exterior_power(3) # the highest anti-symmetric power for a 3-d character
1196
sage: p
1197
Character of Symmetric group of order 4! as a permutation group
1198
sage: p.values()
1199
[1, -1, 1, 1, -1]
1200
sage: p == chi.determinant_character()
1201
True
1202
"""
1203
n = Integer(n)
1204
tbl = self._gap_classfunction.UnderlyingCharacterTable(self)
1205
return ClassFunction(self._group, tbl.AntiSymmetricParts([self],n)[1])
1206
1207
1208
def scalar_product(self, other):
1209
r"""
1210
Return the scalar product of ``self`` with ``other``.
1211
1212
EXAMPLES::
1213
1214
sage: S4 = SymmetricGroup(4)
1215
sage: irr = S4.irreducible_characters()
1216
sage: [[x.scalar_product(y) for x in irr] for y in irr]
1217
[[1, 0, 0, 0, 0],
1218
[0, 1, 0, 0, 0],
1219
[0, 0, 1, 0, 0],
1220
[0, 0, 0, 1, 0],
1221
[0, 0, 0, 0, 1]]
1222
"""
1223
return self._gap_classfunction.ScalarProduct(other).sage()
1224
1225
1226
def is_irreducible(self):
1227
r"""
1228
Return ``True`` if ``self`` cannot be written as the sum of two nonzero
1229
characters of ``self``.
1230
1231
EXAMPLES::
1232
1233
sage: S4 = SymmetricGroup(4)
1234
sage: irr = S4.irreducible_characters()
1235
sage: [x.is_irreducible() for x in irr]
1236
[True, True, True, True, True]
1237
"""
1238
return self._gap_classfunction.IsIrreducible().sage()
1239
1240
1241
def degree(self):
1242
r"""
1243
Return the degree of the character ``self``.
1244
1245
EXAMPLES::
1246
1247
sage: S5 = SymmetricGroup(5)
1248
sage: irr = S5.irreducible_characters()
1249
sage: [x.degree() for x in irr]
1250
[1, 4, 5, 6, 5, 4, 1]
1251
"""
1252
return self._gap_classfunction.DegreeOfCharacter().sage()
1253
1254
1255
def irreducible_constituents(self):
1256
r"""
1257
Return a list of the characters that appear in the decomposition
1258
of ``self``.
1259
1260
EXAMPLES::
1261
1262
sage: S5 = SymmetricGroup(5)
1263
sage: chi = ClassFunction(S5, [22, -8, 2, 1, 1, 2, -3])
1264
sage: irr = chi.irreducible_constituents(); irr
1265
(Character of Symmetric group of order 5! as a permutation group,
1266
Character of Symmetric group of order 5! as a permutation group)
1267
sage: map(list, irr)
1268
[[4, -2, 0, 1, 1, 0, -1], [5, -1, 1, -1, -1, 1, 0]]
1269
1270
sage: G = GL(2,3)
1271
sage: chi = ClassFunction(G, [-1, -1, -1, -1, -1, -1, -1, -1])
1272
sage: chi.irreducible_constituents()
1273
(Character of General Linear Group of degree 2 over Finite Field of size 3,)
1274
sage: chi = ClassFunction(G, [1, 1, 1, 1, 1, 1, 1, 1])
1275
sage: chi.irreducible_constituents()
1276
(Character of General Linear Group of degree 2 over Finite Field of size 3,)
1277
sage: chi = ClassFunction(G, [2, 2, 2, 2, 2, 2, 2, 2])
1278
sage: chi.irreducible_constituents()
1279
(Character of General Linear Group of degree 2 over Finite Field of size 3,)
1280
sage: chi = ClassFunction(G, [-1, -1, -1, -1, 3, -1, -1, 1])
1281
sage: ic = chi.irreducible_constituents(); ic
1282
(Character of General Linear Group of degree 2 over Finite Field of size 3,
1283
Character of General Linear Group of degree 2 over Finite Field of size 3)
1284
sage: map(list, ic)
1285
[[2, -1, 2, -1, 2, 0, 0, 0], [3, 0, 3, 0, -1, 1, 1, -1]]
1286
"""
1287
L = self._gap_classfunction.ConstituentsOfCharacter()
1288
return tuple(ClassFunction_libgap(self._group, l) for l in L)
1289
1290
1291
def decompose(self):
1292
r"""
1293
Return a list of the characters that appear in the decomposition
1294
of ``self``.
1295
1296
EXAMPLES::
1297
1298
sage: S5 = SymmetricGroup(5)
1299
sage: chi = ClassFunction(S5, [22, -8, 2, 1, 1, 2, -3])
1300
sage: chi.decompose()
1301
((3, Character of Symmetric group of order 5! as a permutation group),
1302
(2, Character of Symmetric group of order 5! as a permutation group))
1303
"""
1304
L = []
1305
for irr in self.irreducible_constituents():
1306
L.append((self.scalar_product(irr), irr))
1307
return tuple(L)
1308
1309
1310
def norm(self):
1311
r"""
1312
Return the norm of ``self``.
1313
1314
EXAMPLES::
1315
1316
sage: A5 = AlternatingGroup(5)
1317
sage: [x.norm() for x in A5.irreducible_characters()]
1318
[1, 1, 1, 1, 1]
1319
"""
1320
return self._gap_classfunction.Norm().sage()
1321
1322
1323
def values(self):
1324
r"""
1325
Return the list of values of self on the conjugacy classes.
1326
1327
EXAMPLES::
1328
1329
sage: G = GL(2,3)
1330
sage: [x.values() for x in G.irreducible_characters()] #random
1331
[[1, 1, 1, 1, 1, 1, 1, 1],
1332
[1, 1, 1, 1, 1, -1, -1, -1],
1333
[2, -1, 2, -1, 2, 0, 0, 0],
1334
[2, 1, -2, -1, 0, -zeta8^3 - zeta8, zeta8^3 + zeta8, 0],
1335
[2, 1, -2, -1, 0, zeta8^3 + zeta8, -zeta8^3 - zeta8, 0],
1336
[3, 0, 3, 0, -1, -1, -1, 1],
1337
[3, 0, 3, 0, -1, 1, 1, -1],
1338
[4, -1, -4, 1, 0, 0, 0, 0]]
1339
1340
TESTS::
1341
1342
sage: G = GL(2,3)
1343
sage: k = CyclotomicField(8)
1344
sage: zeta8 = k.gen()
1345
sage: v = [tuple(x.values()) for x in G.irreducible_characters()]
1346
sage: set(v) == set([(1, 1, 1, 1, 1, 1, 1, 1), (1, 1, 1, 1, 1, -1, -1, -1), (2, -1, 2, -1, 2, 0, 0, 0), (2, 1, -2, -1, 0, -zeta8^3 - zeta8, zeta8^3 + zeta8, 0), (2, 1, -2, -1, 0, zeta8^3 + zeta8, -zeta8^3 - zeta8, 0), (3, 0, 3, 0, -1, -1, -1, 1), (3, 0, 3, 0, -1, 1, 1, -1), (4, -1, -4, 1, 0, 0, 0, 0)])
1347
True
1348
"""
1349
return list(self)
1350
1351
1352
def central_character(self):
1353
r"""
1354
Return the central character of ``self``.
1355
1356
EXAMPLES::
1357
1358
sage: t = SymmetricGroup(4).trivial_character()
1359
sage: t.central_character().values()
1360
[1, 6, 3, 8, 6]
1361
"""
1362
return ClassFunction(self._group, self._gap_classfunction.CentralCharacter())
1363
1364
1365
def determinant_character(self):
1366
r"""
1367
Return the determinant character of ``self``.
1368
1369
EXAMPLES::
1370
1371
sage: t = ClassFunction(SymmetricGroup(4), [1, -1, 1, 1, -1])
1372
sage: t.determinant_character().values()
1373
[1, -1, 1, 1, -1]
1374
"""
1375
return ClassFunction(self._group, self._gap_classfunction.DeterminantOfCharacter())
1376
1377
1378
def tensor_product(self, other):
1379
r"""
1380
Return the tensor product of ``self`` and ``other``.
1381
1382
EXAMPLES::
1383
1384
sage: S3 = SymmetricGroup(3)
1385
sage: chi1, chi2, chi3 = S3.irreducible_characters()
1386
sage: chi1.tensor_product(chi3).values()
1387
[1, -1, 1]
1388
"""
1389
from sage.libs.gap.libgap import libgap
1390
product = libgap.Tensored([self], [other])
1391
return ClassFunction(self._group, product[1])
1392
1393
1394
def restrict(self, H):
1395
r"""
1396
Return the restricted character.
1397
1398
INPUT:
1399
1400
- ``H`` -- a subgroup of the underlying group of ``self``.
1401
1402
OUTPUT:
1403
1404
A :class:`ClassFunction` of ``H`` defined by restriction.
1405
1406
EXAMPLES::
1407
1408
sage: G = SymmetricGroup(5)
1409
sage: chi = ClassFunction(G, [3, -3, -1, 0, 0, -1, 3]); chi
1410
Character of Symmetric group of order 5! as a permutation group
1411
sage: H = G.subgroup([(1,2,3), (1,2), (4,5)])
1412
sage: chi.restrict(H)
1413
Character of Subgroup of (Symmetric group of order 5! as a permutation group) generated by [(4,5), (1,2), (1,2,3)]
1414
sage: chi.restrict(H).values()
1415
[3, -3, -3, -1, 0, 0]
1416
"""
1417
try:
1418
gapH = H.gap()
1419
except AttributeError:
1420
from sage.libs.gap.libgap import libgap
1421
gapH = libgap(H)
1422
rest = self._gap_classfunction.RestrictedClassFunction(gapH)
1423
return ClassFunction(H, rest)
1424
1425
1426
def induct(self, G):
1427
r"""
1428
Return the induced character.
1429
1430
INPUT:
1431
1432
- ``G`` -- A supergroup of the underlying group of ``self``.
1433
1434
OUTPUT:
1435
1436
A :class:`ClassFunction` of ``G`` defined by
1437
induction. Induction is the adjoint functor to restriction,
1438
see :meth:`restrict`.
1439
1440
EXAMPLES::
1441
1442
sage: G = SymmetricGroup(5)
1443
sage: H = G.subgroup([(1,2,3), (1,2), (4,5)])
1444
sage: xi = H.trivial_character(); xi
1445
Character of Subgroup of (Symmetric group of order 5! as a permutation group) generated by [(4,5), (1,2), (1,2,3)]
1446
sage: xi.induct(G)
1447
Character of Symmetric group of order 5! as a permutation group
1448
sage: xi.induct(G).values()
1449
[10, 4, 2, 1, 1, 0, 0]
1450
"""
1451
try:
1452
gapG = G.gap()
1453
except AttributeError:
1454
from sage.libs.gap.libgap import libgap
1455
gapG = libgap(G)
1456
ind = self._gap_classfunction.InducedClassFunction(gapG)
1457
return ClassFunction(G, ind)
1458
1459
1460