numpy.einsum simulation in written in Python