In this note, we present an efficient algorithm to sample directly the self-energy in the framework of the Connected Determinant technique. The introduction of the formalism of many-variable formal power series is essential to the proof, and more generally it is a natural mathematical tool for diagrammatic expansions.