where x i represents the position of atom i. When using constraints, it is necessary to first project out the components of the gradient in the constraint subspace. This is accomplished by projecting the gradient in the unconstrained space g back to Cartesian coordinates, dE dx proj = J T Qg. (37)