Ask Your Question

Rename Lambda in weight space

asked 2018-11-14 15:53:24 +0200

pbelmans gravatar image

It's a basic question, but after looking at the manual for a while I couldn't find the answer, so here goes.

R = RootSystem(["A",7])
print R.weight_lattice().fundamental_weight(1)

returns Lambda[1]. Is it possible to rename Lambda here? I could hack this by overriding the .__str__ method, but is there a cleaner method?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2018-11-14 16:58:52 +0200

nbruin gravatar image

updated 2018-11-14 23:27:39 +0200

You can do something like

L = R.weight_lattice()

There may be a more elegant way than just reaching into the private "_print_options" attribute.

EDIT: There is indeed a more elegant way:


Note that this design is fundamentally conceptually wrong: The "weight lattice" is a UniqueRepresentation object and as such absolutely needs to be immutable (unrelated code could end up with a reference to the same object). So, changing the prefix amounts to scribbling in a global variable. You may find that a weight lattice that has been constructed in a completely unrelated setting also changes print prefix.

edit flag offensive delete link more


Great, thanks! It's at least more elegant than overwriting __str__.

pbelmans gravatar imagepbelmans ( 2018-11-14 19:02:48 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-11-14 15:53:24 +0200

Seen: 107 times

Last updated: Nov 14 '18