The random number generator is rarely the limiting factor in computational science. RNGs are usually quite simple and fast, a few dozen instructions, really. If you are doing anything even remotely complicated in your code with these random numbers, then the bottleneck is there.
At the moment, you aren't tracking the number of times a walk reaches zero or even if a walk reaches zero at any point. Your Move function returns the last position of the walk, so you are only checking whether the 1000th step is zero. You should change Move to store the count of how many times that walk reaches zero. You can then determine the mean and ...
You are only moving in one direction for each axis.
coin_x = random.randint(1,2)
# Move on x axis
if coin_x == HEAD:
elif coin_x == TAIL:
# Move on y axis
coin_y = random.randint(1,2)
if coin_y == HEAD:
elif coin_y == TAIL:
I fixed the compilation issues in the Roulattice package you mentioned and it now compiles and seems to do stuff. Most of the issues were easily solvable, though there's an uninitialized memory error that occurs if you don't use the -torsion flag. Run it like below.
./roulattice -tetra_saw1 50 -num 1000 -torsion
The updated repo is available on my Github at:...