The detailed procedure for solving (2) is implemented in the Magnetstein Python package. This optimization problem boils down to a linear program. As already mentioned, the program can be solved separately and independently for every fixed moment t. However at this point, we make use of the knowledge that spectra µ t-1 and µ t , being close in time, are expected to be similar to one another. Linear programs are solved using the simplex algorithm, which can be warm-started, i.e. begin the search for the optimal solution from some pre-defined proposal values, see Supporting Information for details.