Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile more operations in ModulePresentationsForCAP #932

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions CAP/examples/ModulePresentationsMonoidalCategory.g
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Nl := AsLeftPresentation( HomalgMatrix( [ [ 3 ] ], 1, 1, ZZ ) );
Tl := TensorProductOnObjects( Ml, Nl );
#! <An object in Category of left presentations of Z>
Display( UnderlyingMatrix( Tl ) );
#! [ [ 3 ],
#! [ 2 ] ]
#! [ [ 2 ],
#! [ 3 ] ]
IsZeroForObjects( Tl );
#! true
Bl := Braiding( DirectSum( Ml, Nl ), DirectSum( Ml, Ml ) );
Expand All @@ -38,15 +38,15 @@ generator_l1 := StandardGeneratorMorphism( IntHoml, 1 );
morphism_l1 := LambdaElimination( DirectSum( Ml, Ul ), Nl, generator_l1 );
#! <A morphism in Category of left presentations of Z>
Display( UnderlyingMatrix( morphism_l1 ) );
#! [ [ -3 ],
#! [ 2 ] ]
#! [ [ -84 ],
#! [ -196 ] ]
generator_l2 := StandardGeneratorMorphism( IntHoml, 2 );
#! <A morphism in Category of left presentations of Z>
morphism_l2 := LambdaElimination( DirectSum( Ml, Ul ), Nl, generator_l2 );
#! <A morphism in Category of left presentations of Z>
Display( UnderlyingMatrix( morphism_l2 ) );
#! [ [ 0 ],
#! [ -1 ] ]
#! [ [ -39 ],
#! [ -91 ] ]
IsEqualForMorphisms( LambdaIntroduction( morphism_l1 ), generator_l1 );
#! false
IsCongruentForMorphisms( LambdaIntroduction( morphism_l1 ), generator_l1 );
Expand All @@ -62,7 +62,7 @@ Nr := AsRightPresentation( HomalgMatrix( [ [ 3 ] ], 1, 1, ZZ ) );
Tr := TensorProductOnObjects( Mr, Nr );
#! <An object in Category of right presentations of Z>
Display( UnderlyingMatrix( Tr ) );
#! [ [ 3, 2 ] ]
#! [ [ 2, 3 ] ]
IsZeroForObjects( Tr );
#! true
Br := Braiding( DirectSum( Mr, Nr ), DirectSum( Mr, Mr ) );
Expand All @@ -86,14 +86,14 @@ generator_r1 := StandardGeneratorMorphism( IntHomr, 1 );
morphism_r1 := LambdaElimination( DirectSum( Mr, Ur ), Nr, generator_r1 );
#! <A morphism in Category of right presentations of Z>
Display( UnderlyingMatrix( morphism_r1 ) );
#! [ [ -3, 2 ] ]
#! [ [ -84, -196 ] ]
generator_r2 := StandardGeneratorMorphism( IntHoml, 2 );
#! <A morphism in Category of left presentations of Z>
morphism_r2 := LambdaElimination( DirectSum( Ml, Ul ), Nl, generator_r2 );
#! <A morphism in Category of left presentations of Z>
Display( UnderlyingMatrix( morphism_r2 ) );
#! [ [ 0 ],
#! [ -1 ] ]
#! [ [ -39 ],
#! [ -91 ] ]
IsEqualForMorphisms( LambdaIntroduction( morphism_r1 ), generator_r1 );
#! false
IsCongruentForMorphisms( LambdaIntroduction( morphism_r1 ), generator_r1 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,25 @@ operations_for_arbitrary_ring := [

operations_for_commutative_ring := Concatenation(
operations_for_arbitrary_ring,
[ #"AssociatorLeftToRightWithGivenTensorProducts",
#"AssociatorRightToLeftWithGivenTensorProducts",
#"BraidingWithGivenTensorProducts",
#"CoevaluationMorphismWithGivenRange",
[ "AssociatorLeftToRightWithGivenTensorProducts",
"AssociatorRightToLeftWithGivenTensorProducts",
"BraidingWithGivenTensorProducts",
"CoevaluationMorphismWithGivenRange",
#"Colift",
#"ColiftOrFail",
#"EvaluationMorphismWithGivenSource",
#"InternalHomOnMorphismsWithGivenInternalHoms",
#"InternalHomOnObjects",
"EvaluationMorphismWithGivenSource",
"InternalHomOnMorphismsWithGivenInternalHoms",
"InternalHomOnObjects",
#"IsColiftable",
#"IsLiftable",
#"LeftUnitorWithGivenTensorProduct",
"LeftUnitorWithGivenTensorProduct",
#"Lift",
#"LiftOrFail",
"MultiplyWithElementOfCommutativeRingForMorphisms",
#"RightUnitorWithGivenTensorProduct",
#"TensorProductOnMorphismsWithGivenTensorProducts",
#"TensorProductOnObjects",
#"TensorUnit",
"RightUnitorWithGivenTensorProduct",
"TensorProductOnMorphismsWithGivenTensorProducts",
"TensorProductOnObjects",
"TensorUnit",
]
);;

Expand All @@ -78,7 +78,11 @@ precompile_LeftPresentations := function( ring, name, operations )
name,
"Precompiled"
) :
operations := operations
operations := "InternalHomOnMorphismsWithGivenInternalHoms",
number_of_objectified_objects_in_data_structure_of_object := 1,
number_of_objectified_morphisms_in_data_structure_of_object := 0,
number_of_objectified_objects_in_data_structure_of_morphism := 2,
number_of_objectified_morphisms_in_data_structure_of_morphism := 1
); end;;

precompile_LeftPresentations(
Expand All @@ -102,7 +106,7 @@ precompile_RightPresentations := function( ring, name, operations )
name,
"Precompiled"
) :
operations := operations,
operations := "InternalHomOnMorphismsWithGivenInternalHoms",
number_of_objectified_objects_in_data_structure_of_object := 1,
number_of_objectified_morphisms_in_data_structure_of_object := 0,
number_of_objectified_objects_in_data_structure_of_morphism := 2,
Expand Down
12 changes: 10 additions & 2 deletions CompilerForCAP/gap/InferDataTypes.gi
Original file line number Diff line number Diff line change
Expand Up @@ -1492,10 +1492,18 @@ CapJitAddTypeSignatureDeferred( "MatricesForHomalg", "CertainRows", [ "IsHomalgM
CapJitAddTypeSignatureDeferred( "MatricesForHomalg", "CertainColumns", [ "IsHomalgMatrix", "IsList" ], "IsHomalgMatrix" );
CapJitAddTypeSignatureDeferred( "MatricesForHomalg", "KroneckerMat", [ "IsHomalgMatrix", "IsHomalgMatrix" ], "IsHomalgMatrix" );
CapJitAddTypeSignatureDeferred( "MatricesForHomalg", "DualKroneckerMat", [ "IsHomalgMatrix", "IsHomalgMatrix" ], "IsHomalgMatrix" );
CapJitAddTypeSignatureDeferred( "MatricesForHomalg", "SafeRightDivide", [ "IsHomalgMatrix", "IsHomalgMatrix" ], "IsHomalgMatrix" );
CapJitAddTypeSignatureDeferred( "MatricesForHomalg", "LeftDivide", [ "IsHomalgMatrix", "IsHomalgMatrix" ], "IsHomalgMatrix" );
CapJitAddTypeSignatureDeferred( "MatricesForHomalg", "LeftDivide", [ "IsHomalgMatrix", "IsHomalgMatrix", "IsHomalgMatrix" ], "IsHomalgMatrix" );
CapJitAddTypeSignatureDeferred( "MatricesForHomalg", "SafeLeftDivide", [ "IsHomalgMatrix", "IsHomalgMatrix" ], "IsHomalgMatrix" );
CapJitAddTypeSignatureDeferred( "MatricesForHomalg", "UniqueRightDivide", [ "IsHomalgMatrix", "IsHomalgMatrix" ], "IsHomalgMatrix" );
CapJitAddTypeSignatureDeferred( "MatricesForHomalg", "UniqueLeftDivide", [ "IsHomalgMatrix", "IsHomalgMatrix" ], "IsHomalgMatrix" );
CapJitAddTypeSignatureDeferred( "MatricesForHomalg", "RightDivide", [ "IsHomalgMatrix", "IsHomalgMatrix" ], "IsHomalgMatrix" );
CapJitAddTypeSignatureDeferred( "MatricesForHomalg", "RightDivide", [ "IsHomalgMatrix", "IsHomalgMatrix", "IsHomalgMatrix" ], "IsHomalgMatrix" );
CapJitAddTypeSignatureDeferred( "MatricesForHomalg", "SafeRightDivide", [ "IsHomalgMatrix", "IsHomalgMatrix" ], "IsHomalgMatrix" );
CapJitAddTypeSignatureDeferred( "MatricesForHomalg", "UniqueRightDivide", [ "IsHomalgMatrix", "IsHomalgMatrix" ], "IsHomalgMatrix" );
CapJitAddTypeSignatureDeferred( "MatricesForHomalg", "BasisOfRowModule", [ "IsHomalgMatrix" ], "IsHomalgMatrix" );
CapJitAddTypeSignatureDeferred( "MatricesForHomalg", "BasisOfColumnModule", [ "IsHomalgMatrix" ], "IsHomalgMatrix" );
CapJitAddTypeSignatureDeferred( "MatricesForHomalg", "ReducedBasisOfRowModule", [ "IsHomalgMatrix" ], "IsHomalgMatrix" );
CapJitAddTypeSignatureDeferred( "MatricesForHomalg", "ReducedBasisOfColumnModule", [ "IsHomalgMatrix" ], "IsHomalgMatrix" );
CapJitAddTypeSignatureDeferred( "MatricesForHomalg", "BasisOfRows", [ "IsHomalgMatrix" ], "IsHomalgMatrix" );
CapJitAddTypeSignatureDeferred( "MatricesForHomalg", "BasisOfColumns", [ "IsHomalgMatrix" ], "IsHomalgMatrix" );
CapJitAddTypeSignatureDeferred( "MatricesForHomalg", "SyzygiesOfRows", [ "IsHomalgMatrix" ], "IsHomalgMatrix" );
Expand Down
7 changes: 6 additions & 1 deletion FreydCategoriesForCAP/gap/FreydCategory.gd
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,14 @@ DeclareGlobalFunction( "IsValidInputForFreydCategory" );
#! into $\mathrm{\underline{Hom}}(A, b)$ is the internal Hom-embedding. This method returns this very map.
#! @Returns a (mono)morphism
#! @Arguments cat, a, b
DeclareOperationWithCache( "INTERNAL_HOM_EMBEDDING",
DeclareOperation( "INTERNAL_HOM_EMBEDDING",
[ IsFreydCategory, IsFreydCategoryObject, IsFreydCategoryObject ] );

CapJitAddTypeSignature( "INTERNAL_HOM_EMBEDDING", [ IsFreydCategory, IsFreydCategoryObject, IsFreydCategoryObject ], function ( input_types )

return CapJitDataTypeOfMorphismOfCategory( input_types[1].category );

end );

####################################################################################
##
Expand Down
2 changes: 1 addition & 1 deletion FreydCategoriesForCAP/gap/FreydCategory.gi
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ InstallOtherMethodForCompilerForCAP( MereExistenceOfWitnessForBeingCongruentToZe

end );

InstallMethodWithCacheFromObject( INTERNAL_HOM_EMBEDDING,
InstallMethod( INTERNAL_HOM_EMBEDDING,
[ IsFreydCategory, IsFreydCategoryObject, IsFreydCategoryObject ],
function( cat, a, b )
local source, range, mor;
Expand Down
Loading