/* This file contains code for MAGMA to compute the vanishing-off subgroup of a group.   The first function computes the conjugacy classes on which a character vanishes off of.  It takes as its argument a class function.*/

 

vanishingoffclasseschar := function (chi);

  cla := {};

  n := #chi;

  for i in [1..n] do

    if chi[i] ne 0 then

      Include(~cla,i);

    end if;

  end for;

  return cla;

end function;

 

/* This next function computes the vanishing-off subgroup of a character.

It takes as its arguments, the group and the character.  Within its computations it computes the classes of G.*/

 

vanishingoffchar := function(g,chi);

  clg := Classes (g);

  cla := vanishingoffclasseschar (chi);

  vele := [ ];

  for i in cla do

    Append (~vele, clg[i][3]);

  end for;

  vchi := NormalClosure (g,sub<g|vele>);

  return vchi;

end function;

 

/* This next function computes the vanishing-off subgroup of the group (as defined in my paper.  Within its computations it computes the character table and the conjugacy classes of the group.  (There probably is a more efficient algorithm to compute the vanishing-off subgroup.) */

 

vanishingoffgroup := function (g);

  if IsAbelian (g) then

    return g;

  else

    ct := CharacterTable (g);

    cl := Classes (g);

    n := #ct;

    vcla := {};

    for i in [1..n] do

      chi := ct[i];

      if chi[1] ne 1 then

        clchi := vanishingoffclasseschar (chi);

        for j in clchi do

          Include (~vcla,j);

        end for;

      end if;

    end for;

    vele := [ ];

    for i in vcla do

      Append (~vele, cl [i][3]);

    end for;

    vg := NormalClosure (g,sub<g|vele>);

    return vg;

  end if;

end function;

 

/* This function computes a list of data for all groups in the small group database with the given order starting with st+1 and going until st+num.

For each of these groups, the first number is its ID in the small groups database, the second number is the Index of V(G).  It then computes |G_i:V_i (G)| for all i until this index is 1.*/

 

datavanishing := function (order,st,num);

  db := [ ];

  for i in [1..num] do

    j := i + st;

    temp := [ ];

    temp[1] := j;

    g := [ ];   

    vg := [ ];   

    g[1] := SmallGroup (order,j);

    if not(IsAbelian (g[1])) then

      vg[1] := vanishingoffgroup (g[1]);

      k := 1;

      temp [2] := Index (g[1],vg[1]);

      while temp[k+1] gt 1 do

        k := k+1;

        g[k] := CommutatorSubgroup (g[k-1],g[1]);

        vg[k] := CommutatorSubgroup (vg[k-1],g[1]);

        temp [k+1] := Index (g[k],vg[k]);

      end while;

    end if;

    db[i] := temp;

  end for;

  return db;

end function;