-
Notifications
You must be signed in to change notification settings - Fork 2
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
more Lie algebras #1
Labels
enhancement
New feature or request
Comments
SU(4) support has begun. import functools
from collections import defaultdict
from sage.combinat.partition import Partitions
import sage.libs.lrcalc.lrcalc as lrcalc
# SU(rank + 1)
rank = 3
def my_get(t, i): return t[i] if i < len(t) else 0
def comp_part(x, y):
t = sum(x) - sum(y)
if t != 0: return t
for i in range(rank - 1):
t = my_get(y, i) - my_get(x, i)
if t != 0: return t
return 0
def as_prod(ans):
cnt = defaultdict(int)
for p, n in ans.items():
l = reduce(list(p))
if l is not None: cnt[tuple(l)] += n
for t in sorted(cnt.keys(), key=functools.cmp_to_key(comp_part)):
l = list(t)
if cnt[t] > 1: print("{0} appears {1} times!".format(get_v(l), cnt[t]))
for _ in range(cnt[t]): yield l
def reduce(x):
if len(x) > rank + 1: return None
if len(x) <= rank: return [a for a in x if a > 0]
return [b for a in x[:-1] for b in [a - x[-1]] if b > 0]
def get_parts(n): return list(map(list, Partitions(n, max_length=rank).list()))
def calc_mult(x, y): return list(as_prod(lrcalc.mult(x, y, maxrows=rank + 1)))
def get_v(p): return "v[{0}]".format(", ".join(my_get(p, i) for i in range(rank)))
def to_mathematica(x): return "{" + ", ".join(map(get_v, x)) + "}"
def f(x, y): print ("G[prod[{0}, {1}]] = {2};".format(get_v(x), get_v(y), to_mathematica(calc_mult(x, y)))) |
SU(4) support has completed. |
selpoG
added a commit
that referenced
this issue
Oct 25, 2020
selpoG
added a commit
that referenced
this issue
Oct 25, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We support few Lie algebras now, but in principle, we can construct any irreps of a simple Lie algebra.
The text was updated successfully, but these errors were encountered: