-
-
Notifications
You must be signed in to change notification settings - Fork 491
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
Random failure in ell_field.py with division_field #36832
Comments
This seems to be a new bug. I did not get an error (and the specified doctests passed) with v10.2 on intel MacOS 13.6:
But I get the |
I will take a look. Not today |
Probably related to Flint upgrade in #35848 |
This failure is not specific to macOS. Also shows up randomly in the conda CI on Linux - https://github.com/sagemath/sage/actions/runs/7259211723/job/19837970698?pr=36877#step:11:8314 |
Minimal failing example: sage: F = GF(11)
sage: phi = Hom(F,F).an_element()
sage: R.<x,y> = F[]
sage: x.change_ring(phi) Part of the issue is that identity finite-field embeddings are returned as a generic sage: type(Hom(GF(11), GF(11)).an_element())
<class 'sage.categories.morphism.IdentityMorphism'>
sage: type(Hom(GF(11), GF(11^2)).an_element())
<class 'sage.rings.finite_rings.hom_prime_finite_field.FiniteFieldHomomorphism_prime'> ...which then proceeds to cause trouble somewhere in the coercion system. |
Can you add My example is:
|
What do you mean? Is this supposed to work? |
The input for (Edit) Example for your convenience: sage: F = GF(11)
sage: phi = Hom(F, F.extension(2)).an_element()
sage: R.<x,y> = F[]
sage: x.change_ring(phi)
x
sage: x.change_ring(phi).parent()
Multivariate Polynomial Ring in x, y over Finite Field in z2 of size 11^2 |
It makes sense. Thanks. Then it remains to spot the code that is responsible in dealing with the morphism input. |
I think we should also consider the possibility that having a generic |
Generic |
I traced the code. At some point, |
--- a/src/sage/rings/polynomial/multi_polynomial.pyx
+++ b/src/sage/rings/polynomial/multi_polynomial.pyx
@@ -878,9 +878,9 @@ cdef class MPolynomial(CommutativePolynomial):
[x*y]
"""
if isinstance(R, Map):
- #if we're given a hom of the base ring extend to a poly hom
+ # if we're given a hom of the base ring, extend to a hom of the polynomial ring
if R.domain() == self.base_ring():
- R = self.parent().hom(R, self.parent().change_ring(R.codomain()))
+ R = self.parent().hom(self.parent().change_ring(R.codomain()), base_map=R)
return R(self)
else:
return self.parent().change_ring(R)(self.dict()) This seems to fix the original bug (without "fixing identity morphism"). |
Can it be related to #36472? |
No. That is for ideals. This is for polynomials. |
The fix #37159 is ready for review. |
<!-- ^^^^^ 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 --> Fixes sagemath#36832. <!-- 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#37159 Reported by: Kwankyu Lee Reviewer(s): Gonzalo Tornaría, Kwankyu Lee
Steps To Reproduce
This raises an error:
As a result, this doesn't pass for me (OS X):
Expected Behavior
The test should pass.
Actual Behavior
An error is raised:
Additional Information
No response
Environment
Checklist
The text was updated successfully, but these errors were encountered: