Skip to content

Commit d665138

Browse files
author
Tom Kuhmichel
committed
Compile operations from tensor structure
1 parent 001bb26 commit d665138

5 files changed

+397
-21
lines changed

CompilerForCAP/examples/PrecompileModulePresentationsAsFreydCategoryOfCategoryOfRowsOrColumns.g

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,52 +16,52 @@ EEE := KoszulDualRing( QQxy * "a,b" );;
1616
operations_for_arbitrary_ring := [
1717
"AdditionForMorphisms",
1818
"AdditiveInverseForMorphisms",
19-
#"AssociatorLeftToRightWithGivenTensorProducts",
20-
#"AssociatorRightToLeftWithGivenTensorProducts",
21-
#"BraidingWithGivenTensorProducts",
22-
#"CoevaluationMorphismWithGivenRange",
2319
"CokernelColiftWithGivenCokernelObject",
2420
"CokernelProjection",
25-
#"Colift",
26-
#"ColiftOrFail",
2721
"DirectSum",
2822
"EpimorphismFromSomeProjectiveObject",
29-
#"EvaluationMorphismWithGivenSource",
3023
"IdentityMorphism",
3124
"InjectionOfCofactorOfDirectSumWithGivenDirectSum",
32-
#"InternalHomOnMorphismsWithGivenInternalHoms",
33-
#"InternalHomOnObjects",
34-
#"IsColiftable",
3525
"IsCongruentForMorphisms",
3626
"IsEqualForMorphisms",
3727
#"IsEqualForObjects",
38-
#"IsLiftable",
3928
#"IsWellDefinedForMorphisms",
4029
#"IsWellDefinedForObjects",
4130
"IsZeroForMorphisms",
4231
#"KernelEmbedding",
43-
#"LeftUnitorWithGivenTensorProduct",
44-
#"Lift",
4532
#"LiftAlongMonomorphism",
46-
#"LiftOrFail",
47-
#"MultiplyWithElementOfCommutativeRingForMorphisms",
4833
#"PreCompose",
4934
"ProjectionInFactorOfDirectSumWithGivenDirectSum",
50-
#"RightUnitorWithGivenTensorProduct",
51-
#"TensorProductOnMorphismsWithGivenTensorProducts",
52-
#"TensorProductOnObjects",
53-
#"TensorUnit",
5435
"UniversalMorphismFromDirectSumWithGivenDirectSum",
5536
"UniversalMorphismFromZeroObjectWithGivenZeroObject",
5637
"UniversalMorphismIntoDirectSumWithGivenDirectSum",
5738
"UniversalMorphismIntoZeroObjectWithGivenZeroObject",
5839
"ZeroMorphism",
59-
"ZeroObject"
40+
"ZeroObject",
6041
];;
6142

6243
operations_for_commutative_ring := Concatenation(
6344
operations_for_arbitrary_ring,
64-
[ "MultiplyWithElementOfCommutativeRingForMorphisms" ]
45+
[ "AssociatorLeftToRightWithGivenTensorProducts",
46+
"AssociatorRightToLeftWithGivenTensorProducts",
47+
"BraidingWithGivenTensorProducts",
48+
#"CoevaluationMorphismWithGivenRange",
49+
#"Colift",
50+
#"ColiftOrFail",
51+
#"EvaluationMorphismWithGivenSource",
52+
#"InternalHomOnMorphismsWithGivenInternalHoms",
53+
#"InternalHomOnObjects",
54+
#"IsColiftable",
55+
#"IsLiftable",
56+
"LeftUnitorWithGivenTensorProduct",
57+
#"Lift",
58+
#"LiftOrFail",
59+
"MultiplyWithElementOfCommutativeRingForMorphisms",
60+
"RightUnitorWithGivenTensorProduct",
61+
"TensorProductOnMorphismsWithGivenTensorProducts",
62+
#"TensorProductOnObjects",
63+
"TensorUnit",
64+
]
6565
);;
6666

6767
precompile_LeftPresentations := function( ring, name, operations )

ModulePresentationsForCAP/gap/precompiled_categories/LeftPresentationsAsFreydCategoryOfCategoryOfRowsOfCommutativeRingPrecompiled.gi

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,64 @@ end
268268

269269
, 100 );
270270

