Skip to content

Instantly share code, notes, and snippets.

@8d1h
Created July 23, 2021 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 8d1h/23906205a0f564315cd5631fd6997e70 to your computer and use it in GitHub Desktop.
Save 8d1h/23906205a0f564315cd5631fd6997e70 to your computer and use it in GitHub Desktop.
LLV decomposition of hyperkähler cohomology in Sage
def hodge_num(d, V):
"""
Hodge numbers of a g-module V for a hyperkähler manifold of dimension d
"""
n = d / 2
m = V.weight_multiplicities()
M = matrix([[0 for i in range(d + 1)] for j in range(d + 1)])
for w in m:
M[w[0] + w[1] + n, w[0] - w[1] + n] += m[w]
return M
def LLV(d, b2, l):
"""
Hodge numbers of an LLV-module for a hyperkähler manifold of dimension d
and second Betti number b2, with highest weight l
"""
n = d / 2
g = ("B" if b2 % 2 == 1 else "D") + str(b2 // 2 + 1)
return hodge_num(d, WeylCharacterRing(g)(l))
def diamond(M):
"""
Print a matrix in diamond form
"""
d = M.ncols() - 1
output = [["" for i in range(2 * d + 1)] for j in range(2 * d + 1)]
for i in range(d + 1):
for j in range(d + 1):
output[i + j][d + j - i] = M[i, j]
print(table(output))
def K3n(n):
"""
LLV decomposition of the cohomology of a hyperkähler of K3^[n] type
"""
R.<q> = QQ["q"]
R = R.quo(R.ideal(q^(n+1))) # truncate the higher degree terms
q = R.gens()[0]
B12 = WeylCharacterRing("B12", R)
b12 = WeightRing(B12)
px = [b12([ 1 if i==j else 0 for i in range(12)]) for j in range(12)]
mx = [b12([-1 if i==j else 0 for i in range(12)]) for j in range(12)]
ch = 1
for xi in px + mx:
for i in range(1, n + 1):
ch *= 1 + sum((xi*q^i)^j for j in range(1, n//i + 1))
ch = B12(ch)
ans = sum(t.coefficients()[0].lift().monomial_coefficient(q.lift()^n) * t.monomials()[0] for t in ch.terms())
# convert coefficients to ZZ
B12 = WeylCharacterRing("B12")
b12 = WeightRing(B12)
return sum(_strip(m) * B12(w) for (w, m) in list(ans))
def J4(n):
return n^4 * prod(1-1/p^4 for p in ZZ(n).prime_divisors())
def Kum(n):
"""
LLV decomposition of the cohomology of a hyperkähler of Kum_n type
"""
n += 1
R.<q> = QQ["q"]
R = R.quo(R.ideal(q^(n+1))) # truncate the higher degree terms
q = R.gens()[0]
B4 = WeylCharacterRing("B4", R)
b4 = WeightRing(B4)
px = [b4([ 1 if i==j else 0 for i in range(4)]) for j in range(4)]
mx = [b4([-1 if i==j else 0 for i in range(4)]) for j in range(4)]
B = 1
for xi in px + mx:
for i in range(1, n + 1):
B *= 1 + sum((xi*q^i)^j for j in range(1, n//i + 1))
half_x = [b4(list(j)) for j in cartesian_product([[-1/2,1/2]] * 4) if sum(j) % 2 == 0]
for xi in half_x:
for i in range(1, n + 1):
B *= 1 + xi*q^i
b = [sum(t.coefficients()[0].lift().monomial_coefficient(q.lift()^k) * t.monomials()[0] for t in B.terms()) for k in range(n+1)]
ch = sum(J4(n/d) * b[d] for d in ZZ(n).divisors())
V = b4.space()
l = [b4([-1]), b4([-1/2,-1/2,-1/2,-1/2]), b4(1)]
ans = 0
while ch != 0:
m = max([t for t in ch.terms() if V(list(t)[0][0]).is_dominant()])
for li in l:
quot = m * li
if quot >= 0:
v, m = list(quot)[0]
quot = m * b4(B4(v))
ans += quot
ch -= quot * b[1]
break
# convert coefficients to ZZ
B4 = WeylCharacterRing("B4")
b4 = WeightRing(B4)
return B4(sum(_strip(m) * b4(w) for (w, m) in list(ans)))
def _strip(x): # conversion to ZZ
try:
return ZZ(x.lift())
except:
return ZZ(x)
# examples
diamond(LLV(4,23,[2])) # dim 4, b2 = 23, weight [2]
print(K3n(2)) # LLV decomposition for K3^[2]
print(Kum(2)) # LLV decomposition for Kum_2
@8d1h
Copy link
Author

8d1h commented Jul 23, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment