  We solve the problem of an interacting quantum dot embedded in a Josephson
junction between two superconductors with finite charging energy described by
the transmon (Cooper pair box) Hamiltonian. The approach is based on the
flat-band approximation of the Richardson model, which reduces the Hilbert
space to the point where exact diagonalisation is possible while retaining all
states that are necessary to describe the low energy phenomena. The presented
method accounts for the physics of the quantum dot, the Josephson effect and
the Coulomb repulsion (charging energy) at the same level. In particular, it
captures the quantum fluctuations of the superconducting phase as well as the
coupling between the superconducting phase and the quantum dot (spin) degrees
of freedom. The method can be directly applied for modelling Andreev spin
qubits embedded in transmon circuits in all parameter regimes, for describing
time-dependent processes, and for the calculation of transition matrix elements
for microwave-driven transmon, spin-flip and mixed transitions that involve
coupling to charge or current degree of freedom.
