Generalized Weyl–Wigner formalism for the simulation of open quantum devices: a density-matrix approach