Skip to content

Fix : TypeError in IntegralAffineCurve.function_field() for non-default variable names#41786

Open
PrafulVRaj wants to merge 1 commit intosagemath:developfrom
PrafulVRaj:fix/affine-curve-function-field-nondefault-vars
Open

Fix : TypeError in IntegralAffineCurve.function_field() for non-default variable names#41786
PrafulVRaj wants to merge 1 commit intosagemath:developfrom
PrafulVRaj:fix/affine-curve-function-field-nondefault-vars

Conversation

@PrafulVRaj
Copy link

Summary

When AffineSpace is constructed with names other than the default (x, y), simple_model()/separable_model() rename the base-field generator (e.g. y to y_) to avoid a collision in the extension tower. The Horner-scheme evaluator in _nonsingular_model used .x on function-field elements, which bypasses coercion and returns values in Frac(k[y]) rather than in FR = Frac(k[y,z]). Sage has no registered coercion between these two differently-named fraction fields, so the accumulation fails with TypeError.

Fix

Build an explicit ring homomorphism base_to_FR from M.base_field() to FR before entering the evaluate closure, and replace ._x with base_to_FR(). This routes every coefficient through Sage's public coercion machinery and guarantees it lands in FR regardless of generator naming.

Fixes #41643

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Construction of function field of affine curve fails

1 participant