We present a formalism to quantize a general superconducting circuit with Josephson junctions. The formalism is amenable to an algorithmic implementation and we present an extension Circuit to the scqubits package which deals with a generic superconducting circuit. This algorithm is able to identify all the degrees of freedom and their boundary conditions. Moreover, the non dynamical degrees of freedom, free and frozen, are identified and eliminated to reduce the dimension of the effective Hilbert space. We also implement Hiherarchical diagonalization in the Circuit module which allows one to numerically analyze larger circuits. The theory presented in this paper allows one to intuitively understand the different types of degrees of freedom present in a circuit and quickly transform to these new variables.
The paper can be found here.