Hi Mathias, I would suggest to do step by step verification. It is common for SCI code to do so. After quick review i found one small bug (but there may be also others): Random gen is not initialized. You may want to use https://github.com/libmir/mir-random as wall as https://github.com/libmir/numir to generate random slices. Mir Random has default contrcuttor disabled for RNGs, so it is safer then Phobos.