#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, Franco Saliola, Stepan Starosta
| Upstream: N/A
Reviewer:
| Merged:
Work_issues:
|
--------------------------------------------------------------------------------+
Comment(by slabbe):
Hi Timo,
> * I removed the `coloring` option in `apply_substitution`. Why? Because
we
> can use `repaint`, and it is better that all the "color business" is
taken
> care of by `repaint`. The colors of a face in an image by a
substitution is
> automatically the color of its preimage (which enables to get the
> interesting coloring given by the substitution). If we want to change
the
> color of a patch obtained by iteration, `repaint`!
Great idea! Very very good. That is really upgrading the quality of the
code. The design is converging!
> * I took care of the above remarks concerning `color_from_preimage`,
and
> used the clever solution suggested by Sébastien: dictionaries
> `{types:colors}`.
Great. I am just wondering if we could avoid to use a list of one color to
change the color of every faces. If their is no intersection between the
list of available color and the list of available color map, then simply a
color string could be used for coloring every faces the same color.
> '''Now, a last and important remark'''. Writing
>
> {{{
> sigma = WordMorphism('1->12,2->13,3->1')
> }}}
> is less painful than writing
>
> {{{
> sigma = WordMorphism({1:[1,2], 2:[1,3], 3:[1]})
> }}}
I agree.
> Since all the face types are integers and the
[http://trac.sagemath.org/sage_trac/search/opensearch?q=wiki%3AWordMorphism
WordMorphism] defining an `E1Star` must be on integers, we are supposed to
use the latter way to define `sigma`. However, I find it very
inconvenient, so we allow the user to give a `sigma` defined on an
'''arbitrary''' alphabet. When `E1Star` is defined, it is converted and
stored as a substitution on the alphabet `[1, ..., d]` (so that there is a
correspondence between the types of the faces and the alphabet of the
substitutions). It really makes the definitions much more convenient and I
don't think that it harms `sage` so much.
>
> Also, I don't think that it would be useful to allow the user to specify
an arbitrary alphabet for the faces, since they are not used as the
letters of a word, but as three-dimensional objects, which we ''call'' of
type `1`, `2` or `3`. (This is why all the types are represented by
integers.) It corresponds to the mathematical definition of the object.
>
> I strongly insist on this last remark!
One solution is to allow face type '1', '2' and '3' which would work
easily with such expressions : {{{WordMorphism('1->12,2->13,3->1')}}}. But
I know you don't like this solution.
On the other side, as I already explained, I dislike the solution you
propose because (1) it is getting the code less efficient for those who
specify a WordMorphism already defined on integers, (2) because those
translation of object gets the code less versatile and reusable by others
and (3) it may leads to conceptual problems for the user when letters gets
translated not in the way he expected.
Personnaly, I can not give a positive review with this translation of
alphabet.
I think Alexandre's ideas for improving the definition of `WordMorphism`
might be a good compromise.
Moreover, in the code of {{{plot_tikz}}}, I suggest to use the following
ideas :
{{{
sage: P = Patch([Face((0,0,0),t) for t in [1,2,3]])
sage: d = P._face_contour
sage: ' -- '.join(map(str, d[1])) + ' -- cycle;\n'
'(0, 0, 0) -- (0, 1, 0) -- (0, 1, 1) -- (0, 0, 1) -- cycle;\n'
}}}
rather than hardcoding the face contour points:
{{{
if print_macros:
s += '\\def\\loza#1#2#3#4#5#6{\n'
s += ' \\definecolor{facecolor}{rgb}{#4,#5,#6}\n'
s += ' \\fill[fill=facecolor, draw=black, shift={(#1, #2,
#3)}]\n'
s += ' (0,0,0) -- (0,1,0) -- (0,1,1) -- (0,0,1) -- cycle;\n'
s += '}\n'
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8431#comment:28>
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.