{{ message }}

Instantly share code, notes, and snippets.

Pieter Belmans pbelmans

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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 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() # O'Grady 6 values = {c2^3: 30720, c2*c4: 7680, c6: 1920}
Created Nov 30, 2016
View tikz-cd-open-closed.tex
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 \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);}};},
Created Nov 16, 2016
Understanding normalisation and basic properties of weighted projective spaces
View wps.sage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 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)
Created Dec 27, 2015
All genera of complete intersection curves up to a certain cutoff
View genera.sage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 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
Created Oct 30, 2013
Determine which small groups have (in)finite representation type
View finrep.gap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 # TODO write code
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 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
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 # 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
Created Dec 14, 2012
A TeX version of Mumford's treasure map
View gist:4289081
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 \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}
Last active Oct 4, 2015 — forked from kogakure/.gitignore
.gitignore file for LaTeX projects
View .gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
 *.aux *.glo *.idx *.log *.toc *.ist *.acn *.acr *.alg *.bcf