Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement ascii art output for Dynkin diagrams #5502

Closed
aghitza opened this issue Mar 12, 2009 · 12 comments
Closed

implement ascii art output for Dynkin diagrams #5502

aghitza opened this issue Mar 12, 2009 · 12 comments

Comments

@aghitza
Copy link

aghitza commented Mar 12, 2009

Dan Bump requested this in his Sage Days 14 talk: have ascii art output a la LiE for Dynkin diagrams (see interfaces/lie.py for some examples of usage).

CC: @sagetrac-sage-combinat

Component: combinatorics

Keywords: dynkin diagram ascii art lie

Issue created by migration from https://trac.sagemath.org/ticket/5502

@dwbump
Copy link
Mannequin

dwbump mannequin commented Apr 15, 2009

comment:2

I uploaded trac_5502.patch for this. It applies to sage-3.4.1.rc2 and there are no errors in sage/combinat/rootsystems/*.py..

I have not tested it against the combinat patchseries because at the moment hg qpush -a fails in sage-combinat.

After the patch, the __repr__ method of class DynkinDiagram returns ascii art for the classical Cartan Types.

A natural extension would be to give the extended Dynkin diagram for the untwisted affine types.

@dwbump dwbump mannequin removed this from the sage-3.4.2 milestone Apr 15, 2009
@dwbump dwbump mannequin added the s: needs review label Apr 15, 2009
@wdjoyner
Copy link

comment:4

Is this related to #2023 ?

@nthiery
Copy link
Contributor

nthiery commented Apr 15, 2009

comment:5

Replying to @wdjoyner:

Is this related to #2023 ?

That's indeed the ascii art version of 2023. Thanks for the pointer.

@dwbump
Copy link
Mannequin

dwbump mannequin commented Apr 15, 2009

comment:6

I think the spirit of this patch is the same as #2023.

The idea of this patch is just that if the Cartan type is that
of a classical Lie algebra, you should be able to somehow
access it's Dynkin diagram. The solution here is making it part of the string
returned by the __repr__ method of the class.

We follow the Bourbaki conventions, which is the same as the
programmed-in Cartan types. These diagrams are identical to
those produced by LiE, so you can have them already if you
install that optional package.

sage: CartanType("E6").dynkin_diagram()

        O 2
        |
        |
O---O---O---O---O
1   3   4   5   6   
E6

You want this if you need to be reminded of what labeling
convention is used. If the Cartan type is not recognized, we get the
old behavior. Thus:

sage: CartanType(['E',6,1]).dynkin_diagram()
Dynkin diagram of type ['E', 6, 1]

It might be more convenient if untwisted affine types gave the
extended Dynkin diagram, thus:

sage: CartanType(['E',6,1]).dynkin_diagram()
        O 0 
        |
        |
        O 2
        |
        |
O---O---O---O---O
1   3   4   5   6
E6~

Beyond that, one might implement Dynkin diagrams for twisted
affine types, but that seems less urgent.

@dwbump
Copy link
Mannequin

dwbump mannequin commented Apr 23, 2009

comment:7

The file trac_5502.2.patch add extended Dynkin diagrams as Dynkin diagrams of untwisted affine Cartan types.

Anne Schilling requests twisted affine types, but this is not done.

@dwbump
Copy link
Mannequin

dwbump mannequin commented Apr 30, 2009

comment:8

Attachment: trac_5502-revised.patch.gz

The patch trac_5502-revised.patch corrects some problems and supercedes
the previous patches.

@dwbump
Copy link
Mannequin

dwbump mannequin commented May 6, 2009

comment:9

I changed the milestone to 4.0 in hopes this can be merged.

@dwbump dwbump mannequin added this to the sage-4.0 milestone May 6, 2009
@anneschilling
Copy link

comment:10

The patch implements ascii art for all finite and untwisted Cartan types,
which is very useful for visual clues about the numbering of the Dynkin nodes.

All doctests pass.

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented May 11, 2009

comment:11

There are two new functions without doctests:

  • extended_dynkin_diagram_ascii_art
  • dynkin_diagram_ascii_art

I know they are tested elsewhere, but the 100% rule still applies. Once the doctests have been added the positive review can be reinstated assuming the doctests in the file modified actually pass ;)

Cheers,

Michael

@dwbump
Copy link
Mannequin

dwbump mannequin commented May 12, 2009

comment:12

Attachment: trac_5502-doc.patch.gz

The patch trac_5502-doc.patch goes on top of trac_5502-revised.patch.

It adds doctests to the two ascii art functions.

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented May 12, 2009

comment:13

Positive review overall.

Dan: Please remember to change the summary back once you updated the patch.

Cheers,

Michael

@sagetrac-mabshoff
Copy link
Mannequin

sagetrac-mabshoff mannequin commented May 12, 2009

comment:14

Merged both patches in Sage 4.0.alpha0.

Cheers,

Michael

@sagetrac-mabshoff sagetrac-mabshoff mannequin closed this as completed May 12, 2009
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants