Representation theory

Ordinary characters

How can you compute character tables of a finite group in Sage? The Sage-GAP interface can be used to compute character tables.

You can construct the table of character values of a permutation group \(G\) as a Sage matrix, using the method character_table of the PermutationGroup class, or via the interface to the GAP command CharacterTable.

sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3,4)]])
sage: G.order()
8
sage: G.character_table()
[ 1  1  1  1  1]
[ 1 -1 -1  1  1]
[ 1 -1  1 -1  1]
[ 1  1 -1 -1  1]
[ 2  0  0  0 -2]
sage: CT = libgap(G).CharacterTable()
sage: CT.Display()
CT1

 2  3  2  2  2  3

   1a 2a 2b 4a 2c
2P 1a 1a 1a 2c 1a
3P 1a 2a 2b 4a 2c

X.1     1  1  1  1  1
X.2     1 -1 -1  1  1
X.3     1 -1  1 -1  1
X.4     1  1 -1 -1  1
X.5     2  .  .  . -2
>>> from sage.all import *
>>> G = PermutationGroup([[(Integer(1),Integer(2)),(Integer(3),Integer(4))], [(Integer(1),Integer(2),Integer(3),Integer(4))]])
>>> G.order()
8
>>> G.character_table()
[ 1  1  1  1  1]
[ 1 -1 -1  1  1]
[ 1 -1  1 -1  1]
[ 1  1 -1 -1  1]
[ 2  0  0  0 -2]
>>> CT = libgap(G).CharacterTable()
>>> CT.Display()
CT1
<BLANKLINE>
 2  3  2  2  2  3
<BLANKLINE>
   1a 2a 2b 4a 2c
2P 1a 1a 1a 2c 1a
3P 1a 2a 2b 4a 2c
<BLANKLINE>
X.1     1  1  1  1  1
X.2     1 -1 -1  1  1
X.3     1 -1  1 -1  1
X.4     1  1 -1 -1  1
X.5     2  .  .  . -2
G = PermutationGroup([[(1,2),(3,4)], [(1,2,3,4)]])
G.order()
G.character_table()
CT = libgap(G).CharacterTable()
CT.Display()

Here is another example:

sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3)]])
sage: G.character_table()
[         1          1          1          1]
[         1 -zeta3 - 1      zeta3          1]
[         1      zeta3 -zeta3 - 1          1]
[         3          0          0         -1]
sage: G = libgap.eval("Group((1,2)(3,4),(1,2,3))"); G
Group([ (1,2)(3,4), (1,2,3) ])
sage: T = G.CharacterTable()
sage: T.Display()
CT2

     2  2  .  .  2
     3  1  1  1  .

       1a 3a 3b 2a
    2P 1a 3b 3a 1a
    3P 1a 1a 1a 2a

X.1     1  1  1  1
X.2     1  A /A  1
X.3     1 /A  A  1
X.4     3  .  . -1

A = E(3)^2
  = (-1-Sqrt(-3))/2 = -1-b3
>>> from sage.all import *
>>> G = PermutationGroup([[(Integer(1),Integer(2)),(Integer(3),Integer(4))], [(Integer(1),Integer(2),Integer(3))]])
>>> G.character_table()
[         1          1          1          1]
[         1 -zeta3 - 1      zeta3          1]
[         1      zeta3 -zeta3 - 1          1]
[         3          0          0         -1]
>>> G = libgap.eval("Group((1,2)(3,4),(1,2,3))"); G
Group([ (1,2)(3,4), (1,2,3) ])
>>> T = G.CharacterTable()
>>> T.Display()
CT2
<BLANKLINE>
     2  2  .  .  2
     3  1  1  1  .
<BLANKLINE>
       1a 3a 3b 2a
    2P 1a 3b 3a 1a
    3P 1a 1a 1a 2a
<BLANKLINE>
X.1     1  1  1  1
X.2     1  A /A  1
X.3     1 /A  A  1
X.4     3  .  . -1
<BLANKLINE>
A = E(3)^2
  = (-1-Sqrt(-3))/2 = -1-b3
G = PermutationGroup([[(1,2),(3,4)], [(1,2,3)]])
G.character_table()
G = libgap.eval("Group((1,2)(3,4),(1,2,3))"); G
T = G.CharacterTable()
T.Display()

where \(E(3)\) denotes a cube root of unity, \(ER(-3)\) denotes a square root of \(-3\), say \(i\sqrt{3}\), and \(b3 = \frac{1}{2}(-1+i \sqrt{3})\). Note the added print Python command. This makes the output look much nicer.

sage: irr = G.Irr(); irr
[ Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, 1, 1, 1 ] ),
  Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, E(3)^2, E(3), 1 ] ),
  Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, E(3), E(3)^2, 1 ] ),
  Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 3, 0, 0, -1 ] ) ]
sage: irr.Display()
[ [       1,       1,       1,       1 ],
  [       1,  E(3)^2,    E(3),       1 ],
  [       1,    E(3),  E(3)^2,       1 ],
  [       3,       0,       0,      -1 ] ]
sage: CG = G.ConjugacyClasses(); CG
[ ()^G, (2,3,4)^G, (2,4,3)^G, (1,2)(3,4)^G ]
sage: gamma = CG[2]; gamma
(2,4,3)^G
sage: g = gamma.Representative(); g
(2,4,3)
sage: chi = irr[1]; chi
Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, E(3)^2, E(3), 1 ] )
sage: g^chi
E(3)
>>> from sage.all import *
>>> irr = G.Irr(); irr
[ Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, 1, 1, 1 ] ),
  Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, E(3)^2, E(3), 1 ] ),
  Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, E(3), E(3)^2, 1 ] ),
  Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 3, 0, 0, -1 ] ) ]
>>> irr.Display()
[ [       1,       1,       1,       1 ],
  [       1,  E(3)^2,    E(3),       1 ],
  [       1,    E(3),  E(3)^2,       1 ],
  [       3,       0,       0,      -1 ] ]
>>> CG = G.ConjugacyClasses(); CG
[ ()^G, (2,3,4)^G, (2,4,3)^G, (1,2)(3,4)^G ]
>>> gamma = CG[Integer(2)]; gamma
(2,4,3)^G
>>> g = gamma.Representative(); g
(2,4,3)
>>> chi = irr[Integer(1)]; chi
Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, E(3)^2, E(3), 1 ] )
>>> g**chi
E(3)
irr = G.Irr(); irr
irr.Display()
CG = G.ConjugacyClasses(); CG
gamma = CG[2]; gamma
g = gamma.Representative(); g
chi = irr[1]; chi
g^chi

This last quantity is the value of the character chi at the group element g.

Alternatively, if you turn IPython “pretty printing” off, then the table prints nicely.

sage: %Pprint
Pretty printing has been turned OFF
sage: G = libgap.eval("Group((1,2)(3,4),(1,2,3))"); G
Group([ (1,2)(3,4), (1,2,3) ])
sage: T = G.CharacterTable(); T
CharacterTable( Alt( [ 1 .. 4 ] ) )
sage: T.Display()
CT3

     2  2  2  .  .
     3  1  .  1  1

       1a 2a 3a 3b
    2P 1a 1a 3b 3a
    3P 1a 2a 1a 1a

X.1     1  1  1  1
X.2     1  1  A /A
X.3     1  1 /A  A
X.4     3 -1  .  .

A = E(3)^2
  = (-1-Sqrt(-3))/2 = -1-b3
sage: irr = G.Irr(); irr
[ Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, 1, 1, 1 ] ),
  Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, 1, E(3)^2, E(3) ] ),
  Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, 1, E(3), E(3)^2 ] ),
  Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 3, -1, 0, 0 ] ) ]
sage: irr.Display()
[ [       1,       1,       1,       1 ],
  [       1,       1,  E(3)^2,    E(3) ],
  [       1,       1,    E(3),  E(3)^2 ],
  [       3,      -1,       0,       0 ] ]
sage: %Pprint
Pretty printing has been turned ON
>>> from sage.all import *
>>> %Pprint
Pretty printing has been turned OFF
>>> G = libgap.eval("Group((1,2)(3,4),(1,2,3))"); G
Group([ (1,2)(3,4), (1,2,3) ])
>>> T = G.CharacterTable(); T
CharacterTable( Alt( [ 1 .. 4 ] ) )
>>> T.Display()
CT3
<BLANKLINE>
     2  2  2  .  .
     3  1  .  1  1
<BLANKLINE>
       1a 2a 3a 3b
    2P 1a 1a 3b 3a
    3P 1a 2a 1a 1a
<BLANKLINE>
X.1     1  1  1  1
X.2     1  1  A /A
X.3     1  1 /A  A
X.4     3 -1  .  .
<BLANKLINE>
A = E(3)^2
  = (-1-Sqrt(-3))/2 = -1-b3
>>> irr = G.Irr(); irr
[ Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, 1, 1, 1 ] ),
  Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, 1, E(3)^2, E(3) ] ),
  Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 1, 1, E(3), E(3)^2 ] ),
  Character( CharacterTable( Alt( [ 1 .. 4 ] ) ), [ 3, -1, 0, 0 ] ) ]
>>> irr.Display()
[ [       1,       1,       1,       1 ],
  [       1,       1,  E(3)^2,    E(3) ],
  [       1,       1,    E(3),  E(3)^2 ],
  [       3,      -1,       0,       0 ] ]
>>> %Pprint
Pretty printing has been turned ON
%Pprint
G = libgap.eval("Group((1,2)(3,4),(1,2,3))"); G
T = G.CharacterTable(); T
T.Display()
irr = G.Irr(); irr
irr.Display()
%Pprint

Brauer characters

