function sigma = gaussseideltheor(A)
% GAUSSSEIDELTHEOR theoretical convergence rate for gauss-seidel iterations
    [n, ~] = size(A);
    LD = tril(A);  % lower triangular part including the main diagonal
    U = triu(A, 1);% upper triangular part excluding the main diagonal
    T = -inv(LD)*U;
    lmax = abs(eigs(T, 1));
    sigma = 2*log(lmax);
end
