Inverse Deformation Problems for Special Linear and Symplectic groups