By taking variations carefully, see again [1]}, we directly obtain a relationship
between the momentum variable \(\mathbf {p}\)  and the template variable \(\mathbf {z}\)  as
\(\mathbf {m}(x) = \frac{1}{\sigma ^2} \sum _{i=1}^M z_t^i\delta (x-q_i)\qquad \Rightarrow \qquad \mathbf {z} = \sigma ^2 \mathbf {p}_i\, ,\) 
