Skip to content

Instantly share code, notes, and snippets.

@8d1h
8d1h / LLV_decomposition.sage
Created Jul 23, 2021
LLV decomposition of hyperkähler cohomology in Sage
View LLV_decomposition.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
@8d1h
8d1h / chern_numbers.sage
Last active Aug 28, 2021
Chern numbers of K3^[n] in Sage
View chern_numbers.sage
NTHREADS = 8 # use this to specify the number of threads
class TnVariety:
"""
A variety with a torus action for computing with Bott's formula
"""
def __init__(self, n, points, weight):
self.n = n
self.points = points
self.weight = weight