  We address the calculation of dynamical correlation functions for many
fermion systems at zero temperature, using the auxiliary-field quantum Monte
Carlo method. The two-dimensional Hubbard hamiltonian is used as a model
system. Although most of the calculations performed here are for cases where
the sign problem is absent, the discussions are kept general for applications
to physical problems when the sign problem does arise. We study the use of
twisted boundary conditions to improve the extrapolation of the results to the
thermodynamic limit. A strategy is proposed to drastically reduce finite size
effects relying on a minimization among the twist angles. This approach is
demonstrated by computing the charge gap at half-filling. We obtain accurate
results showing the scaling of the gap with the interaction strength $U$,
connecting to the scaling of the unrestricted Hartree-Fock method at small $U$
and Bethe Ansatz exact result in one dimension at large $U$. A new algorithm is
then proposed to compute dynamical Green functions and correlation functions
which explicitly varies the number of particles during the random walks in the
manifold of Slater determinants. In dilute systems, such as ultracold Fermi
gases, this algorithm enables calculations with much more favorable complexity,
with computational cost proportional to basis size or the number of lattice
sites.