The Brauer character tables in GAP do not yet have a “native” interface. To access them you can directly interface with GAP using the libgap.eval command.

The example below using the GAP interface illustrates the syntax.

sage: G = libgap.eval("Group((1,2)(3,4),(1,2,3))"); G
Group([ (1,2)(3,4), (1,2,3) ])
sage: irr = G.IrreducibleRepresentations(GF(7)); irr   # random arch. dependent output
[ [ (1,2)(3,4), (1,2,3) ] -> [ [ [ Z(7)^0 ] ], [ [ Z(7)^4 ] ] ],
  [ (1,2)(3,4), (1,2,3) ] -> [ [ [ Z(7)^0 ] ], [ [ Z(7)^2 ] ] ],
  [ (1,2)(3,4), (1,2,3) ] -> [ [ [ Z(7)^0 ] ], [ [ Z(7)^0 ] ] ],
  [ (1,2)(3,4), (1,2,3) ] ->
    [ [ [ Z(7)^2, Z(7)^5, Z(7) ], [ Z(7)^3, Z(7)^2, Z(7)^3 ],
        [ Z(7), Z(7)^5, Z(7)^2 ] ],
      [ [ 0*Z(7), Z(7)^0, 0*Z(7) ], [ 0*Z(7), 0*Z(7), Z(7)^0 ],
        [ Z(7)^0, 0*Z(7), 0*Z(7) ] ] ] ]
sage: brvals = [[chi.Image(c.Representative()).BrauerCharacterValue()
....:            for c in G.ConjugacyClasses()] for chi in irr]
sage: brvals         # random architecture dependent output
[ [       1,       1,  E(3)^2,    E(3) ],
  [       1,       1,    E(3),  E(3)^2 ],
  [       1,       1,       1,       1 ],
  [       3,      -1,       0,       0 ] ]
sage: T = G.CharacterTable()
sage: T.Display()
CT3

     2  2  .  .  2
     3  1  1  1  .

       1a 3a 3b 2a
    2P 1a 3b 3a 1a
    3P 1a 1a 1a 2a

X.1     1  1  1  1
X.2     1  A /A  1
X.3     1 /A  A  1
X.4     3  .  . -1

A = E(3)^2
  = (-1-Sqrt(-3))/2 = -1-b3
>>> from sage.all import *
>>> G = libgap.eval("Group((1,2)(3,4),(1,2,3))"); G
Group([ (1,2)(3,4), (1,2,3) ])
>>> irr = G.IrreducibleRepresentations(GF(Integer(7))); irr   # random arch. dependent output
[ [ (1,2)(3,4), (1,2,3) ] -> [ [ [ Z(7)^0 ] ], [ [ Z(7)^4 ] ] ],
  [ (1,2)(3,4), (1,2,3) ] -> [ [ [ Z(7)^0 ] ], [ [ Z(7)^2 ] ] ],
  [ (1,2)(3,4), (1,2,3) ] -> [ [ [ Z(7)^0 ] ], [ [ Z(7)^0 ] ] ],
  [ (1,2)(3,4), (1,2,3) ] ->
    [ [ [ Z(7)^2, Z(7)^5, Z(7) ], [ Z(7)^3, Z(7)^2, Z(7)^3 ],
        [ Z(7), Z(7)^5, Z(7)^2 ] ],
      [ [ 0*Z(7), Z(7)^0, 0*Z(7) ], [ 0*Z(7), 0*Z(7), Z(7)^0 ],
        [ Z(7)^0, 0*Z(7), 0*Z(7) ] ] ] ]
>>> brvals = [[chi.Image(c.Representative()).BrauerCharacterValue()
...            for c in G.ConjugacyClasses()] for chi in irr]
>>> brvals         # random architecture dependent output
[ [       1,       1,  E(3)^2,    E(3) ],
  [       1,       1,    E(3),  E(3)^2 ],
  [       1,       1,       1,       1 ],
  [       3,      -1,       0,       0 ] ]
>>> T = G.CharacterTable()
>>> T.Display()
CT3
<BLANKLINE>
     2  2  .  .  2
     3  1  1  1  .
<BLANKLINE>
       1a 3a 3b 2a
    2P 1a 3b 3a 1a
    3P 1a 1a 1a 2a
<BLANKLINE>
X.1     1  1  1  1
X.2     1  A /A  1
X.3     1 /A  A  1
X.4     3  .  . -1
<BLANKLINE>
A = E(3)^2
  = (-1-Sqrt(-3))/2 = -1-b3
G = libgap.eval("Group((1,2)(3,4),(1,2,3))"); G
irr = G.IrreducibleRepresentations(GF(7)); irr   # random arch. dependent output
brvals = [[chi.Image(c.Representative()).BrauerCharacterValue()
           for c in G.ConjugacyClasses()] for chi in irr]
brvals         # random architecture dependent output
T = G.CharacterTable()
T.Display()