Solution (source code)

= Solution

Strictly, the normalized functions form the unit sphere rather than a vector space; let $V=L^2(\mathbb R)$ and restrict to normalized states when interpreting wavefunctions. The group law gives
$$
D(q,r,s)D(q',r',s')\psi(x)
=e^{-i(s+s'+qr')}e^{i(r+r')x}\psi(x-q-q')
=D(gg')\psi(x).
$$
Translation preserves Lebesgue measure and both exponential factors have unit modulus, so $D(g)$ preserves the inner product and is a <unitary representation>. This is the <Schrödinger representation of the Heisenberg group>: $q$ translates position, $r$ translates momentum, and $s$ contributes the physically irrelevant overall phase.