gap-packages / qpa

GAP package for quivers and path algebras
https://folk.ntnu.no/oyvinso/QPA/
GNU General Public License v2.0
30 stars 13 forks source link

ExtAlgebraGenerators over a function field fails #70

Closed pbelmans closed 2 years ago

pbelmans commented 2 years ago

I want to compute ExtAlgebraGenerators over fields which are not the rationals or cyclotomics (in these cases it works in all examples I'm interested in), and in particular for function fields. The following example shows (tested both with GAP 4.11.1 and GAP 4.10.2, both on Mac OS X) that this already fails for the path algebra of the Kronecker quiver over Q(t):

LoadPackage("qpa");;
K := FunctionField(Rationals, ["t"]);;
Q := Quiver(["p", "q"], [["p", "q", "x"], ["p", "q", "y"]]);;
A := PathAlgebra(K, Q);;
Ae := AlgebraAsModuleOverEnvelopingAlgebra(A);;

ExtAlgebraGenerators(Ae, 2)[1];

The expected answer would be [ 1, 3, 0 ], but I get

Error, usage: SubFLMLORWithOne( <V>, <gens> [, "basis"] ) at /opt/homebrew/Cellar/gap/4.11.1/libexec/lib/algebra.gi:288 called from
SubalgebraWithOne( A, maps, "basis" ) at /opt/homebrew/Cellar/gap/4.11.1/libexec/pkg/qpa-version-1.31/lib/modulehom.gi:1726 called from
EndOverAlgebra( M ) at /opt/homebrew/Cellar/gap/4.11.1/libexec/pkg/qpa-version-1.31/lib/modulehomalg.gi:761 called from
<function "ExtAlgebraGenerators for a module over a quotient of a path algebra">( <arguments> )

The documentation doesn't seem to exclude any fields, but maybe some dependency (computation of noncommutative Groebner bases?) needs special properties of the field? Or is this actually a bug in either QPA or something it depends on?

sunnyquiver commented 2 years ago

The problem comes from SubalgebraWithOne, which doesn't seem to like function fields. This is something that is not part of QPA, and I don't know how to fix that function. However, what it is used for in ExtAlgebraGenerators is only to get information about the degree 0 part of the Ext-algebra. If you are happy skipping degree 0 and only look at positive degrees (and not worry about a minimal set of generators), one can use the following modified ExtAlgebraGenerators - function:

`DeclareOperation( "NewExtAlgebraGenerators", [ IsPathAlgebraMatModule, IS_INT ] );

InstallMethod( NewExtAlgebraGenerators, "for a module over a quotient of a path algebra", [ IsPathAlgebraMatModule, IS_INT ], 0, function( M, n )

local N, projcovers, f, i, EndM, J, gens, extgroups, dim_ext_groups, 
      generators, productelements, j, induced, k, liftings, products, 
      l, m, productsinbasis, W, V, K, extalggenerators, p, tempgens, 
      I, g, templist, idealsquare; 

K := LeftActingDomain( M );
N := M;
projcovers := [];
for i in [ 1..n ] do
    f := ProjectiveCover( N );
    Add( projcovers, f );
    N := Kernel( f );
od;
extgroups := [];
#
#   Computing Ext^i(M,M) for i = 0, 1, 2,...., n. 
#
for i in [ 0..n ] do 
    if i = 0 then 
        EndM := HomOverAlgebra( M, M );
        Add( extgroups, [ [], EndM, [] ] );
    elif i = 1 then 
        Add( extgroups, ExtOverAlgebra( M, M ) ); 
    else
        Add( extgroups, ExtOverAlgebra( Kernel( projcovers[ i - 1 ] ), M ) ); 
    fi;
od;
dim_ext_groups := List( extgroups, x -> Length( x[ 2 ] ) );
#    Print(Dimension(EndM) - Dimension(J)," generators in degree 0.\n");    
#
#   Computing Ext^j(M,M) x Ext^(i-j)(M,M) for j = 1..i-1 and i = 2..n.
#
generators := List( [ 1..n + 1 ], x -> 0 );
extalggenerators := List( [1..n + 1], x -> [] );
extalggenerators[ 1 ] := EndM;
extalggenerators[ 2 ] := extgroups[ 2 ][ 2 ];
for i in [ 1..n ] do
    productelements := [];
    for j in [ 0..i ] do
        if ( dim_ext_groups[ i + 1 ] <> 0 ) and ( dim_ext_groups[ j + 1 ] <> 0 ) and ( dim_ext_groups[ i - j + 1 ] <> 0 ) then 
            induced := ShallowCopy( extgroups[ i - j + 1 ][ 2 ] );
            for k in [ 1..j ] do
                liftings := List( [ 1..dim_ext_groups[ i-j+1 ] ], x -> projcovers[ i-j+k ] * induced[ x ] );
                liftings := List( [ 1..dim_ext_groups[ i-j+1 ] ], x -> LiftingMorphismFromProjective( projcovers[ k ], liftings[ x ] ) );
                induced  := List( [ 1..dim_ext_groups[ i-j+1 ] ], x -> MorphismOnKernel( projcovers[ i-j+k ], projcovers[ k ], liftings[ x ], induced[ x ] ) );
            od;
            products := [];
            for l in [ 1..dim_ext_groups[ j + 1 ] ] do
                for m in [ 1..dim_ext_groups[ i - j + 1 ] ] do 
                    Add( products, induced[ m ] * extgroups[ j + 1 ][ 2 ][ l ] );
                od;
            od;
            productsinbasis := List( products, x -> extgroups[ i + 1 ][ 3 ]( x ) );
            productsinbasis := Filtered( productsinbasis, x -> x <> Zero( x ) );
            if Length( productsinbasis ) <> 0 then
                Append( productelements, productsinbasis );
            fi;
        fi;
    od;
    if Length( productelements ) <> 0 then 
        W := FullRowSpace( K, Length( extgroups[ i + 1 ][ 2 ] ) );            
        V := Subspace( W, productelements );
        if dim_ext_groups[ i + 1 ] > Dimension( V ) then
            generators[ i + 1 ] := Length( extgroups[ i + 1 ][ 2 ] ) - Dimension( V ); 
            p := NaturalHomomorphismBySubspace( W, V );
            tempgens := List( BasisVectors( Basis( Range( p ) ) ), x -> PreImagesRepresentative( p, x ) );
            extalggenerators[ i + 1 ] := List( tempgens, x -> LinearCombination( extgroups[ i + 1 ][ 2 ], x ) );                 
        fi;
    elif dim_ext_groups[ i + 1 ] <> 0 then 
        generators[ i + 1 ] := Length( extgroups[ i + 1 ][ 2 ] ); 
        extalggenerators[ i + 1 ] := extgroups[ i + 1 ][ 2 ];                 
    fi;
od; 
dim_ext_groups[ 1 ] := Length( EndM );
generators[ 1 ] := EndM;
return [ dim_ext_groups, generators , extalggenerators ];

end ); `

pbelmans commented 2 years ago

Thanks a lot! I am not interested in the degree 0 part usually, as I know that the center of the algebra will be 1-dimensional, so this works for me.

sunnyquiver commented 2 years ago

Will see if I include this as a new function.