  We track the co-evolution of supermassive black holes (SMBHs) and their host
galaxies. The calculation is embedded in the GALFORM semi-analytical model
which simulates the formation and evolution of galaxies in a cold dark matter
(CDM) universe. During the evolution of the host galaxy, hot and cold gas are
added to the SMBH by flows triggered by halo gas cooling, disc instabilities
and galaxy mergers. This builds up the mass and spin of the BH, and the
resulting accretion power regulates the gas cooling and subsequent star
formation. The accretion flow is assumed to form a geometrically thin cool disc
when the accretion rate exceeds 0.01\dot{M}_Edd, and a geometrically thick,
radiatively inefficient hot flow when the accretion rate falls below this
value. The resulting quasar optical luminosity function matches observations
very well, and the mass of the SMBH correlates with the mass of the galaxy
bulge as observed. The BH spin distribution depends strongly on whether the gas
in any given accretion episode remains in the same plane (prolonged accretion)
or whether, due to self-gravity, it fragments into multiple, randomly aligned
accretion episodes (chaotic accretion). In the chaotic accretion model there is
a clear correlation of spin with SMBH mass. Massive BHs (M>5\times10^8\Msun)
are hosted by giant elliptical galaxies and are rapidly spinning, while lower
mass BHs are hosted in spiral galaxies and have much lower spin. Using the
Blandford-Znajek mechanism for jet production to calculate the jet power, our
model is able to reproduce the radio loudness of radio galaxies, LINERS and
Seyferts. This is the first confirmation that a CDM galaxy formation model can
reproduce the observed phenomenology of AGN.
