  Let $B$ be a ring, not necessarily commutative, having an involution $*$ and
let ${\mathrm U}_{2m}(B)$ be the unitary group of rank $2m$ associated to a
hermitian or skew hermitian form relative to $*$. When $B$ is finite, we
construct a Weil representation of ${\mathrm U}_{2m}(B)$ via Heisenberg groups
and find its explicit matrix form on the Bruhat elements. As a consequence, we
derive information on generalized Gauss sums. On the other hand, there is an
axiomatic method to define a Weil representation of ${\mathrm U}_{2m}(B)$, and
we compare the two Weil representations thus obtained under fairly general
hypotheses. When $B$ is local, not necessarily finite, we compute the index of
the subgroup of ${\mathrm U}_{2m}(B)$ generated by its Bruhat elements. Besides
the independent interest, this subgroup and index are involved in the foregoing
comparison of Weil representations.
