-
-
Notifications
You must be signed in to change notification settings - Fork 487
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
Support base_morphism for hom(im_gens) #26105
Comments
comment:1
roed, caruso: I am curious to hear what you think about this. I have been stumbling upon this several times during the past years. |
This comment has been minimized.
This comment has been minimized.
comment:3
The problem with Instead, I would define a specific morphism class for polynomial rings. Mathematically, a ring morphism from a polynomial ring is defined by a morphism of the base together with the images of the generators. That was my plan for #25558 but I stopped working on that... |
comment:4
Polynomial rings are just one example. Another one (see #26103) are extensions, say an extension of a finite field where I would like to define a map But I think I also had this issue with fraction fields before. I agree, that specialized morphism classes can be nice because they might have more knowledge about the objects involved (say to implement is_injective()/is_surjective()) but I don't want to implement a new class whenever I need a map between new types of parents and generic code might do that as well. Maybe I'll just use a Anyway, let me give a try at extending |
comment:5
Looking at the ring homomorphism code brings back bad memories from #23204. Maybe I don't want to add more to morphism.pyx and homset.py as these should probably be drastically simplified if anything. |
comment:6
Replying to @saraedum:
Of course, if it works using generic code, that's fine for me. But it might be harder to do it that way. I'm pretty sure that some of the existing issues with morphism are precisely because code wants to be too generic and doesn't really know what it is doing. |
comment:7
Replying to @saraedum:
But this is really a map induced by a polynomial ring map |
comment:8
Replying to @jdemeyer:
I am not sure I understand. If k is not a prime field, then how would I would I define my map |
comment:9
Replying to @saraedum:
By giving a map If |
comment:10
Sorry, my question was how to do this in Sage precisely. So, I can map If I understand your proposal in comment 7 above, you would like to see a shortcut to define |
comment:11
Replying to @saraedum:
I'm only talking about the implementation. What you "allow people to write" is an entirely different discussion. |
comment:12
An alternative might be to just document these things in the docstring of |
comment:13
@saraedum: |
comment:14
A concrete example where I would like to be able to specify a base_morphism is the following:
|
Changed keywords from none to padicBordeaux |
Branch: u/roed/26105_base_hom |
comment:17
I fixed a few other things as well:
New commits:
|
Commit: |
Reviewer: David Roe, Julian Rüth |
Changed author from Julian Rüth to Julian Rüth, David Roe |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:20
Replying to @saraedum:
This example raises the following error with the current implementation:
|
Changed author from Julian Rüth, David Roe to Julian Rüth, David Roe, Xavier Caruso |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:37
LGTM (see also discussion on Zulip). Positive review when patchbot is happy. |
comment:38
There are failing doctests.
And the flag is red for non_ascii and pyflakes but I don't understand what's wrong. |
Changed branch from u/roed/26105_base_hom to u/caruso/26105_base_hom |
comment:40
I've just updated the doctest. If you agree with my changes, please give a positive review. New commits:
|
comment:41
Looks good to me. |
Changed branch from u/caruso/26105_base_hom to |
, sagemath#24483, sagemath#24371, sagemath#24511, sagemath#25848, sagemath#26105, sagemath#28481, sagemath#29010, sagemath#29412, sagemath#30332, sagemath#30372, sagemath#31345, sagemath#32375, sagemath#32606, sagemath#32610, sagemath#32612, sagemath#32641, sagemath#32660, sagemath#32750, sagemath#32869, sagemath#33602 <!-- ^^^^^ Please provide a concise, informative and self-explanatory title. Don't put issue numbers in there, do this in the PR body below. For example, instead of "Fixes sagemath#1234" use "Introduce new method to calculate 1+1" --> <!-- Describe your changes here in detail --> <!-- Why is this change required? What problem does it solve? --> <!-- If this PR resolves an open issue, please link to it here. For example "Fixes sagemath#12345". --> <!-- If your change requires a documentation PR, please link it appropriately. --> ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> <!-- If your change requires a documentation PR, please link it appropriately --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> <!-- Feel free to remove irrelevant items. --> - [x] The title is concise, informative, and self-explanatory. - [ ] The description explains in detail what this PR is about. - [x] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation accordingly. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on - sagemath#12345: short description why this is a dependency - sagemath#34567: ... --> <!-- If you're unsure about any of these, don't hesitate to ask. We're here to help! --> URL: sagemath#36307 Reported by: Matthias Köppe Reviewer(s):
Currently, the method
.hom(im_gens)
on parents allows you to define the images of the generators of a structure. This is assuming that the coefficients of these generators can be sent to the codomain with some canonical coercion.This is often insufficient, e.g., in the case of polynomial rings where you would also like to define a map that translate the ring of coefficients non-canonically. Note that function fields already have a specialized
.hom()
implementation that supports this feature.See #26103 for a followup.
CC: @roed314 @xcaruso @sagetrac-swewers
Component: coercion
Keywords: padicBordeaux
Author: Julian Rüth, David Roe
Branch/Commit:
626f4ca
Reviewer: David Roe, Julian Rüth, Xavier Caruso
Issue created by migration from https://trac.sagemath.org/ticket/26105
The text was updated successfully, but these errors were encountered: