Diffusion and flow matching are the standard ways for generating images, video, speech, music and even protein structures and molecular simulations. The application to science, in particular to molecular design, is fascinating because it is a powerful tool to design materials for energy storage, carbon capture, and semiconductor design, as cusp.ai has been championing.

This tutorial presents a derivation from first principles of all the main ideas, it includes a python notebook for people to learn by interacting, and finally I am making the latex source, with all images as tikz code, available in the hope that it is translated to all major languages to make this material accessible.