We will present a general mechanism for constructing gradient vector fields on regular submanifolds. This construction is related to the double bracket vector fields on semisimple Lie algebras. We will apply this geometrical setting to embedding problems in optimization algorithms.