Skip to content

Instantly share code, notes, and snippets.

@pbelmans
pbelmans / .gitignore
Last active October 4, 2015 00:58 — forked from kogakure/.gitignore
.gitignore file for LaTeX projects
*.aux
*.glo
*.idx
*.log
*.toc
*.ist
*.acn
*.acr
*.alg
*.bcf
@pbelmans
pbelmans / gist:4289081
Created December 14, 2012 22:05
A TeX version of Mumford's treasure map
\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 / quiver-grassmannian.py
Last active December 17, 2015 17:28
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
# 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 / cartan.py
Created August 29, 2013 16:01
Determining the structure of the Schofield resolution of a preprojective algebra. Nothing interesting happens, just extracting information from the Cartan matrix.
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 / finrep.gap
Created October 30, 2013 06:59
Determine which small groups have (in)finite representation type
# TODO write code
@pbelmans
pbelmans / genera.sage
Created December 27, 2015 10:13
All genera of complete intersection curves up to a certain cutoff
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 / wps.sage
Created November 16, 2016 16:07
Understanding normalisation and basic properties of weighted projective spaces
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)
\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 / integral-todd-root-hyperkahler-using-chow.sage
Last active December 20, 2021 02:46
Sage code to compute the integral of the square root of the Todd class on a hyperkähler variety
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}