Skip to content


Folders and files

Last commit message
Last commit date

Latest commit


Repository files navigation

DOI releases license

tests code style: black

Hodge diamond cutter

A collection of Python classes and functions in Sage to deal with Hodge diamonds (and Hochschild homology) of smooth projective varieties, together with many constructions.

You can read its documentation as

Getting started

It suffices to put diamond/ in your directory and load it using load("") in Sage to get started.

Alternatively you can install it as follows:

sage --pip install git+

and then you can use

from diamond import *

to use it.

The documentation with lots of examples can be read online or as a pdf.

How to cite

If you have used this code in any way (including the interactive versions on my blog), please consider citing it as explained on Zenodo. You can choose to cite a specific version, or always the latest version. For the latter you can use doi:10.5281/zenodo.3893509.

The following BibTeX entry is a good starting point:

  author = {Belmans, Pieter},
  title = {Hodge diamond cutter},
  url = {},
  doi = {10.5281/zenodo.3893509},

which leads to something like

Pieter Belmans. Hodge diamond cutter. doi:10.5281/zenodo.3893509. url:


Please feel free to make suggestions for more examples of Hodge diamonds. Preferably with a link to a closed formula, generating series or method of computation.

Feature requests are also very welcome.

A warning

In the words of Simon Pepin Lehalleur on Twitter, in order to use the Hodge diamond cutter, you must always answer the question

You are solving a PDE; do you want to proceed?


Instructions to myself

To build the documentation:

sage -sh -c "make html"
cp -r _build/html/ docs
sage -sh -c "make latexpdf"
cp _build/latex/hodgediamondcutter.pdf docs

To perform the unit tests:

sage -t diamond/

And suggestions on improving the documentation are also welcome.


Compute and manipulate Hodge diamonds for many classes of smooth projective varieties







No packages published