Dipole matrix element in Jaynes Cummings model In Jaynes-Cummings model, atom (two-level system, b) to photon (single radiation mode, a) coupling strength $g$ is written in terms of dipole matrix element $\mathbf{d}_{ba}$, 
$$ \mathbf{d}_{ba} = q \langle b| \mathbf{r} | a\rangle .$$
In all books left as $\mathbf{d}_{ba}$ only. How does one evaluate this matrix element explicitly? 
 A: You don't - you just assume it's there, and that it has a nonzero value, as a starting point for the model. It is simply one of the fundamental parameters of the system as far as the Jaynes-Cummings 'layer' is concerned, every bit as much of a tweakable parameter as the atomic and bosonic frequencies $\omega_0$ and $\omega$.
If you actually want to find the value of the transition dipole matrix element, then you first need to specify what implementation you're looking at  and there is a wide variety of different possible implementations of the model, from atoms in cavities to trapped ions to spins to superconducting circuits. In each of those cases, you start with the full-blown description of the system, and you find regimes (often at great cost in time and research and engineering) in which most of the complexity can be ignored and the only effective terms left are, to a good approximation, the ones in the Jaynes-Cummings hamiltonian. 
Once you've done that, the value of the transition dipole matrix element will fall out as part of the larger quantum mechanical analysis of the full system, without all the approximations, and you can use this value in understanding how the Jaynes-Cummings dynamics will look like on that system. But, since that value is external to those dynamics, you can't calculate it within the model.
A: I think you must be confused with the notation. The total state of the system is a tensor product between an atomic state and the state of the quantized electromagnetic field, for examples $|b\rangle \otimes |n\rangle$, where $b$ is the atomic state and $n$ photons in the field. The vector $\hat{r}$ acts only in the atomic part. In this form, $q \langle b|\hat{r}|a\rangle$ represents the dipole moment of the atom. This quantity only has to do with the degrees of freedom of the atom and not with the field.
A: The quantum harmonic oscillator has lowering and raising operators
$$
a~=~\sqrt{\frac{m\omega}{2\hbar}}\left(\hat x~+~\frac{i}{m\omega}\hat p\right)~a^\dagger~=~\sqrt{\frac{m\omega}{2\hbar}}\left(\hat x~-~\frac{i}{m\omega}\hat p\right)
$$
which leads to the position operator
$$
\frac{\hbar}{2m\omega}\left(a~+~a^\dagger\right).
$$
The lowering and raising operators act on the state $|n\rangle$ as $a|n\rangle~=~\sqrt{n}|n-1\rangle$ and $a|n\rangle~=~\sqrt{n+1}|n+1\rangle$. You can then see that the position operator is evaluated as according to matrix elements $\langle n|\hat x|n+1\rangle$ and $\langle n+1|\hat x|n\rangle$. I leave the rest of a derivation to the reader.
This could be applied to a harmonic oscillator model of the atom. The Jaynes-Cummings model usually involves a two state atom. The model involves a specific energy of the photon dressed to match the energy gap between two atomic energy levels. The dipole operator ${\cal P}~=~q\hat x$ is written in a vector form with the Pauli matrices $\sigma_{\pm}$. It is therefore ${\cal P}~=~q(\sigma_+~+~\sigma_-)$. For the atomic states $|+\rangle,~-\rangle$ the matrices are identified with $\sigma_+~=~|+\rangle\langle -|$ and $\sigma_-~=~|-\rangle\langle +|$, The energy gap between the two states is given by the operator $\hat H~=~\frac{1}{2}\hbar\omega\sigma_z$ where $\sigma_z~=$ $|+\rangle\langle -|~-~|-\rangle\langle+|$. The reader is left to verify the equivalency between these operators and the Pauli matrices.
The photon state is governed by the harmonic oscillator states above. The dipole of the atom couples to the photons through  $H_{int}~=~\vec {\cal P}\cdot\vec A$ The electromagnetic vector potential is written according to the $a$ and $a^\dagger$ according to the momentum vector,
$$
\hat p~=~i\sqrt{\frac{m\omega}{2}}\left(a^\dagger~-~a\right),
$$
and the identification $\hat p~\rightarrow~\vec A$. The product the reader can show leads to $\sigma_+ a$ and $\sigma_-a^\dagger$ these are the rotating wave terms corresponding to the absorption or emission of a photon with the respective raising and lowering of the atomic state. There are in addition the counter rotating terms $\sigma_- a$ and $\sigma_+a^\dagger$ that are analogous to elements of a squeezed state operator.