271+
##
272+
AddAssociatorLeftToRightWithGivenTensorProducts( cat,
273+
274+
########
275+
function ( cat_1, s_1, a_1, b_1, c_1, r_1 )
276+
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
277+
), cat_1, s_1, r_1, UnderlyingMatrix, HomalgIdentityMatrix( NumberColumns( UnderlyingMatrix( s_1 ) ), UnderlyingRing( cat_1 ) ) );
278+
end
279+
########
280+
281+
, 100 );
282+
283+
##
284+
AddAssociatorRightToLeftWithGivenTensorProducts( cat,
285+
286+
########
287+
function ( cat_1, s_1, a_1, b_1, c_1, r_1 )
288+
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
289+
), cat_1, s_1, r_1, UnderlyingMatrix, HomalgIdentityMatrix( NumberColumns( UnderlyingMatrix( s_1 ) ), UnderlyingRing( cat_1 ) ) );
290+
end
291+
########
292+
293+
, 100 );
294+
295+
##
296+
AddBraidingWithGivenTensorProducts( cat,
297+
298+
########
299+
function ( cat_1, s_1, a_1, b_1, r_1 )
300+
local hoisted_1_1, hoisted_2_1, deduped_3_1, deduped_4_1, deduped_5_1;
301+
deduped_5_1 := NumberColumns( UnderlyingMatrix( b_1 ) );
302+
deduped_4_1 := NumberColumns( UnderlyingMatrix( a_1 ) );
303+
deduped_3_1 := deduped_4_1 * deduped_5_1;
304+
hoisted_2_1 := deduped_4_1;
305+
hoisted_1_1 := deduped_5_1;
306+
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
307+
), cat_1, s_1, r_1, UnderlyingMatrix, HomalgMatrix( PermutationMat( PermList( List( [ 1 .. deduped_3_1 ], function ( i_2 )
308+
local deduped_1_2;
309+
deduped_1_2 := i_2 - 1;
310+
return REM_INT( deduped_1_2, hoisted_1_1 ) * hoisted_2_1 + QUO_INT( deduped_1_2, hoisted_1_1 ) + 1;
311+
end ) ), deduped_3_1 ), deduped_3_1, deduped_3_1, UnderlyingRing( cat_1 ) ) );
312+
end
313+
########
314+
315+
, 100 );
316+
317+
##
318+
AddLeftUnitorWithGivenTensorProduct( cat,
319+
320+
########
321+
function ( cat_1, a_1, s_1 )
322+
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
323+
), cat_1, s_1, a_1, UnderlyingMatrix, HomalgIdentityMatrix( NumberColumns( UnderlyingMatrix( a_1 ) ), UnderlyingRing( cat_1 ) ) );
324+
end
325+
########
326+
327+
, 100 );
328+
271329
##
272330
AddMultiplyWithElementOfCommutativeRingForMorphisms( cat,
273331

@@ -276,6 +334,42 @@ function ( cat_1, r_1, a_1 )
276334
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
277335
), cat_1, Source( a_1 ), Range( a_1 ), UnderlyingMatrix, r_1 * UnderlyingMatrix( a_1 ) );
278336
end
337+
########
338+
339+
, 100 );
340+
341+
##
342+
AddRightUnitorWithGivenTensorProduct( cat,
343+
344+
########
345+
function ( cat_1, a_1, s_1 )
346+
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
347+
), cat_1, s_1, a_1, UnderlyingMatrix, HomalgIdentityMatrix( NumberColumns( UnderlyingMatrix( a_1 ) ), UnderlyingRing( cat_1 ) ) );
348+
end
349+
########
350+
351+
, 100 );
352+
353+
##
354+
AddTensorProductOnMorphismsWithGivenTensorProducts( cat,
355+
356+
########
357+
function ( cat_1, s_1, alpha_1, beta_1, r_1 )
358+
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
359+
), cat_1, s_1, r_1, UnderlyingMatrix, KroneckerMat( UnderlyingMatrix( alpha_1 ), UnderlyingMatrix( beta_1 ) ) );
360+
end
361+
########
362+
363+
, 100 );
364+
365+
##
366+
AddTensorUnit( cat,
367+
368+
########
369+
function ( cat_1 )
370+
return ObjectifyObjectForCAPWithAttributes( rec(
371+
), cat_1, UnderlyingMatrix, HomalgZeroMatrix( 0, 1, UnderlyingRing( cat_1 ) ) );
372+
end
279373
########
280374

281375
, 100 );

ModulePresentationsForCAP/gap/precompiled_categories/LeftPresentationsAsFreydCategoryOfCategoryOfRowsOfFieldPrecompiled.gi

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,64 @@ end
268268

269269
, 100 );
270270

