Goto Chapter: Top 1 2 3 4 Ind
 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 

4 Examples and Tests
 4.1 Linear closure of categories
 4.2 Matrices over ZG

4 Examples and Tests

4.1 Linear closure of categories

#@if IsPackageMarkedForLoading( "FinSetsForCAP", ">= 2023.07-03" )
gap> G := SymmetricGroup( 3 );;
gap> CG := GroupAsCategory( G );;
gap> compare_func := function( g, h ) return UnderlyingGroupElement( g ) < UnderlyingGroupElement( h ); end;;
gap> ZZZ := HomalgRingOfIntegers();;
gap> ZCG := LinearClosure( ZZZ, CG, compare_func );;
gap> u := GroupAsCategoryUniqueObject( CG );;
gap> g := GroupAsCategoryMorphism( (1,2,3), CG );;
gap> h := GroupAsCategoryMorphism( (1,2), CG );;
gap> v := LinearClosureObject( ZCG, u );;
gap> SetOfObjectsOfCategory( ZCG ) = [ v ];
true
gap> elem1 := LinearClosureMorphism( v, [ 1, 2, 3, 4, 5, 6 ], [ g, h, g, h, g, h ], v );;
gap> elem2 := LinearClosureMorphism( v, [ 1, 2, 3, 4, 5, 6 ], [ h, g, h, g, h, g ], v );;
gap> # for i in [ 1 .. 10^6 ] do LinearClosureMorphism( v, [ 1, 2, 3, 4, 5, 6 ], [ g, h, g, h, g, h ], v ); od;
gap> elem := LinearClosureMorphism( v, [ 0, 0, 0, 0, 0, 0 ], [ g, h, g, h, g, h ], v );;
gap> a := (1,2)/CG/ZCG;;
gap> b := (2,3)/CG/ZCG;;
gap> IsIsomorphism( a + b );
false
gap> Lift( a + b, a ) * a = a + b;
true
gap> IsLiftable( a + b, -2*a ); ## over Q this is liftable
false
#@fi

4.2 Matrices over ZG

Construction of a tower of categories

#@if IsPackageMarkedForLoading( "FinSetsForCAP", ">= 2023.07-03" )
gap> G := SymmetricGroup( 3 );;
gap> CG := GroupAsCategory( G );;
gap> ZZZ := HomalgRingOfIntegers( );;
gap> ZCG := LinearClosure( ZZZ, CG );;
gap> RowsG := AdditiveClosure( ZCG );;
#@fi

Construction of elements

#@if IsPackageMarkedForLoading( "FinSetsForCAP", ">= 2023.07-03" )
gap> a := (1,2)/CG/ZCG;;
gap> b := (2,3)/CG/ZCG;;
gap> e := ()/CG/ZCG;;
gap> omega := [ [ a - e ], [ b - e ] ]/RowsG;;
gap> u := GroupAsCategoryUniqueObject( CG );;
gap> v := LinearClosureObject( ZCG, u );;
gap> u := AsAdditiveClosureObject( v );;
gap> HomStructure( u, omega );;
#@fi

A random lifting problem over ZG

#@if IsPackageMarkedForLoading( "FinSetsForCAP", ">= 2023.07-03" )
gap> elem := Elements( G );;
gap> elem := List( elem, x -> x/CG/ZCG );;
gap> rand_elem := function() local coeffs; coeffs := List( [ 1 .. 6 ], i -> Random( [ -20 .. 20 ] ) ); if ForAll( coeffs, IsZero ) then return ZeroMorphism( v, v ); fi; return Sum( List( [ 1 .. 6 ], i -> Random( [ -20 .. 20 ] ) * One( ZZZ ) * elem[i] ) ); end;;
gap> mat10_11 := List( [ 1 .. 10 ], i ->
>         List( [ 1 .. 11 ], j ->
>             rand_elem()
>         )
>     );;
gap> mat11_12 := List( [ 1 .. 11 ], i ->
>         List( [ 1 .. 12 ], j ->
>             rand_elem()
>         )
>     );;
gap> alpha := mat10_11/RowsG;;
gap> beta := mat11_12/RowsG;;
gap> gamma := PreCompose( alpha, beta );;
gap> lift := Lift( gamma, beta );;
gap> PreCompose( lift, beta ) = gamma;
true
#@fi
 [Top of Book]  [Contents]   [Previous Chapter]   [Next Chapter] 
Goto Chapter: Top 1 2 3 4 Ind

generated by GAPDoc2HTML