DSD

Posted in Code, Math, Physics, Projects
5 Comments

Lie Group Computations With Python

lie is a python mod­ule for com­pu­ta­tions with Lie groups, Lie alge­bras, rep­re­sen­ta­tions, root sys­tems, and more.

I based it on the com­puter alge­bra pack­age LiE, writ­ten by M. A. A. van Leeuwen, A. M. Cohen and B. Lisser in the early 90’s. They chose to imple­ment a pro­pri­etary script­ing lan­guage as a wrap­per for all the fancy math­e­mat­i­cal algo­rithms. While this lan­guage is use­ful for inter­ac­tive com­pu­ta­tions and short scripts, python is more expres­sive and pow­er­ful — def­i­nitely what you want when explor­ing your favorite excep­tional group.

A Fun Example

Here’s an exam­ple of using lie to do a cal­cu­la­tion that’s near and dear to every high energy theorist’s heart. We’ll show how the 10 + 5bar + 1 rep­re­sen­ta­tion of SU(5) con­tains a sin­gle stan­dard model gen­er­a­tion. First we’ll fire up python and import the lie module.

Python 3.1 (r31:73578, Jun 27 2009, 21:49:46)
>>> from lie import *

Let’s let g be the GUT group SU(5) (A4 in Cartan’s classifiation).

>>> g = A4; g.pprint()
'SU(5)'

We’ll let the rep­re­sen­ta­tion r be a sin­gle GUT gen­er­a­tion: 10 + 5bar + 1 of SU(5).

>>> r = g.fund().dual() + g.alt_tensor(2) + g.trivial()
>>> r.pprint()
'(1) + (5b) + (10)'

Here, we’ll check that SU(2)×SU(3) is a sub­group of SU(5). Then we’ll get the restric­tion matrix for SU(2)×SU(3) in SU(5), and add the U(1) part by hand:

>>> [h.pprint() for h in g.max_subgrps()]
['SU(4)', 'SO(5)', 'SU(2)xSU(3)']
>>> m = g.res_mat(A1*A2)
>>> m = m.transpose().concat(mat([[-2,1,-1,2]])).transpose()

Finally, we decom­pose r under the group SU(2)×SU(3)×U(1). The first two num­bers are the SU(2) and SU(3) rep dimen­sions, and the third is the U(1) charge (which dif­fers from the con­ven­tional hyper­charge by a fac­tor of 6).

>>> r.branch(A1*A2*T1, m).pprint() 
'(1,1,0) + (1,1,6) + (1,3b,-4) + (1,3b,2) + (2,1,-3) + (2,3,1)'

These are indeed the rep­re­sen­ta­tions of a gen­er­a­tion of stan­dard model fermi­ons (writ­ten as left-handed Weyl spin­ors). In order, we have: a heavy neu­trino, the positron, the up quark, the down quark, the lep­ton dou­blet, and the left-handed quark dou­blet. Yay!

Back­ground

I decided I needed some­thing like lie last sum­mer while work­ing on Super­con­for­mal Fla­vor Sim­pli­fied with David Poland. Since none of the math­e­mat­i­cal tools that physi­cists com­monly use (e.g. Math­e­mat­ica) had any rou­tines for Lie group rep­re­sen­ta­tion the­ory, I was delighted to stum­ble upon LiE, which imple­mented basi­cally all the algo­rithms I wanted. How­ever, the authors’ choice to cre­ate their own script­ing lan­guage was a lit­tle silly, and def­i­nitely not future-proof. For instance, while LiE imple­ments lists of num­bers (vec­tors) and lists of lists of num­bers (matri­ces), it doesn’t know any­thing about lists of lists of lists of num­bers. This might seem insignif­i­cant, but it was frus­trat­ing for two reasons:

LiE uses a list of inte­gers to rep­re­sent the high­est weight vec­tor of a rep­re­sen­ta­tion, so if I want lists of rep­re­sen­ta­tions, like in a model, I need lists of lists. And if I want lists of mod­els, I need lists of lists of lists. Turns out I was try­ing to write a whole paper about lists of models.

Future Work

I devel­oped lie to the point where it was capa­ble of doing what I needed for Super­con­for­mal Fla­vor Sim­pli­fied. There’s def­i­nitely some debug­ging and restruc­tur­ing to be done. For instance, the source­code cur­rently includes the entire lexer and parser from the orig­i­nal LiE, just because I haven’t both­ered to extract them from every­thing else (I orig­i­nally took the approach of try­ing to mod­ify the LiE source as lit­tle as pos­si­ble). It’s a work in progress, but lie has already been use­ful to me, so I fig­ure oth­ers might ben­e­fit from it too.

So check out the source, give it a whirl, and if it doesn’t do what you want, help me make it better!


5 Responses to “Lie Group Computations With Python” Comment Feed, Trackback.

  1. Joseph Smidt says: Jun 03, 2010 @ 11:39 am

    Now here’s a cool Python mod­ule! Talk about use­ful. I love Lie groups.

  2. Puff says: Jun 08, 2010 @ 3:31 pm

    It’s Bremsstrahlung.

  3. davidsd says: Jun 08, 2010 @ 4:03 pm

    Good call.

  4. A.J. says: Nov 05, 2011 @ 11:37 am

    Thumbs up! Nice work.

  5. Rex says: Apr 16, 2013 @ 4:14 am

    Great! LiE and Macaulay2 are two of my favorite tools. With Macaulay2 we could han­dle rings and solve homology/cohomology groups.

    But I do agree both of them have lim­i­ta­tions, for exam­ple, there is no MPI or OpenMP imple­mented and we can not do any high per­for­mance computaion.

    It is great to have a python mod­ule of LiE. Is there any python mod­ule com­pa­ra­ble to Macaulay2?

Leave a Reply