update gradients for F/M instead of T/Q