While the Pauli-$Z$ matrix is a 2 x 2 matrix, there are more basis states that need to be considered, namely the *vacuum*. The atomic basis states are $\left|0\right>$ and $\left|1\right>$, representing the number of excitations in the atom (as it's only a two-level atom, there can't be more than 1 excitation) and this is what $Z$ acts on. Similarly, the number of excitations (i.e. photons) in the field forms another basis, denoted by $\left|N\right>$.

However, we're *only* considering a cavity with a total of number of photons $\leq 1$, so the possible bases are, ordering the Hilbert space by $\mathcal H_{\text{photons}}\otimes\mathcal H_{\text{atom}}$, $\left|00\right>, \,\left|10\right>$ and $\left|01\right>$, as all the other possible states have $> 1$ photon.

The easiest way to go about figuring out what the Hamiltonian on this system looks like is to look at what each operator does to each state, where $N=aa^\dagger$ is ignored.

That is, $Z$ acts on the 'atomic' Hilbert space as $\delta Z\left|0\right> = \delta\left|0\right>$ and $\delta Z\left|1\right> = -\delta\left|1\right>$, $\sigma_+$ acts on the same space as $\sigma_+\left|0\right> = \left|1\right>$ and $\sigma_+\left|1\right> = 0$ and $\sigma_-$ acts as $\sigma_-\left|1\right> = \left|0\right>$ and $\sigma_-\left|0\right> = 0$. Similarly, on the photonic Hilbert space, $a\left|0\right> = 0$, $a\left|1\right> = \left|0\right>$, $a^\dagger\left|0\right> = \left|1\right>$ and $a^\dagger\left|1\right> = \sqrt{2}\left|2\right>$.

As a result, the term involving $g$ acts on the combined system as:
$$\begin{align*}g\left(a^\dagger\sigma_- + a\sigma_+\right)\left|00\right> &= 0\\
g\left(a^\dagger\sigma_- + a\sigma_+\right)\left|10\right> &= g\left|01\right>\\
g\left(a^\dagger\sigma_- + a\sigma_+\right)\left|01\right> &= g\left|10\right>\end{align*}$$ and the $\delta Z$ term similarly gives $$\begin{align*}\delta Z\left|00\right>&=\delta\left|00\right>\\\delta Z\left|10\right>&=\delta\left|10\right>\\\delta Z\left|01\right>&=-\delta\left|01\right>\end{align*}.$$

Writing this in matrix form with the basis $\left|00\right>, \,\left|10\right>$ and $\left|01\right>$ as above gives equation 7.76 as expected: $$H = \begin{bmatrix}\delta&0&0\\0&\delta&g\\0&g&-\delta\end{bmatrix}.$$

It does appear that I'm out in what I get for $H$ by a minus sign, but looking at equation 7.77, which has $U=e^{-iHt} = e^{-i\delta t}\left|00\rangle\langle00\right|+...$ suggests that this is presumably a typo (in my version, anyway), unless there's something I'm missing.

Thanks a lot for the detailed answer. In my copy too the first delta has a negative sign. – Bashir – 2019-07-03T23:35:34.567