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

Proper syntax for creating morphism #17150

Open
simon-king-jena opened this issue Oct 14, 2014 · 1 comment
Open

Proper syntax for creating morphism #17150

simon-king-jena opened this issue Oct 14, 2014 · 1 comment

Comments

@simon-king-jena
Copy link
Member

Currently (and even with #10668), there is a generic call method for homsets that is not really useful, as it does not make any use of element classes or other ingredients of the "usual" framework for making a parent callable. In particular, homsets typically override __call__, which means that we can not benefit from a generic coercion model.

This ticket aims at providing a generic call method for homsets (similarly to what we have for parents) and use it in all concrete implementations of homsets.

Depends on #10668

CC: @nthiery @jpflori

Component: coercion

Issue created by migration from https://trac.sagemath.org/ticket/17150

@simon-king-jena
Copy link
Member Author

comment:1

A comment from #10668, what Nicolas would like to have:


For A a parent, A.hom(on_basis = [data],...) would call
A.morphism_on_basis(data,...). This morphism_on_basis could
typically be implemented in A, or in C.ParentMethods for C the
category of A.

There are 5-6 explicit hom functions in Sage that would need to be
generalized to accept this syntax, while keeping backward
compatibility if no keyword is specified.


I am not totally sure whether I would like that change. The A.hom(data, B) method should, in my opinion, be a short-cut for A.Hom(B)(data), and it should be the responsibility of the homset to process the data (by means of _element_constructor_). I would like to have everything as close to what we have for parents as possible. So, _element_constructor_ and friends should be used.

@mkoeppe mkoeppe removed this from the sage-6.4 milestone Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants