Ask Your Question
1

Rename Lambda in weight space

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

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
2

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

nbruin gravatar image

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

You can do something like

L = R.weight_lattice()
L._print_options['prefix"]="your_prefix_of_choice"

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

EDIT: There is indeed a more elegant way:

L.print_options(prefix="b")

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

Comments

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

pbelmans gravatar imagepbelmans ( 2018-11-14 19:02:48 +0100 )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

Stats

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

Seen: 270 times

Last updated: Nov 14 '18