  We study unitary representations associated to cocycles of measurable
dynamical systems. Our main result establishes conditions on a cocycle,
ensuring that ergodicity of the dynamical system under consideration is
equivalent to irreducibility of its corresponding unitary representation. This
general result is applied to some representations of finite-dimensional
nilpotent Lie groups and to some representations of infinite-dimensional
Heisenberg groups.
