pygsti.tools.matrixtools.matrix_sign

Contents

pygsti.tools.matrixtools.matrix_sign#

matrix_sign(m)#

Compute the matrix s = sign(m). The eigenvectors of s are the same as those of m. The eigenvalues of s are +/- 1, corresponding to the signs of m’s eigenvalues.

It’s straightforward to compute s when m is a normal operator. If m is not normal, then the definition of s can be given in terms of m’s Jordan form, and s can be computed by (suitably post-processing) the Schur decomposition of m.

See https://nhigham.com/2020/12/15/what-is-the-matrix-sign-function/ for background.

Parameters:

m (numpy.ndarray) – the matrix.

Return type:

numpy.ndarray