# Computation of the heat kernel from Brownian motion

This question is rather simple but I have some difficulties to find code. Let us suppose that I wrote a routine, in a given language, that computes the evolution of a particle doing Brownian motion in one dimension. Given all the steps, how should I write an algorithm to derive the heat kernel from them?

Some good references are fine as an answer.

You're interested in the solution $u(x,t)$ of the heat equation subject to some boundary conditions and an initial condition $u(x,0)=\delta(x-x_{0})$. You can approximate this at times $t_{1}$, $t_{2}$, $\ldots$, $t_{n}$ by simulating the diffusion of a bunch of particles from $x_{0}$ and constructing histograms of the particle distributions at times $t_{1}$, $t_{2}$, $\ldots$, $t_{n}$.