  In differential measurements at a hadron collider, collinear initial-state
radiation is described by process-independent beam functions. They are the
field-theoretic analog of initial-state parton showers. Depending on the
measured observable they are differential in the virtuality and/or transverse
momentum of the colliding partons in addition to the usual longitudinal
momentum fraction. Perturbatively, the beam functions can be calculated by
matching them onto standard quark and gluon parton distribution functions. We
calculate the inclusive virtuality-dependent quark beam function at NNLO, which
is relevant for any observables probing the virtuality of the incoming partons,
including N-jettiness and beam thrust. For such observables, our results are an
important ingredient in the resummation of large logarithms at N3LL order, and
provide all contributions enhanced by collinear t-channel singularities at NNLO
for quark-initiated processes in analytic form. We perform the calculation in
both Feynman and axial gauge and use two different methods to evaluate the
discontinuity of the two-loop Feynman diagrams, providing nontrivial checks of
the calculation. As part of our results we reproduce the known two-loop QCD
splitting functions and confirm at two loops that the virtuality-dependent beam
and final-state jet functions have the same anomalous dimension.