271+
##
272+
AddAssociatorLeftToRightWithGivenTensorProducts( cat,
273+
274+
########
275+
function ( cat_1, s_1, a_1, b_1, c_1, r_1 )
276+
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
277+
), cat_1, s_1, r_1, UnderlyingMatrix, HomalgIdentityMatrix( NumberColumns( UnderlyingMatrix( s_1 ) ), UnderlyingRing( cat_1 ) ) );
278+
end
279+
########
280+
281+
, 100 );
282+
283+
##
284+
AddAssociatorRightToLeftWithGivenTensorProducts( cat,
285+
286+
########
287+
function ( cat_1, s_1, a_1, b_1, c_1, r_1 )
288+
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
289+
), cat_1, s_1, r_1, UnderlyingMatrix, HomalgIdentityMatrix( NumberColumns( UnderlyingMatrix( s_1 ) ), UnderlyingRing( cat_1 ) ) );
290+
end
291+
########
292+
293+
, 100 );
294+
295+
##
296+
AddBraidingWithGivenTensorProducts( cat,
297+
298+
########
299+
function ( cat_1, s_1, a_1, b_1, r_1 )
300+
local hoisted_1_1, hoisted_2_1, deduped_3_1, deduped_4_1, deduped_5_1;
301+
deduped_5_1 := NumberColumns( UnderlyingMatrix( b_1 ) );
302+
deduped_4_1 := NumberColumns( UnderlyingMatrix( a_1 ) );
303+
deduped_3_1 := deduped_4_1 * deduped_5_1;
304+
hoisted_2_1 := deduped_4_1;
305+
hoisted_1_1 := deduped_5_1;
306+
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
307+
), cat_1, s_1, r_1, UnderlyingMatrix, HomalgMatrix( PermutationMat( PermList( List( [ 1 .. deduped_3_1 ], function ( i_2 )
308+
local deduped_1_2;
309+
deduped_1_2 := i_2 - 1;
310+
return REM_INT( deduped_1_2, hoisted_1_1 ) * hoisted_2_1 + QUO_INT( deduped_1_2, hoisted_1_1 ) + 1;
311+
end ) ), deduped_3_1 ), deduped_3_1, deduped_3_1, UnderlyingRing( cat_1 ) ) );
312+
end
313+
########
314+
315+
, 100 );
316+
317+
##
318+
AddLeftUnitorWithGivenTensorProduct( cat,
319+
320+
########
321+
function ( cat_1, a_1, s_1 )
322+
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
323+
), cat_1, s_1, a_1, UnderlyingMatrix, HomalgIdentityMatrix( NumberColumns( UnderlyingMatrix( a_1 ) ), UnderlyingRing( cat_1 ) ) );
324+
end
325+
########
326+
327+
, 100 );
328+
271329
##
272330
AddMultiplyWithElementOfCommutativeRingForMorphisms( cat,
273331

@@ -276,6 +334,42 @@ function ( cat_1, r_1, a_1 )
276334
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
277335
), cat_1, Source( a_1 ), Range( a_1 ), UnderlyingMatrix, r_1 * UnderlyingMatrix( a_1 ) );
278336
end
337+
########
338+
339+
, 100 );
340+
341+
##
342+
AddRightUnitorWithGivenTensorProduct( cat,
343+
344+
########
345+
function ( cat_1, a_1, s_1 )
346+
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
347+
), cat_1, s_1, a_1, UnderlyingMatrix, HomalgIdentityMatrix( NumberColumns( UnderlyingMatrix( a_1 ) ), UnderlyingRing( cat_1 ) ) );
348+
end
349+
########
350+
351+
, 100 );
352+
353+
##
354+
AddTensorProductOnMorphismsWithGivenTensorProducts( cat,
355+
356+
########
357+
function ( cat_1, s_1, alpha_1, beta_1, r_1 )
358+
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
359+
), cat_1, s_1, r_1, UnderlyingMatrix, KroneckerMat( UnderlyingMatrix( alpha_1 ), UnderlyingMatrix( beta_1 ) ) );
360+
end
361+
########
362+
363+
, 100 );
364+
365+
##
366+
AddTensorUnit( cat,
367+
368+
########
369+
function ( cat_1 )
370+
return ObjectifyObjectForCAPWithAttributes( rec(
371+
), cat_1, UnderlyingMatrix, HomalgZeroMatrix( 0, 1, UnderlyingRing( cat_1 ) ) );
372+
end
279373
########
280374

281375
, 100 );

ModulePresentationsForCAP/gap/precompiled_categories/RightPresentationsAsFreydCategoryOfCategoryOfColumnsOfCommutativeRingPrecompiled.gi

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,64 @@ end
268268

269269
, 100 );
270270

