Skip to content

Instantly share code, notes, and snippets.

Avatar

Pieter Belmans pbelmans

View GitHub Profile
@pbelmans
pbelmans / integral-todd-root-hyperkahler-using-chow.sage
Last active Dec 20, 2021
Sage code to compute the integral of the square root of the Todd class on a hyperkähler variety
View integral-todd-root-hyperkahler-using-chow.sage
from sage.schemes.chow.all import *
# dimension 6
X = ChowScheme(6, ["c2", "c4", "c6"], [2, 4, 6])
X.chowring().inject_variables()
td = Sheaf(X, 6, 1 + sum(X.gens())).todd_class()
integrand = (td._logg()/2)._expp().by_degrees()[6]
# O'Grady 6
values = {c2^3: 30720, c2*c4: 7680, c6: 1920}
View tikz-cd-open-closed.tex
\documentclass[12pt]{standalone}
\usepackage{tikz-cd}
\usetikzlibrary{decorations.markings}
\makeatletter
\tikzcdset{
open/.code={\tikzcdset{hook, circled};},
closed/.code={\tikzcdset{hook, slashed};},
open'/.code={\tikzcdset{hook', circled};},
closed'/.code={\tikzcdset{hook', slashed};},
circled/.code={\tikzcdset{markwith={\draw (0,0) circle (.375ex);}};},
@pbelmans
pbelmans / wps.sage
Created Nov 16, 2016
Understanding normalisation and basic properties of weighted projective spaces
View wps.sage
import itertools
def reduce(Q):
return tuple([qi / gcd(Q) for qi in Q])
def normalise(Q):
Q = reduce(Q)
D = [gcd(Q[:i] + Q[i+1:]) for i in range(len(Q))]
A = [lcm(D[:i] + D[i+1:]) for i in range(len(Q))]
a = lcm(A)
@pbelmans
pbelmans / genera.sage
Created Dec 27, 2015
All genera of complete intersection curves up to a certain cutoff
View genera.sage
def genus(degrees):
n = len(degrees) + 1
return 1 + 1 / 2 * prod(degrees) * (sum(degrees) - n - 1)
"""
Generate a list of all genera of complete intersection curves up to a cutoff
Observe that the genus strictly increases if we increase the degree of a
defining equation, while adding a hyperplane section keeps the degree fixed.
So we can obtain all low genera starting from the line in P^2, and increasing
@pbelmans
pbelmans / finrep.gap
Created Oct 30, 2013
Determine which small groups have (in)finite representation type
View finrep.gap
# TODO write code
@pbelmans
pbelmans / cartan.py
Created Aug 29, 2013
Determining the structure of the Schofield resolution of a preprojective algebra. Nothing interesting happens, just extracting information from the Cartan matrix.
View cartan.py
def mA(n):
if n % 2 == 1: return (n - 1) / 2
else: return (n - 2) / 2
def mD(n):
if n % 2 == 1: return (n - 3) / 2
else: return (n - 2) / 2
def u(n):
if n % 2 == 1: return mD(n) + 1
@pbelmans
pbelmans / quiver-grassmannian.py
Last active Dec 17, 2015
An implementation in SAGE of the construction given in http://arxiv.org/abs/1204.5730. Hence it is possible to determine the configuration of the quiver and the representation required to represent the projective variety as a quiver Grassmannian
View quiver-grassmannian.py
# determine the linear equation of a hypersurface under the d-uple embedding
def getLinearEquation(equation):
d = equation.degree()
monomials = getMonomials(equation.parent(), d)
coefficients = [equation.monomial_coefficient(monomial) for monomial in monomials]
ring = PolynomialRing(QQ, 'x', len(coefficients))
return sum(c * x for c, x in zip(coefficients, ring.gens()))
# determine the maximum degree of a list of (homogeneous) equations
@pbelmans
pbelmans / gist:4289081
Created Dec 14, 2012
A TeX version of Mumford's treasure map
View gist:4289081
\documentclass[10pt,a4paper,landscape]{article}
\usepackage[T1]{fontenc}
\usepackage{amsmath, amsfonts}
\usepackage[charter]{mathdesign}
\usepackage[scaled]{beramono,berasans}
\usepackage{ifthen}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing, arrows}
\begin{document}
@pbelmans
pbelmans / .gitignore
Last active Oct 4, 2015 — forked from kogakure/.gitignore
.gitignore file for LaTeX projects
View .gitignore
*.aux
*.glo
*.idx
*.log
*.toc
*.ist
*.acn
*.acr
*.alg
*.bcf