1. implement an efficient method for calculating the gradient of the constraints. 2. implement a function to compute the rotation-modal matrix.