#18529: Topological manifolds: basics
-------------------------------------+-------------------------------------
       Reporter:  egourgoulhon       |        Owner:  egourgoulhon
           Type:  enhancement        |       Status:  needs_info
       Priority:  major              |    Milestone:  sage-6.10
      Component:  geometry           |   Resolution:
       Keywords:  topological        |    Merged in:
  manifolds                          |    Reviewers:  Travis Scrimshaw
        Authors:  Eric Gourgoulhon,  |  Work issues:
  Travis Scrimshaw                   |       Commit:
Report Upstream:  N/A                |  0fb39df7fafe7f0a765bf73b3f34a6cb41e65c40
         Branch:                     |     Stopgaps:
  u/tscrim/top_manifolds_refactor    |
   Dependencies:  #18175             |
-------------------------------------+-------------------------------------

Comment (by egourgoulhon):

 Replying to [comment:80 tscrim]:
 > I did some exploring in the coercion code and some testing using this:

 Thanks for the exploration.
 The trick
 >{{{#!python
 >     def _coerce_map_from_(self, R):
 >         return isinstance(R, Foo)
 > }}}
 is too permissive to be applicable to scalar field algebras. For them, the
 coercion is currently based on the concept of restriction to a subdomain,
 i.e. there is a coerce map from C^k^(M) to C^k^(N) iff N is a subset of M
 (cf. the code of `_coerce_map_from_` in `scalar_field_algebra.py`). It is
 very desirable to keep this feature, which is mathematically neat.
 >
 > Furthermore, from looking at your code, the reason why it now breaks is
 you're assuming unique representation by not passing the scalar field
 algebra as the first argument of the scalar field. So it's getting
 mismatches because the `domain.scalar_field_algebra()` may not be the
 scalar field algebra that was suppose to be creating that particular
 scalar field. So for the scalar fields, I would instead have the first
 argument be the corresponding algebra and get the domain from that (with
 appropriate handling of parameters for the methods which create the scalar
 fields).

 I've done this (actually this should have been done before: it is cleaner
 to have the parent as first argument when constructing elements). But this
 does not solve the problem. There is a difference though: on the example
 of comment:74, we do no longer get the coercion error message but the ECL
 error message arising from Maxima; the latter was previously appearing
 after the coercion error message:
 {{{
 ;;;
 ;;; Stack overflow.
 ;;; Jumping to the outermost toplevel prompt
 ;;;
 }}}
 and that a lot of text until `Abandon (core dumped)`. I've pushed the new
 code (i.e. with the algebra as first argument of scalar fields) to the
 branch of #19147, in case you want to have a look.
 > You might also consider caching the scalar field algebra that gets
 created for a particular manifold to have unique representation behavior.
 This was already the case (cf. the code of
 `DifferentiableManifold.scalar_field_algebra()`).

--
Ticket URL: <http://trac.sagemath.org/ticket/18529#comment:81>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to