I want to know how to compute this function: 

$f : \mathbb{Z}_m \rightarrow \mathbb{N}$

$f(z) = |\{ (x, y) \in \mathbb{Z}_m^2 \mid \langle x, y\rangle = z  \}|$

where $\langle x, y\rangle = \sum_{i \in [m]}x_iy_i$.