gap-packages / wedderga

Wedderburn Decomposition of Group Algebras
https://gap-packages.github.io/wedderga/
GNU General Public License v2.0
3 stars 6 forks source link

Error in determining commutativity of crossed product #96

Open olexandr-konovalov opened 1 year ago

olexandr-konovalov commented 1 year ago

Reported by email by Rene Marczinzik. This calculation reports that U is commutative, while it is not:

gap> G:=QuaternionGroup(8);
<pc group of size 8 with 3 generators>
gap> R:=GroupRing(Rationals,G);
<algebra-with-one over Rationals, with 3 generators>
gap> W:=WedderburnDecomposition(R);
[ Rationals, Rationals, Rationals, Rationals, 
  <crossed product with center Rationals over GaussianRationals of a group of \
size 2> ]
gap> U:=W[5];
<crossed product with center Rationals over GaussianRationals of a group of si\
ze 2>
gap> Dimension(U);
2
gap> IsCommutative(U);
true
olexandr-konovalov commented 1 year ago

There is nothing for determining commutativity of the crossed product in the Wedderga code for crossed product, except a comment and a commented out block of code: https://github.com/gap-packages/wedderga/blob/bd2837555a2442ca8a99cab16e84a191d8d8f796/lib/crossed.gi#L603-L606

It happens that the commutativity is determined elsewhere, namely in lib/magma.gd:

gap> f:=ApplicableMethod(IsCommutative,[U]);
function( D ) ... end
gap> PageSource(f);
Showing source in /Users/obk1/gap/gap-4.12.2/lib/magma.gd (from line 1009)
##  <C><A>GeneratorsOfStruct</A>( <A>D</A> )</C> commute.
##  </Description>
##  </ManSection>
##
BindGlobal( "IsCommutativeFromGenerators", function( GeneratorsStruct )
    return function( D )

    local gens,   # list of generators
          i, j;   # loop variables

    # Test if every element commutes with all the others.
    gens:= GeneratorsStruct( D );
    for i in [ 2 .. Length( gens ) ] do
      for j in [ 1 .. i-1 ] do
        if gens[i] * gens[j] <> gens[j] * gens[i] then
          return false;
        fi;
      od;
    od;

    # All generators commute.
    return true;
    end;
end );

The fix is to install a proper method for IsCommutative for objects in IsCrossedProduct.

drallenherman commented 1 year ago

There is a problem with applying a function designed for algebras to one of the "crossed product algebras" produced by the "WedderburnDecomposition" function, because these crossed product algebras are not designed to be algebras in the usual sense. In wedderga, to get output that is a list of simple algebras over their centers, one should use "WedderburnDecompositionAsSCAlgebras". If they use this function they will get the answer they are expecting.

angeldelriomateos commented 1 year ago

One way to decide if a crossed product is commutative is by comparing the center with the Leftactingdomain. The crossed product is commutative if and only if its center and its left acting domain coincide.

fingolfin commented 7 months ago

The fix is to install a proper method for IsCommutative for objects in IsCrossedProduct.

I think that would just paper over a deeper (design?) issue with the code in question. Your code offers this:

gap> IsAlgebra(U);
true
gap> gens:=GeneratorsOfLeftOperatorRingWithOne(U);
[ (ZmodnZObj( 1, 4 ))*(1), (ZmodnZObj( 3, 4 ))*(1) ]
gap> a:=gens[1];; b:=gens[2];;
gap> a*b = b*a;
true

So U is an algebra and it generators commute, and hence GAP decides it is commutative.

But it isn't, and the discrepancy is caused by GAP being mislead: U isn't actually an algebra (in the sense GAP defines it): the GAP manual states:

An algebra is a vector space equipped with a bilinear map (multiplication).

But your multiplication is not bilinear in GAP's sense, otherwise these three products all would evaluate to the same result:

gap> E(4) * (b * a);
(ZmodnZObj( 3, 4 ))*(-E(4))
gap> (E(4) * b) * a;
(ZmodnZObj( 3, 4 ))*(-E(4))
gap> b * (E(4) * a);
(ZmodnZObj( 3, 4 ))*(E(4))

(There are other ways to define "bilinear" but in all definitions of "algebra over a field" I know, this one is used).

This definition ensures that "the non-commutativity is in the basis/generators", and not hidden in the interaction between scalars and generators as is the case here for the crossed products.

To fix this, you either need to rewrite this as an algebra over the rationals (of correspondingly higher dimension), or change the implementation to not imply IsAlgebra.

Otherwise I am sure there are other algorithms that will return "wrong" results.