  This paper is part of an effort to gain further understanding of 2D
Logarithmic Conformal Field Theories (LCFTs) by exploring their lattice
regularizations. While all work so far has dealt with the Virasoro algebra (or
the product of left and right Virasoro), the best known (although maybe not the
most relevant physically) LCFTs in the continuum are characterized by a
W-algebra symmetry, whose presence is powerful, but difficult to understand
physically. We explore here the origin of this symmetry in the underlying
lattice models. We consider U_q sl(2) XXZ spin chains for q a root of unity,
and argue that the centralizer of the "small" quantum group goes over the
W-algebra in the continuum limit. We justify this identification by
representation theoretic arguments, and give, in particular, lattice versions
of the W-algebra generators. In the case q=i, which corresponds to symplectic
fermions at central charge c=-2, we provide a full analysis of the scaling
limit of the lattice Virasoro and W generators, and show in details how the
corresponding continuum Virasoro and W-algebras are obtained. Striking
similarities between the lattice W algebra and the Onsager algebra are observed
in this case.