271+
##
272+
AddAssociatorLeftToRightWithGivenTensorProducts( cat,
273+
274+
########
275+
function ( cat_1, s_1, a_1, b_1, c_1, r_1 )
276+
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
277+
), cat_1, s_1, r_1, UnderlyingMatrix, HomalgIdentityMatrix( NumberRows( UnderlyingMatrix( s_1 ) ), UnderlyingRing( cat_1 ) ) );
278+
end
279+
########
280+
281+
, 100 );
282+
283+
##
284+
AddAssociatorRightToLeftWithGivenTensorProducts( cat,
285+
286+
########
287+
function ( cat_1, s_1, a_1, b_1, c_1, r_1 )
288+
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
289+
), cat_1, s_1, r_1, UnderlyingMatrix, HomalgIdentityMatrix( NumberRows( UnderlyingMatrix( s_1 ) ), UnderlyingRing( cat_1 ) ) );
290+
end
291+
########
292+
293+
, 100 );
294+
295+
##
296+
AddBraidingWithGivenTensorProducts( cat,
297+
298+
########
299+
function ( cat_1, s_1, a_1, b_1, r_1 )
300+
local hoisted_1_1, hoisted_2_1, deduped_3_1, deduped_4_1, deduped_5_1;
301+
deduped_5_1 := NumberRows( UnderlyingMatrix( b_1 ) );
302+
deduped_4_1 := NumberRows( UnderlyingMatrix( a_1 ) );
303+
deduped_3_1 := deduped_4_1 * deduped_5_1;
304+
hoisted_2_1 := deduped_4_1;
305+
hoisted_1_1 := deduped_5_1;
306+
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
307+
), cat_1, s_1, r_1, UnderlyingMatrix, HomalgMatrix( PermutationMat( PermList( List( [ 1 .. deduped_3_1 ], function ( i_2 )
308+
local deduped_1_2;
309+
deduped_1_2 := (i_2 - 1);
310+
return (REM_INT( deduped_1_2, hoisted_1_1 ) * hoisted_2_1 + QUO_INT( deduped_1_2, hoisted_1_1 ) + 1);
311+
end ) ) ^ -1, deduped_3_1 ), deduped_3_1, deduped_3_1, UnderlyingRing( cat_1 ) ) );
312+
end
313+
########
314+
315+
, 100 );
316+
317+
##
318+
AddLeftUnitorWithGivenTensorProduct( cat,
319+
320+
########
321+
function ( cat_1, a_1, s_1 )
322+
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
323+
), cat_1, s_1, a_1, UnderlyingMatrix, HomalgIdentityMatrix( NumberRows( UnderlyingMatrix( a_1 ) ), UnderlyingRing( cat_1 ) ) );
324+
end
325+
########
326+
327+
, 100 );
328+
271329
##
272330
AddMultiplyWithElementOfCommutativeRingForMorphisms( cat,
273331

@@ -276,6 +334,42 @@ function ( cat_1, r_1, a_1 )
276334
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
277335
), cat_1, Source( a_1 ), Range( a_1 ), UnderlyingMatrix, r_1 * UnderlyingMatrix( a_1 ) );
278336
end
337+
########
338+
339+
, 100 );
340+
341+
##
342+
AddRightUnitorWithGivenTensorProduct( cat,
343+
344+
########
345+
function ( cat_1, a_1, s_1 )
346+
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
347+
), cat_1, s_1, a_1, UnderlyingMatrix, HomalgIdentityMatrix( NumberRows( UnderlyingMatrix( a_1 ) ), UnderlyingRing( cat_1 ) ) );
348+
end
349+
########
350+
351+
, 100 );
352+
353+
##
354+
AddTensorProductOnMorphismsWithGivenTensorProducts( cat,
355+
356+
########
357+
function ( cat_1, s_1, alpha_1, beta_1, r_1 )
358+
return ObjectifyMorphismWithSourceAndRangeForCAPWithAttributes( rec(
359+
), cat_1, s_1, r_1, UnderlyingMatrix, KroneckerMat( UnderlyingMatrix( alpha_1 ), UnderlyingMatrix( beta_1 ) ) );
360+
end
361+
########
362+
363+
, 100 );
364+
365+
##
366+
AddTensorUnit( cat,
367+
368+
########
369+
function ( cat_1 )
370+
return ObjectifyObjectForCAPWithAttributes( rec(
371+
), cat_1, UnderlyingMatrix, HomalgZeroMatrix( 1, 0, UnderlyingRing( cat_1 ) ) );
372+
end
279373
########
280374

281375
, 100 );

0 commit comments

Comments
 (0)