  We compute the Adler function on the lattice from vacuum polarization data
with twisted boundary conditions using numerical derivatives. The study is
based on CLS ensembles with two flavours of $O(a)$ improved Wilson fermions. We
extrapolate the lattice data for the Adler function to the continuum limit and
to the physical pion mass and analyze its dependence on the momentum transfer.
We discuss the application of this method to the extraction of the $u,d$
contribution to $a_\mu^{\mathrm{HLO}}$.
