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

Extending the range of a homomorphism structure of a category instance multiple times signals an error #1267

Open
mohamed-barakat opened this issue Feb 28, 2023 · 3 comments

Comments

@mohamed-barakat
Copy link
Member

gap> LoadPackage("FunctorCategories");
true
gap> FiniteStrictCoproductCocompletion( FinBouquets );
FiniteStrictCoproductCocompletion( FinBouquets )
gap> FiniteStrictCoproductCocompletion( ModelingCategory( FinBouquets ) );
Error, there is already a method known for DistinguishedObjectOfHomomorphismStructureExtendedByFullEmbedding with a category filter which implies the current category filter or is implied by it at /Users/mo/.gap/pkg/CAP_project/CAP//gap/ToolsForCategories.gi:941 called from
CapJitAddKnownMethod( operation, filters, method ); at /Users/mo/.gap/pkg/CAP_project/CAP//gap/ToolsForCategories.gi:844 called from
InstallMethodForCompilerForCAP( DistinguishedObjectOfHomomorphismStructureExtendedByFullEmbedding,
 [ IsCapCategory and CategoryFilter( C ), IsCapCategory and CategoryFilter( E ) ], function ( C, E )
      return object_function( C, E, DistinguishedObjectOfHomomorphismStructure( C ) );
  end ); at /Users/mo/.gap/pkg/CAP_project/CAP//gap/CategoryMorphisms.gi:666 called from
ExtendRangeOfHomomorphismStructureByFullEmbedding( C, RangeCategoryOfHomomorphismStructure( C ), object_function, morphism_function, object_function_inverse,
 morphism_function_inverse ); at /Users/mo/.gap/pkg/CAP_project/CAP//gap/CategoryMorphisms.gi:764 called from
ExtendRangeOfHomomorphismStructureByIdentityAsFullEmbedding( C
 ); at /Users/mo/.gap/pkg/CategoricalTowers/FiniteCocompletion//gap/FiniteStrictCoproductCocompletion.gi:765 called from
<function "FiniteStrictCoproductCocompletion for a CAP category">( <arguments> )
 called from read-eval loop at *stdin*:2
you can 'quit;' to quit to outer loop, or
you can 'return;' to continue
brk>
@mohamed-barakat mohamed-barakat added the help wanted tasks suited for external help label Feb 28, 2023
@zickgraf
Copy link
Member

zickgraf commented Mar 1, 2023

You are extending the hom structure of the same category instance twice. You can trigger the same error as follows:

gap> LoadPackage( "FinSetsForCAP" );
gap> WrapperCategory( FinSets, rec( ) );
gap> WrapperCategory( FinSets, rec( ) );

When designing the interface of ExtendRangeOfHomomorphismStructureByFullEmbedding, I thought about this, as can be seen in the documentation:

Note: To distinguish embeddings in different categories, in addition to $C$ also $E$ is passed to the operations. When using this with different embeddings with the range category $E$, only the last embedding will be used.

However, I did not recognize that this would not be compatible with CompilerForCAP's method selection which only uses the first argument for method selection.

No easy fix comes to my mind right now, so for now the question is: Do you actually have a setting where the range of the hom structure of the same instance of a category has to be extended twice?

@mohamed-barakat
Copy link
Member Author

I ran into this error when using CategoryOfQuivers applied to FinBouquets but then I wanted for debugging purposes to apply it to ModelingCategory( FinBouquets ) and ModelingCategory( ModelingCategory( FinBouquets ) ) and both failed. So these constructions are not my final goal, but I needed them for experiments.

@zickgraf
Copy link
Member

zickgraf commented Mar 1, 2023

I see. For debugging/experiments you can replace all occurrences of InstallMethodForCompilerForCAP by InstallMethod in the installation of ExtendRangeOfHomomorphismStructureByFullEmbedding in CAP/gap/CategoryMorphisms.gi and everything should be fine (as long as you do not extend to the same range with different embeddings). I could also turn the error into a warning if you like.

In any case, this should be fixed in a general way -> I will transfer this issue to CAP_project.

@zickgraf zickgraf transferred this issue from homalg-project/CategoricalTowers Mar 1, 2023
@zickgraf zickgraf removed the help wanted tasks suited for external help label Mar 1, 2023
@zickgraf zickgraf changed the title Error, there is already a method known for DistinguishedObjectOfHomomorphismStructureExtendedByFullEmbedding with a category filter which implies the current category filter or is implied by it Extending the range of a homomorphism structure of a category instance multiple times signals an error Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants