Generalized Reduced Gradient Python