Dirichlet form of a Markov chain (source code)

= Dirichlet form of a Markov chain
{title2=$\mathcal E(f,g)$}
{wiki=Dirichlet_form}

For a reversible transition matrix $P$ with invariant distribution $\pi$,
$$
\mathcal E(f,g)=\frac12\sum_{x,y}\pi(x)P(x,y)
(f(x)-f(y))(g(x)-g(y)).
$$