In the background of reviewing cavity quantum electrodynamics and circuit quantum electrodynamics, this paper mainly explores a two-coupled cavity system. This system consists of two tunnel-coupled microwave resonators each containing a single superconducting qubit. The initial photon imbalance will cause the photons to oscillate between the two resonators (delocalization). The increase of photon-qubit interaction will cause self-trapped (localized) of the photons. The Schmidt found that two tunnel coupled microwave resonators each containing a JC type nonlinearity undergo simultaneously sharp localization transition of photons and qubits. (Schmidt, 2010) Based on Rabi-dimer model, we use the python library QuTiP to perform numerical simulation of the phase diagram. We also find a way to improve the run time of numerical simulation by exploiting the symmetry of the model such as left-right symmetry or parity symmetry of the total number of excitations in the Rabi-dimer model.