Hi Travis,

On 2015-11-05, Travis Scrimshaw <tsc...@ucdavis.edu> wrote:
> - 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.

What about a mixed approach: It seems that you have, on the one hand,
nice manifolds that you know by name (S^n, T^n, RR^n, L(p,q), ...). You
want that manifolds that you know by name are identical if and only if
they have the same name. But you also want to be able to build more
complicated manifolds, where you would soon run into non-decidable
homeomorphism tests.

My suggestion would be:
- Start with CachedRepresentation. In that way, manifolds defined with input 
will
  be identical. This would also cover pickling.
- If the manifold has a name or a normal form, then store it as an attribute
  (if I recall correctly, CachedRepresentation stores the input data anyway, so,
  you could just use what CachedRepresentation gives you).
- Implement a comparison as follows:
  * If L and R are named and have the same name, then they are equal.
  * If L and R have a known algorithm for computing a normal form, then
    compute the normal form and store the result as an attribute (or
    just read the attribute if it exists) and do comparison accordingly.
  * Otherwise, it depends what you want. You could just stop and raise
    an error, saying that you can't decide equality. Or you could start
    a heuristics (such as a simulated annealing algorithm on Pachner
    moves for PL-manifolds). Or you could attempt a deterministic
    algorithm that may take ages.
    In the last two cases, it would be good to print a warning to the
    user, at least if verbosity is greater than 0.
- Or IF you really want to use them as dictionary keys, then just let
  manifolds compare by identity (so, you allow that two homeomorphic
  manifolds evaluate as non-equal), and have a separate method
     M.is_homeomorphic(N)
  that does the real thing (but is only invoked if the user asks for
  it).

In that way, you would have super-fast equality-by-identity in the
obvious cases, but would still have a framework for the difficult cases,
where you postpone all unsolvable problems until the user wants them
solved.

Best regards,
Simon


-- 
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.

Reply via email to