complex_gen_matrix_cond_log computes an estimate of the relative condition number of the logarithm of a complex matrix , in the -norm. The principal matrix logarithm is also returned.

For full information please refer to the NAG Library document for f01kj

acomplex, array-like, shape

The matrix .

acomplex, ndarray, shape

The principal matrix logarithm, . Alternatively, if = 2, a non-principal logarithm is returned.


With the function exits successfully or = 2 or 3, an estimate of the relative condition number of the matrix logarithm, . Alternatively, if = 4, contains the absolute condition number of the matrix logarithm.

(errno )

On entry, .

Constraint: .

(errno )

is singular so the logarithm cannot be computed.

(errno )

An unexpected internal error occurred. This failure should not occur and suggests that the function has been called incorrectly.

(errno )

has eigenvalues on the negative real line. The principal logarithm is not defined in this case, so a non-principal logarithm was returned.

(errno )

has been computed using an IEEE double precision Padé approximant, although the arithmetic precision is higher than IEEE double precision.

(errno )

The relative condition number is infinite. The absolute condition number was returned instead.


For a matrix with no eigenvalues on the closed negative real line, the principal matrix logarithm is the unique logarithm whose spectrum lies in the strip .

The Fréchet derivative of the matrix logarithm of is the unique linear mapping such that for any matrix

The derivative describes the first order effect of perturbations in on the logarithm .

The relative condition number of the matrix logarithm can be defined by

where is the norm of the Fréchet derivative of the matrix logarithm at .

To obtain the estimate of , complex_gen_matrix_cond_log first estimates by computing an estimate of a quantity , such that .

The algorithms used to compute and are based on a Schur decomposition, the inverse scaling and squaring method and Padé approximants. Further details can be found in Al–Mohy and Higham (2011) and Al–Mohy et al. (2012).

If is nonsingular but has negative real eigenvalues, the principal logarithm is not defined, but complex_gen_matrix_cond_log will return a non-principal logarithm and its condition number.


Al–Mohy, A H and Higham, N J, 2011, Improved inverse scaling and squaring algorithms for the matrix logarithm, SIAM J. Sci. Comput. (34(4)), C152–C169

Al–Mohy, A H, Higham, N J and Relton, S D, 2012, Computing the Fréchet derivative of the matrix logarithm and estimating the condition number, SIAM J. Sci. Comput. (35(4)), C394–C410

Higham, N J, 2008, Functions of Matrices: Theory and Computation, SIAM, Philadelphia, PA, USA