  We study the Hamiltonian lattice Yang-Mills theory based on spin networks
that provide a useful basis to represent the physical states satisfying the
Gauss law constraints. We focus on $\mathrm{SU}(2)$ Yang-Mills theory in
$(2+1)$ dimensions. Following the string-net model, we introduce a
regularization of the Kogut-Susskind Hamiltonian of lattice Yang-Mills theory
based on the $q$ deformation, which respects the (discretized) $\mathrm{SU}(2)$
gauge symmetry as quantum group, i.e., $\mathrm{SU}(2)_k$, and enables
implementation of the lattice Yang-Mills theory both in classical and quantum
algorithms by referring to those of the string-net model. Using the regularized
Hamiltonian, we study quantum scars in a nonabelian gauge theory. Quantum scars
are nonthermal energy eigenstates arising in the constrained quantum many-body
systems. We find that quantum scars from zero modes, which have been found in
abelian gauge theories arise even in a nonabelian gauge theory. We also show
the spectrum of a single-plaquette model for SU(2)$_k$ and SU(3)$_k$ with naive
cutoff and that based on the $q$-deformation to discuss cutoff dependence of
the formulation.
