Find the orthogonal matrix U minimising ‖A − |U|‖_F.
Solves the non-convex problem by repeated random restarts followed by
a sign-variable-exchange local search.
- Parameters:
A (ndarray) – Input square matrix, shape (N, N). Signs are ignored.
max_trials (int) – Number of random sign-pattern restarts.
tolerance (float) – Stop early when the Frobenius error is below this value.
- Return type:
ndarray
- Returns:
Orthogonal matrix of shape (N, N).