back to table · edit · history · where entries came from · files · download
767 bytes, as of the version from 2026-10-27 13:15 (current). Recorded here, not run.
import numberdb.sage as numberdb
from sage.rings.rational_field import QQ
from sage.symbolic.ring import SR
from sage.combinat.partition import Partitions
from sage.combinat.sf.sf import SymmetricFunctions
from math import factorial, prod
def unitary_weingarten(N, mu):
k = sum(mu)
SF = SymmetricFunctions(QQ)
s, p = SF.schur(), SF.power()
answer = QQ(0)
for lam in Partitions(k):
if len(lam) > N:
continue
f = s[lam].scalar(p[[1] * k])
chi = s[lam].scalar(p[list(mu)])
c = prod(N + j - i for i, row in enumerate(lam) for j in range(row))
answer += QQ(f * chi) / QQ(c)
return answer / QQ(factorial(k))
if __name__ == '__main__':
print(unitary_weingarten(13, (3, 1))) # 67/149909760