If this is only used in `EntropyMinimizationDiscrtizer`, let's move it there and mark it private.