Maximizing a function F(U), where U is a semi-orthogonal matrix and the function is invariant under an orthogonal transformation of U. An explicit expression of the gradient is not required and the hessian is not used. It includes a global search option using simulated annealing.