Source: https://www.math.u-bordeaux.fr/~rcoulang/master/corrdm2.pdf