#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 vittucek):

 Replying to [comment:10 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.

 There are two problems. First that I do not understand current labeling
 mechanism properly (code nor use cases -- does anybode use `label` at
 all?) and second that the semantics here are really different. My
 `node_labels` represent some other object that has a priori nothing to do
 with how we label the basis of our Cartan algebra. In reality these
 `node_labels` denote a highest weight of the Levi part of a standard
 parabolic subalgebra and thus it should really be a mapping that assigns
 natural numbers to labels. So perhaps `node_labels` should really be a
 dictionary with keys `label(i) for i in self.index_set()`  What about
 this?

 {{{#!python
 def set_node_labels(self, node_labels):
     if isinstance(node_labels, list):
         self.node_labels = {i : node_labels[label(i)-1] for i in
 self.index_set()}
     else:
          self.node_labels = node_labels
 }}}

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

 As with `label` I am not sure what is the use case here. What is wrong
 with CartanType having labels, node_labels and crossed out nodes as
 instance variables?

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

 Did you look at my last commit?
 
(http://git.sagemath.org/sage.git/commit/?id=454c0ac306ca5ab92951fb72099fd8ce94985785)

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

 Thanks for feedback. ;)

--
Ticket URL: <http://trac.sagemath.org/ticket/15948#comment:11>
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