on ${{\mathbb T}}^d$ $$\partial_t \rho=\nabla\cdot D\nabla \rho$$ where $\rho$ is a probability density and the diffusion coefficient $D$ is a positive symmetric $d\times d$ matrix. We introduce the currents as vector fields on ${{\mathbb T}}^d$, denoted by $j$. Given $\rho$, we define the associated current $j^\rho:=
-D\nabla\rho$. We can then rewrite the heat equation as $$\label{he0}
 \begin{cases}
 \partial_t\rho+\nabla \cdot j=0\\
 j=j^\rho.
 \end{cases}$$ We shall rewrite this system as a variational inequality that expresses the decrease of the entropy.

Fix $T>0$. On the set of paths $(\rho(t),j(t))$, $t\in [0,T]$, satisfying the continuity equation $\partial_t \rho+\nabla \cdot j=0$ consider the action functional $$I(\rho,j) = \frac 12 \int_0^T\!{\mathop{}\!\mathrm{d}}t \int\! {\mathop{}\!\mathrm{d}}x \frac 1{\rho(t)} 
  \big[ j(t) +D \nabla\rho(t) \big] \cdot D^{-1}
  \big[ j(t) +D \nabla \rho(t) \big],$$ where $\cdot$ denotes the inner product in ${{\mathbb R}}^d$. This functional arises naturally by analyzing the large deviation asymptotics of $N$ independent Brownians [@DG; @KO] and its connection with the gradient flow formulation of the heat equation is discussed in [@ADPZ]. To be precise, the rate function in [@DG; @KO; @ADPZ] does not include the current as a dynamical variable but it can be extended to this case, see [@BDGJL] for a similar functional in the context of 