# Quantum Synchronization and Entanglement of Dissipative Qubits Coupled to a Resonator
## 2 Model Description
### Numerical Methods  
For convenience, in our study, we use units where \(\hbar=1\) and use the cavity-qubit coupling strength \(\lambda\) as the energy scale in dimensionless quantities. This choice of units is convenient for analyzing RWA validity because only relative energies to the excitation frequency appear in Equation (3) and, thus, energy differences rather than the absolute energy become physically relevant. In general, Equation (7) presents a system of linear equations, with a superoperator acting on the unknown density matrix. If the density matrix has size \(N\times N\), the superoperator will be a matrix of size \(N^{2}\times N^{2}\), and when exploiting its sparse structure of the Hamiltonian \(\hat{H}_{\mathcal{R}}\) and of the dissipative Lindblad terms, finding the solution of Equation (7) becomes numerically prohibitive. Building the sparse superoperator matrix can be numerically demanding in terms of memory. Thus, we used an alternative approach, exploiting as much as possible the similarity between the Lindblad equation and Sylvester equations, which are matrix equations of the following form:  
\[\hat{A}\hat{X}+\hat{X}\hat{B}=\hat{C} \tag{8}\]  
where \(\hat{A},\hat{B},\hat{C}\) are known matrices and \(\hat{X}\) is the unknown matrix to be found. For this class of matrix equations, more efficient solution algorithms are available [40]. In our case, we use the Bartels-Stewart algorithm [40], which has an \(N^{3}\) computation cost, where \(N\times N\) is the size of the density matrix. The general steady-state Lindblad equation is as follows:  
\[\mathcal{L}(\hat{\rho})=-i[\hat{H},\hat{\rho}]+\sum_{k}\left(\hat{L}_{k}\hat{ \rho}\hat{L}_{k}^{+}-\frac{1}{2}\hat{L}_{k}^{+}\hat{L}_{k}\hat{\rho}-\frac{1}{ 2}\hat{\rho}\hat{L}_{k}^{+}\hat{L}_{k}\right)=0 \tag{9}\]  
and is not of the Sylvester type (here, \(\hat{H}\) is the Hamiltonian and \(\hat{L}_{k}\) denotes dissipative operators). So, a direct application of the Bartels-Stewart algorithm is not possible. We, thus, split the Lindblad superoperator into a first term that resembles a Sylvester equation and a remainder, as follows:  
\[\mathcal{L}(\hat{\rho}) = -\mathcal{L}_{0}(\hat{\rho})+\epsilon\mathcal{L}_{1}(\hat{\rho}) \tag{10}\] \[\mathcal{L}_{0}(\hat{\rho}) = i\hat{H}\hat{\rho}+\frac{1}{2}\sum_{k}\hat{L}_{k}^{+}\hat{L}_{k} \hat{\rho}-i\hat{\rho}\hat{H}+\frac{1}{2}\hat{\rho}\sum_{k}\hat{L}_{k}^{+}\hat {L}_{k}\] (11) \[\mathcal{L}_{1}(\hat{\rho}) = \sum_{k}\hat{L}_{k}\hat{\rho}\hat{L}_{k}^{+} \tag{12}\]  
The steady-state density matrix \(\mathcal{L}(\hat{\rho})=0\) will be a fixed point of the following:  
\[\hat{\rho}=\mathcal{L}_{0}^{-1}\mathcal{L}_{1}\hat{\rho} \tag{13}\]  
It is, thus, possible to iterate from an initial guess \(\hat{\rho}_{m}\), solving a series of Sylvester equations, as follows:  
\[\mathcal{L}_{0}\rho_{m+1}=\mathcal{L}_{1}\hat{\rho}_{m} \tag{14}\]  
We have found that, usually, a few (or at most, tens of) iterations are enough to find the fixed point with very high accuracy. The initial guess \(\hat{\rho}_{0}\) for the iteration can be chosen from one of the two approximate methods presented in the following sections; we typically use \(\hat{\rho}_{0}\), which is obtained from the summation of the rate equation perturbation theory. Due to the availability of a good initial \(\hat{\rho}_{0}\) in our simulations, the number of Sylvester equation iterations required for convergence is small. Algorithms for solving generalized forms of the Sylvester equation have also been reported [41]; they can perhaps offer a faster converging iterative solution in cases where a good initial guess is not available. We note that the inverse of \(\mathcal{L}_{0}\) always exists in our system and the used approach allows us to compute it numerically in an efficient way. For the validity of the Sylvester equations, the main assumption is that the RWA steady state is a valid description of the time-averaged state of the exact dynamics.