Induced representations in GAP Background.
In a previous question I asked how one defines a (modular!) representation in GAP, and I came to learn that one just has to provide GAP with the entire group homomorphism using GroupHomomorphismByImages.
Some representation-theoretic functions turn out to expect you to give the representation in a different form. For instance, in a follow-up question I asked how to apply a MeatAxe-based function to my homomorphism (assuming my representation is over $\mathbb{F}_p$), and I came to learn that, actually, you had to implement it differently, namely using GModuleByMats.
This question is yet another instance of such a confusion.
Question.
I have a subgroup $H$ of a (finite) group $G$, and I have an explicit $H$-representation (preferably over a general base field). I would like GAP to give me the induced $G$-representation. What's the right way to go about this?
What I tried.
Chapter 2 of the manual of the GAP package repsn suggests that my task is possible. It lists a function called InducedSubgroupRepresentation which claims to do what we want. But there are two issues.

*

*No such function actually seems to exist. However, there's a function called InducedRepresentation. I will just assume that that's what the manual means.

*The manual is vague about the type of input. It claims it wants an ambient group $G$ and a representation. But as I now know, to GAP, 'representation' can mean many things. I have tried both the type produced by GroupHomomorphismByImages and by GModuleByMats. Neither of them work. Presumably, there's a third, yet different, way of implementing representations. What's the right implementation?

 A: First, this is (now corrected) not a function in main GAP, but in the package repsn. If we look at the documentation, we find an example that shows that the second argument is a homomorphism. However, when trying it for a representation in characteristic non-zero, an error arises
gap> g:=SymmetricGroup(5);;
gap> h:=SymmetricGroup(3);;
gap> reps:=IrreducibleRepresentations(h,GF(5));
[ [ (1,2,3), (1,2) ] -> [ [ [ Z(5)^0 ] ], [ [ Z(5)^0 ] ] ],
  [ (1,2,3), (1,2) ] -> [ [ [ Z(5)^0 ] ], [ [ Z(5)^2 ] ] ],
  [ (1,2,3), (1,2) ] -> [ [ [ 0*Z(5), Z(5)^0 ], [ Z(5)^2, Z(5)^2 ] ],
      [ [ Z(5)^2, Z(5)^2 ], [ 0*Z(5), Z(5)^0 ] ] ] ]
gap> InducedSubgroupRepresentation(g,reps[2]);
Error, usage: Group(<gen>,...), Group(<gens>), Group(<gens>,<id>) at /Users/hulpke/gap4/lib/grp.gi:4764 called from
Group( l ) at /Users/hulpke/gap4/pkg/repsn-3.1.0/gap/repsn.g:341 called

We inspect the error causing argument
brk> l;
[ [ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, Z(5)^0, 0, 0, 0 ],
[...]

and see (combination of rational 0 and characteristic five: Z(5)^0) that the error is due to careless coding for characteristic zero.
This makes the function easy to fix. Lets look at the code:
gap> Print(InducedSubgroupRepresentation);
function ( G, rep )
   [...]
    nmat := NullMat( d, d );
   [...]

We need to make this null matrix over the right field, so replace this line with:
    nmat := NullMat( d, d, DefaultFieldOfMatrixGroup(Range(rep)) );

Also, it would be good to use compact matrices, the resulting code is below (and does not need the repsn package any longer). With this, it also works in finite characteristic:
gap> NewInducedRepresentation(g,reps[2]);
[ (1,2,3,4,5), (1,2) ] -> [ < immutable compressed matrix 20x20 over GF(5) >,
  < immutable compressed matrix 20x20 over GF(5) > ]

--- Code follows for your convenience ---
NewInducedRepresentation:=function ( G, rep )
local F,M, M1, mat, u, U, rt, i, j, k, LL, L, m, Ls, Lr, l, d, h, r, t,
    nmat, lrt;
    mat := [  ];
    L := [  ];
    h := PreImagesRange( rep );
    if Size( h ) = 1 then
        d := 1;
    else
        d := DimensionsMat( GeneratorsOfGroup( Image( rep ) )[1] )[1];
    fi;
    F:=DefaultFieldOfMatrixGroup(Range(rep));
    U := GeneratorsOfGroup( G );
    rt := RightTransversal( G, h );
    lrt := Length( rt );
    nmat := NullMat( d, d, F );
    for u in U do
        M := [  ];
        for i in [ 1 .. lrt ] do
            t := rt[i] * u;
            M1 := [  ];
            for j in [ 1 .. lrt ] do
                r := t * rt[j] ^ -1;
                if r in h then
                    Add( M1, r ^ rep );
                else
                    Add( M1, nmat );
                fi;
            od;
            Add( M, M1 );
        od;
        Add( mat, M );
    od;
    for m in mat do
        LL := [  ];
        Lr := [  ];
        Ls := [  ];
        for i in [ 1 .. lrt ] do
            for j in [ 1 .. d ] do
                for k in [ 1 .. lrt ] do
                    Add( LL, m[i][k][j] );
                od;
                Add( Ls, Concatenation( LL ) );
                LL := [  ];
            od;
            Add( Lr, Ls );
        od;
        Add( L, Lr );
    od;
    l := List( L,i->ImmutableMatrix(F,i[1]));
    return GroupHomomorphismByImagesNC( G, Group( l ), U, l );
end;

