# The "Algorithm" for Derivation of the Master Equation

I'm trying to come up with a master equation for a spin system. So, I'm trying to understand in general how can we derive the master equation and the Lindblad operators if we know the system, bath and the interaction Hamiltonians. I have read the course-graining derivation and microscopic derivation of the master equation from the Hamiltonian in Petruccione's book. I understand to a certain extent how the whole process works but when I'm trying to figure out the master equation for a specific problem I don't even know how to begin.

For example in the article titled Quantum Optical Two-Atom Thermal Diode we have two qubits (left and right) which are interacting with each other and each of the qubits is connected to a separate thermal bath. The left and right qubits are coupled to thermal baths with temperature $$T_L$$ and $$T_R$$ respectively. The Hamiltonian for the system is:

$$\hat{H} = \frac{\omega_L}{2}\sigma_L^z + \frac{\omega_R}{2}\sigma_R^z + g\sigma_L^z\sigma_R^x$$

In which $$\omega$$ are the transition frequencies and $$\sigma$$ are the Pauli matrices. System bath interaction for the left qubit is:

$$H_{int}^L = \sigma_L^x \otimes \sum_k (a_k^L + a_k^{L\dagger})$$

System bath interaction for the right qubit is:

$$H_{int}^R = \sigma_R^x \otimes \sum_k (a_k^R + a_k^{R\dagger})$$

in which $$a_k^L$$ and $$a_k^R$$ are the annihilation operators for the $$kth$$ mode of the left and right bath. The authors start the derivation of the master equation by diagonalizing the system Hamiltonian using the following operator:

$$U:=exp(-i\frac{\theta}{2}\sigma_L^z\sigma_R^y)$$

My first question is:

Why do we need diagonalization? I have not had a course in open quantum systems and quantum optics so this question might sound stupid but I want to know why. In the derivation of the master equation using the Hamiltonian in Petruccione's book there is no mention of this diagonalization process (at least not explicitly) so I want to know the justification for it.

Moving on, the authors apply the transformation $$U$$ on the Hamiltonian and move into the interaction picture (equations A13 and A14 of the article) and immediately claim that the master equation is given by:

$$\dot{\rho} = \hat{\mathcal{L}}_{LL} + \hat{\mathcal{L}}_{RR}$$

Which is equation 3 in the article. I don't know how they reached to this conclusion taking the mentioned steps so I would appreciate if anyone cared to explain why and how.

This was an specific example. In general my question is given that we have the total Hamiltonian which is divided into system, environment and the interaction parts:

$$H_{tot} = H_{sys} + H_{env} + H_{int}$$

And assuming that we want to derive a Lindblad type master equation, what is the step by step "algorithm" to derive the Lamb-shifted system hamiltonian and the jump operators (and hence the master equation) using the given hamiltonian?