  For a group $G$, we denote by $m_{faithful}(G)$, the smallest dimension of a
faithful complex representation of $G$. Let $F$ be a non-Archimedean local
field with the ring of integers $\mathcal{O}$ and the maximal ideal
$\mathfrak{p}$.
  In this paper, we compute the precise value of $m_{faithful}(G)$ when $G$ is
the Heisenberg group over $\mathcal{O}/\mathfrak{p}^n$. We then use the Weil
representation to compute the minimal dimension of faithful representations of
the group of unitriangular matrices over $\mathcal{O}/\mathfrak{p}^n$ and many
of its subgroups. By a theorem of Karpenko and Merkurjev, our result yields the
precise value of the essential dimension of the latter finite groups.
