Add shared.realize(rng) method to C++
Add shared.realize() method to python