diffusion-notes: code for quadratic identities