Question about Morphism and SchemeMorphism (Issue 14711)

60 views
Skip to first unread message

Gareth Ma

unread,
Mar 31, 2024, 11:34:57 PM3/31/24
to sage-...@googlegroups.com
I'm currently working on stuff related to `EllipticCurveHom` and `SchemeMorphism` at #37705. While working on it, I realised there's a fundamental difference between the two `EllipticCurveHom` inherits from `sage.categories.morphism.Morphism`, while `SchemeMorphism` inherits from `sage.schemes.generic.morphism.SchemeMorphism`, and no neither inherits from the other. Tracing back, there's this TODO:

```
.. TODO::

    For historical reasons, :class:`SchemeMorphism` copies code from
    :class:`~sage.categories.map.Map` rather than inheriting from it.
    Proper inheritance should be used instead. See :issue:`14711`.
```

I tried reading through the thread of #14711, but it's quite hard to understand, since I don't have background in the structural part of Sage. I don't even understand how the title "Weak references in the coercion graph" relate to the problem. Does anyone know about this issue? (It seems at least three participants are still active in Sage dev.) Can this be resolved in 2024?

This is not an April-Fools joke.

Best regards,

Gareth Ma

unread,
Apr 2, 2024, 12:52:57 PM4/2/24
to sage-...@googlegroups.com
I have looked into some of the issues and TODOs discussed in #14711, and put my thoughts under #37705. In particular, to merge `SchemeMorphism` with `Morphism` (or at least make SchemeMorphism inherit from Morphism), I think the coercion model should be tweaked, so opinions from experts are very much needed. In particular, the current (heuristic) algorithm for `cm.discover_action` behaves badly when there is a "type diamond" (a terminology borrowed from Lean), i.e. multiple type inheritance. Take this for example,

             SageObject (coercion model)
              ^      ^
              |      |
             /       Map
            /          \
  ModuleElement     Morphism
            ^          ^
             \        /
              \      /
           SchemeMorphism

The coercion model has a special path for multiplying ModuleElement by another Element, meaning the operation defined in Morphism/Map will be ignored, which is undesirable since well a SchemeMorphism should be more like a morphism not a module element I guess

(Sorry for the spam on Easter holidays)


Reply all
Reply to author
Forward
0 new messages