I should note for those not wanting to read through the discussion in full that we arrived at the current design dealing with the following issues:
- We need the manifold to be defined in order for check the charts (as it is the domain of said map). - We can't just use EqualityById without UniqueRepresentation because this breaks pickling. - We can only define manifolds by (latex) name, base ring, and dimension, so this is insufficient data for UniqueRepresentation. So we add an additional unique identifier to the cache key, the time from the epoch the object was created. We would welcome any suggestions for improvements on ways to work around these issues and still preserve a fast equality check. Best, Travis On Wednesday, November 4, 2015 at 4:10:51 PM UTC-6, Eric Gourgoulhon wrote: > > Hi sage-dev, > > There is an ongoing discussion at #18529 > <http://trac.sagemath.org/ticket/18529> about defining __eq__ for > manifolds and whether one should > use UniqueRepresentation (which implements equality by id). If anybody has > any opinion on this, > she/he is welcome to join the discussion. > > The context is as follows: > > - Manifolds are parents, whose elements are points. > - Manifolds are characterized by a user-defined atlas, which is a list of > coordinate charts defined on the > fly by the user, along with transition maps. "Defined on the fly" means > that charts are added to the > atlas during the working session. In particular, the atlas is not set at > the manifold construction. > - Two points are declared equal iff they have the same coordinates in the > same chart. > - Mathematically speaking, two manifolds are equal if they have the same > maximal atlas, not the > same "user-defined" atlas. Now maximal atlases cannot be represented in > the computer. > - One needs fast equality check for manifolds, since > (i) they are used as dictionary keys (for instance as the domains in the > dictionary of the restrictions of > some field) > (ii) check of chart equality involves comparison of chart domains, which > are manifolds (as open subset > of a manifold), and charts are massively used as keys in the > dictionary of coordinate expressions > of scalar fields > In the current branch of #18529 <http://trac.sagemath.org/ticket/18529>, > the manifold class inherits from UniqueRepresentation, so that > equality is by id and is therefore fast. > > Examples of use corresponding to #18529 branch are here > <http://sagemanifolds.obspm.fr/doc/18529/reference/manifolds/sage/manifolds/manifold.html> > > (they are rather primitive since there are > neither scalar fields nor continuous maps in #18529). > > Thanks for your feedback. > > Eric. > -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at http://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.