#13566: Simplicial complex examples as singletons
---------------------------------------------------+------------------------
       Reporter:  tscrim                           |         Owner:  tscrim     
     
           Type:  enhancement                      |        Status:  needs_work 
     
       Priority:  minor                            |     Milestone:  sage-5.7   
     
      Component:  algebraic topology               |    Resolution:             
     
       Keywords:  simplicial                       |   Work issues:             
     
Report Upstream:  N/A                              |     Reviewers:  Travis 
Scrimshaw
        Authors:  Christian Nassau, John Palmieri  |     Merged in:             
     
   Dependencies:  #13244, #12587                   |      Stopgaps:             
     
---------------------------------------------------+------------------------

Comment (by tscrim):

 Replying to [comment:25 jhpalmieri]:
 > How do you make an immutable simplicial complex mutable? We seem to have
 missed adding a `set_mutable` method in #12587, and so now I don't know
 how to get a mutable copy of the various examples, short of explicitly
 setting the `_is_mutable` attribute.

 For example
 {{{
 sage: S = simplicial_complexes.Sphere(4)
 sage: S.is_mutable()
 False
 sage: T = SimplicialComplex(S, is_mutable=True) # This should work and is
 a bug I didn't catch
 sage: T.is_mutable()
 False
 sage: T = SimplicialComplex(S) # This one I'm happy with leaving immutable
 sage: T.is_mutable()
 False
 }}}
 However I do think we should also have a method to make a mutable copy, my
 suggestions are either `copy()` and/or `make_mutable()`.

 > I think this should be fixed very soon, maybe before the other issues in
 this ticket.

 Agreed. This was something I introduced, so I'll be happy to fix it.

 > As far as whether the examples should be immutable, I don't feel
 strongly either way. I can see a certain elegance in immutability, but
 other examples in Sage don't seem to work like this. I suppose we could
 use `UniqueFactory` to create an immutable unique instance, but the
 functions (or methods, or whatever) could return a mutable copy each time.
 For example:
 > {{{
 > sage: MatrixSpace(QQ, 3, 3).identity_matrix().is_mutable()
 > False
 >
 > sage: matrix.identity(QQ, 3).is_mutable()
 > True
 > }}}
 > This seems rather odd to me, but I suppose it's an option.

 This is very strange to me as well. Part of the thing is the identity
 matrix function is cached, so it must return an immutable object.

 Best,[[BR]]
 Travis

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13566#comment:26>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to