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

more Lie algebras #1

Open
selpoG opened this issue Mar 18, 2019 · 2 comments
Open

more Lie algebras #1

selpoG opened this issue Mar 18, 2019 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@selpoG
Copy link
Owner

selpoG commented Mar 18, 2019

We support few Lie algebras now, but in principle, we can construct any irreps of a simple Lie algebra.

@selpoG selpoG self-assigned this Mar 18, 2019
@selpoG selpoG added the enhancement New feature or request label Mar 18, 2019
@selpoG
Copy link
Owner Author

selpoG commented Apr 19, 2019

SU(4) support has begun.
prod is embedded by hand, and could be insufficient.
In case you see such as "Oops! We need prod of v[4,2,1] and v[3,1,0]!", you have to execute f([4,2,1],[3,1]) in SageMath after loading following python code, and insert the output into 386th line in grouplie.m.

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))))

@selpoG
Copy link
Owner Author

selpoG commented May 3, 2019

SU(4) support has completed.
The workaround above is not needed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant