vector gradient optimization