#8431: Substitutions over unit cube faces (Rauzy fractals)
--------------------------------------------------------------------------------+
Reporter: vdelecroix
| Owner: tjolivet
Type: task
| Status: needs_work
Priority: major
| Milestone: sage-4.6
Component: combinatorics
| Keywords: word morphism unit face generalized substitution rauzy fractal
Author: Vincent Delecroix, Timo Jolivet, Stepan Starosta, Franco Saliola
| Upstream: N/A
Reviewer:
| Merged:
Work_issues:
|
--------------------------------------------------------------------------------+
Comment(by slabbe):
I suggest to add this example for the method `__eq__` for Patch class :
{{{
def __eq__(self, other):
r"""
EXAMPLES::
sage: from sage.combinat.e_one_star import E1Star, Face, Patch
sage: x = WordMorphism('0->02,1->012,2->2')
sage: y = WordMorphism('0->012,1->12,2->2')
sage: p = Patch([Face((0,0,0),1), Face((0,0,0),2),
Face((0,0,0),3)])
sage: E1Star(x) (p) == E1Star(y) (p)
False
sage: E1Star(x * y) (p) == E1Star(y) (E1Star(x) (p))
True
"""
return (isinstance(other, Patch) and
set(self) == set(other) )
}}}
I also suggest to add a `__len__` method and change the `__repr__` to
behave like Graphs (Graph of 45 vertices).
{{{
def __repr__(self):
r"""
String representation of a patch.
EXAMPLES:
sage: x = [Face((0,0,0),t) for t in [1,2,3]]
sage: P = Patch(x)
sage: P
Patch of 3 faces
"""
return "Patch of %s faces"%len(self)
def __len__(self):
r"""
Returns the number of faces.
EXAMPLES::
sage: x = [Face((0,0,0),t) for t in [1,2,3]]
sage: P = Patch(x)
sage: len(P) #indirect doctest
3
"""
return len(self._faces)
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8431#comment:9>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.