#15948: DynkinDiagram with crossed nodes and labels
-------------------------------------+-------------------------------------
       Reporter:  vittucek           |        Owner:
           Type:  enhancement        |       Status:  new
       Priority:  major              |    Milestone:  sage-6.2
      Component:  combinatorics      |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Vít Tuček          |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  u/vittucek/ticket/15948            |  454c0ac306ca5ab92951fb72099fd8ce94985785
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------

Comment (by tscrim):

 Replying to [comment:7 vittucek]:
 > The labels which are implemented so far are intended for people who
 doesn't want to use Bourbaki convention. I think, this feature is not very
 well documented. My labels are purely a decoration of nodes, which can be
 used i.e. to denote a homogeneous vector bundle over $G/P$. So I guess the
 correct thing to do here is to change `node_labels[i]` to
 `node_labels[label(i)]`, right?
 >
 > As for immutability issue, will it be OK, if I just add crossed_nodes
 and node_labels to the constructor and get rid of the setters?

 If you feel the `label` is not well documented, then you should document
 it better. However the best thing to do would be to override the Dynkin
 diagram's relabel as
 {{{#!python
 def relabel(self, relabeling):
     return DynkinDiagram(self._cartan_type.relabel(relabeling))
 }}}
 This would result in:
 {{{
 sage: D = DynkinDiagram(['A',4,1])
 sage: DL = DynkinDiagram(D._cartan_type.relabel([2,-1,-2,-3,4])) # This
 would be D.relabel([2,-1,-2,-3,4])
 sage: DL
 2
 O-----------+
 |           |
 |           |
 O---O---O---O
 -1   -2   -3   4
 A4~ relabelled by {0: 2, 1: -1, 2: -2, 3: -3, 4: 4}
 sage: latex(_)
 \begin{tikzpicture}[scale=0.5]
 \draw (-1,0) node[anchor=east] {$A_{4}^{(1)} \text{ relabelled by }
 \left\{0 : 2, 1 : -1, 2 : -2, 3 : -3, 4 : 4\right\}$};
 \draw (0 cm,0) -- (6 cm,0);
 \draw (0 cm,0) -- (3.0 cm, 1.2 cm);
 \draw (3.0 cm, 1.2 cm) -- (6 cm, 0);
 \draw[fill=white] (0 cm, 0) circle (.25cm) node[below=4pt]{$-1$};
 \draw[fill=white] (2 cm, 0) circle (.25cm) node[below=4pt]{$-2$};
 \draw[fill=white] (4 cm, 0) circle (.25cm) node[below=4pt]{$-3$};
 \draw[fill=white] (6 cm, 0) circle (.25cm) node[below=4pt]{$4$};
 \draw[fill=white] (3.0 cm, 1.2 cm) circle (.25cm) node[anchor=south
 east]{$2$};
 \end{tikzpicture}
 }}}
 I agree that we should add the following semantic to `CartanType`:
 {{{
 sage: CartanType(['A',2], labels=[-1,-2])
 }}}
 (or perhaps `label` or `labeling` or...) and for `crossed_nodes`. Yet we
 should also have an additional method which allows us to set the crossed
 nodes.

 I feel like we should add `type_crossed.py` which keeps/prints this data
 and uses the same mechanic that the relabeled Cartan types use. Nicolas,
 do you agree?

 Furthermore, I don't like the current state of your printing method. Your
 iteration of the string is wrong because your assuming your labeling is
 nice (i.e. `[0, 1, ..., k]`). However that is somewhat moot because I
 think you should only have one method for printing the individual nodes,
 as per Nicolas' suggestion, because it is overkill (it's basically just a
 for loop).

 Thanks for your work on this,[[BR]]
 Travis

--
Ticket URL: <http://trac.sagemath.org/ticket/15948#comment:10>
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to