Skip to content

Commit 8818cff

Browse files
committed
resolves #1744
Bump ModulePresentationsForCAP to v2025.06-01
1 parent 21025c3 commit 8818cff

File tree

2 files changed

+20
-95
lines changed

2 files changed

+20
-95
lines changed

ModulePresentationsForCAP/PackageInfo.g

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ SetPackageInfo( rec(
1010

1111
PackageName := "ModulePresentationsForCAP",
1212
Subtitle := "Category R-pres for CAP",
13-
Version := "2024.09-02",
13+
Version := "2025.06-01",
1414
Date := (function ( ) if IsBound( GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE ) then return GAPInfo.SystemEnvironment.GAP_PKG_RELEASE_DATE; else return Concatenation( ~.Version{[ 1 .. 4 ]}, "-", ~.Version{[ 6, 7 ]}, "-01" ); fi; end)( ),
1515
License := "GPL-2.0-or-later",
1616

ModulePresentationsForCAP/gap/ModulePresentationsForCAP.gi

Lines changed: 19 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,29 +1088,20 @@ InstallGlobalFunction( ADD_LIFT_AND_COLIFT_LEFT,
10881088
M := UnderlyingMatrix( Source( morphism_2 ) );
10891089

10901090
v := NrColumns( M );
1091-
1091+
10921092
s := NrColumns( P );
10931093

10941094
N := UnderlyingMatrix( Range( morphism_1 ) );
10951095

1096-
# NrColumns( N ) = 0 implies coker(N)=0 and s = 0 implies coker(P)=0, hence morphism_1 is zero, and the zero morphism can always be lifted.
1097-
if NrColumns( N ) = 0 or s = 0 then
1098-
return ZeroMorphism( Source( morphism_1 ), Source( morphism_2 ) );
1099-
fi;
1100-
1101-
# if NrColumns(M)=0 then M is zero, hence lift exists iff morphism_1 is zero.
1102-
if NrColumns( M ) = 0 and IsZeroForMorphisms( morphism_1 ) then
1103-
return ZeroMorphism( Source( morphism_1 ), Source( morphism_2 ) );
1104-
fi;
11051096
A := UnderlyingMatrix( morphism_1 );
11061097

11071098
B := UnderlyingMatrix( morphism_2 );
11081099

1109-
B_tr_I := KroneckerMat( TransposedMatrix( B ), HomalgIdentityMatrix( NrColumns( P ), homalg_ring ) );
1100+
B_tr_I := KroneckerMat( TransposedMatrix( B ), HomalgIdentityMatrix( NrColumns( P ), homalg_ring ) ); # ns x vs
11101101

1111-
N_tr_I := KroneckerMat( TransposedMatrix( N ), HomalgIdentityMatrix( NrColumns( P ) ,homalg_ring ) );
1102+
N_tr_I := KroneckerMat( TransposedMatrix( N ), HomalgIdentityMatrix( NrColumns( P ) ,homalg_ring ) ); # ns x ms
11121103

1113-
zero_1 := HomalgZeroMatrix( NrRows( A )*NrColumns( A ), NrRows( P )*NrRows( M ), homalg_ring );
1104+
zero_1 := HomalgZeroMatrix( NrRows( A )*NrColumns( A ), NrRows( P )*NrRows( M ), homalg_ring ); # ns x ru
11141105

11151106
mat1 := UnionOfColumns( B_tr_I, N_tr_I, zero_1 );
11161107

@@ -1124,17 +1115,9 @@ InstallGlobalFunction( ADD_LIFT_AND_COLIFT_LEFT,
11241115

11251116
mat := UnionOfRows( mat1, mat2 );
11261117

1127-
if NrColumns( A ) <= 1 then
1128-
1129-
vec_A := A;
1130-
1131-
else
1132-
1133-
vec_A := UnionOfRows( List( [ 1 .. NrColumns( A ) ], i-> CertainColumns( A, [ i ] ) ) );
1134-
1135-
fi;
1118+
vec_A := ConvertMatrixToColumn( A );
11361119

1137-
vec_zero := HomalgZeroMatrix( NrRows( P )*NrColumns( M ), 1, homalg_ring );
1120+
vec_zero := HomalgZeroMatrix( NrRows( P )*NrColumns( M ), NrColumns( vec_A ), homalg_ring );
11381121

11391122
vec := UnionOfRows( vec_A, vec_zero );
11401123

@@ -1155,11 +1138,7 @@ InstallGlobalFunction( ADD_LIFT_AND_COLIFT_LEFT,
11551138

11561139
sol := CallFuncList( LeftDivide, lift_via_compiled_linear_system_func( morphism_1, morphism_2 ) );
11571140

1158-
if v <= 1 then
1159-
XX := CertainRows( sol, [ 1.. s ] );
1160-
else
1161-
XX := UnionOfColumns( List( [ 1 .. v ], i-> CertainRows( sol, [ (i-1)*s+1.. i*s ] ) ) );
1162-
fi;
1141+
XX := UnionOfColumns( homalg_ring, s, List( [ 1 .. v ], i-> CertainRows( sol, [ (i-1)*s+1.. i*s ] ) ) );
11631142

11641143
return PresentationMorphism( cat, Source( morphism_1 ), XX, Source( morphism_2 ) );
11651144

@@ -1195,21 +1174,11 @@ InstallGlobalFunction( ADD_LIFT_AND_COLIFT_LEFT,
11951174
M := UnderlyingMatrix( Range( morphism_1 ) );
11961175

11971176
v := NrColumns( M );
1198-
1177+
11991178
s := NrColumns( I );
12001179

12011180
N := UnderlyingMatrix( Source( morphism_1 ) );
12021181

1203-
# NrColumns( N ) = 0 implies coker(N)=0 and s = 0 implies coker(I)=0, hence morphism_2 is zero, and the zero morphism can always be colifted.
1204-
if NrColumns( N ) = 0 or s = 0 then
1205-
return ZeroMorphism( Range( morphism_1 ), Range( morphism_2 ) );
1206-
fi;
1207-
1208-
# if NrColumns(M)=0 then M is zero, hence colift exists iff morphism_2 is zero.
1209-
if NrColumns( M ) = 0 and IsZeroForMorphisms( morphism_2 ) then
1210-
return ZeroMorphism( Range( morphism_1 ), Range( morphism_2 ) );
1211-
fi;
1212-
12131182
B := UnderlyingMatrix( morphism_1 );
12141183

12151184
A := UnderlyingMatrix( morphism_2 );
@@ -1226,12 +1195,8 @@ InstallGlobalFunction( ADD_LIFT_AND_COLIFT_LEFT,
12261195

12271196
A_over_zero := UnionOfRows( A, zero_mat );
12281197

1229-
if NrColumns( A ) <= 1 then
1230-
vec := A_over_zero;
1231-
else
1232-
vec := UnionOfRows( List( [ 1 .. NrColumns( A ) ], i-> CertainColumns( A_over_zero, [ i ] ) ) );
1233-
fi;
1234-
1198+
vec := ConvertMatrixToColumn( A );
1199+
12351200
return [ mat, vec ];
12361201

12371202
end;
@@ -1253,11 +1218,7 @@ InstallGlobalFunction( ADD_LIFT_AND_COLIFT_LEFT,
12531218

12541219
s := NrColumns( I );
12551220

1256-
if s <= 1 then
1257-
XX := CertainRows( sol, [ 1.. v ] );
1258-
else
1259-
XX := UnionOfColumns( List( [ 1 .. s ], i-> CertainRows( sol, [ (i-1)*v+1.. i*v ] ) ) );
1260-
fi;
1221+
XX := UnionOfColumns( homalg_ring, v, List( [ 1 .. s ], i-> CertainRows( sol, [ (i-1)*v+1.. i*v ] ) ) );
12611222

12621223
return PresentationMorphism( cat, Range( morphism_1 ), XX, Range( morphism_2 ) );
12631224

@@ -1314,14 +1275,6 @@ InstallGlobalFunction( ADD_LIFT_AND_COLIFT_RIGHT,
13141275

13151276
Nt := TransposedMatrix( UnderlyingMatrix( Range( morphism_1 ) ) );
13161277

1317-
if NrRows( Nt ) = 0 or s = 0 then
1318-
return ZeroMorphism( Source( morphism_1 ), Source( morphism_2 ) );
1319-
fi;
1320-
1321-
if NrRows( Mt ) = 0 and IsZeroForMorphisms( morphism_1 ) then
1322-
return ZeroMorphism( Source( morphism_1 ), Source( morphism_2 ) );
1323-
fi;
1324-
13251278
At := TransposedMatrix( UnderlyingMatrix( morphism_1 ) );
13261279

13271280
Bt := TransposedMatrix( UnderlyingMatrix( morphism_2 ) );
@@ -1344,17 +1297,9 @@ InstallGlobalFunction( ADD_LIFT_AND_COLIFT_RIGHT,
13441297

13451298
mat := UnionOfRows( mat1, mat2 );
13461299

1347-
if NrColumns( At ) <= 1 then
1348-
1349-
vec_A := At;
1350-
1351-
else
1352-
1353-
vec_A := UnionOfRows( List( [ 1 .. NrColumns( At ) ], i-> CertainColumns( At, [ i ] ) ) );
1354-
1355-
fi;
1300+
vec_A := ConvertMatrixToColumn( At );
13561301

1357-
vec_zero := HomalgZeroMatrix( NrRows( Pt )*NrColumns( Mt ), 1, homalg_ring );
1302+
vec_zero := HomalgZeroMatrix( NrRows( Pt )*NrColumns( Mt ), NrColumns( vec_A ), homalg_ring );
13581303

13591304
vec := UnionOfRows( vec_A, vec_zero );
13601305

@@ -1374,11 +1319,7 @@ InstallGlobalFunction( ADD_LIFT_AND_COLIFT_RIGHT,
13741319

13751320
sol := CallFuncList( LeftDivide, lift_via_compiled_linear_system_func( morphism_1, morphism_2 ) );
13761321

1377-
if v <= 1 then
1378-
XX := TransposedMatrix( CertainRows( sol, [ 1.. s ] ) );
1379-
else
1380-
XX := TransposedMatrix( UnionOfColumns( List( [ 1 .. v ], i-> CertainRows( sol, [ (i-1)*s+1.. i*s ] ) ) ) );
1381-
fi;
1322+
XX := TransposedMatrix( UnionOfColumns( homalg_ring, s, List( [ 1 .. v ], i-> CertainRows( sol, [ (i-1)*s+1.. i*s ] ) ) ) );
13821323

13831324
return PresentationMorphism( cat, Source( morphism_1 ), XX, Source( morphism_2 ) );
13841325

@@ -1398,19 +1339,11 @@ InstallGlobalFunction( ADD_LIFT_AND_COLIFT_RIGHT,
13981339
Mt := TransposedMatrix( UnderlyingMatrix( Range( morphism_1 ) ) );
13991340

14001341
v := NrColumns( Mt );
1401-
1342+
14021343
s := NrColumns( It );
1403-
1404-
Nt := TransposedMatrix( UnderlyingMatrix( Source( morphism_1 ) ) );
14051344

1406-
if NrRows( Nt ) = 0 or s = 0 then
1407-
return ZeroMorphism( Range( morphism_1 ), Range( morphism_2 ) );
1408-
fi;
1345+
Nt := TransposedMatrix( UnderlyingMatrix( Source( morphism_1 ) ) );
14091346

1410-
if NrRows( Mt ) = 0 and IsZeroForMorphisms( morphism_2 ) then
1411-
return ZeroMorphism( Range( morphism_1 ), Range( morphism_2 ) );
1412-
fi;
1413-
14141347
Bt := TransposedMatrix( UnderlyingMatrix( morphism_1 ) );
14151348

14161349
At := TransposedMatrix( UnderlyingMatrix( morphism_2 ) );
@@ -1427,12 +1360,8 @@ InstallGlobalFunction( ADD_LIFT_AND_COLIFT_RIGHT,
14271360

14281361
A_over_zero := UnionOfRows( At, zero_mat );
14291362

1430-
if NrColumns( At ) <= 1 then
1431-
vec := A_over_zero;
1432-
else
1433-
vec := UnionOfRows( List( [ 1 .. NrColumns( At ) ], i-> CertainColumns( A_over_zero, [ i ] ) ) );
1434-
fi;
1435-
1363+
vec := ConvertMatrixToColumn( A_over_zero );
1364+
14361365
return [ mat, vec ];
14371366

14381367
end;
@@ -1454,11 +1383,7 @@ InstallGlobalFunction( ADD_LIFT_AND_COLIFT_RIGHT,
14541383

14551384
s := NrColumns( It );
14561385

1457-
if s <= 1 then
1458-
XX := TransposedMatrix( CertainRows( sol, [ 1.. v ] ) );
1459-
else
1460-
XX := TransposedMatrix( UnionOfColumns( List( [ 1 .. s ], i-> CertainRows( sol, [ (i-1)*v+1.. i*v ] ) ) ) );
1461-
fi;
1386+
XX := TransposedMatrix( UnionOfColumns( homalg_ring, v, List( [ 1 .. s ], i-> CertainRows( sol, [ (i-1)*v+1.. i*v ] ) ) ) );
14621387

14631388
return PresentationMorphism( cat, Range( morphism_1 ), XX, Range( morphism_2 ) );
14641389

0 commit comments

Comments
 (0)