Skip to main content
`Ctrl`+`K`
scipy.linalg.

# signm

scipy.linalg.signm(A, disp=<object object>)

  Matrix sign function.

  Extension of the scalar sign(x) to matrices.

  The documentation is written assuming array arguments are of specified “core” shapes. However, array argument(s) of this function may have additional “batch” dimensions prepended to the core shape. In this case, the array is treated as a batch of lower-dimensional slices; see Batched Linear Operations for details.

  Parameters:
    A(N, N) array_like

      Matrix at which to evaluate the sign function

    dispbool, optional

      Print warning if error in the result is estimated large instead of returning estimated error. (Default: True)

      Deprecated since version 1.16.0: The disp argument is deprecated and will be removed in SciPy 1.18.0. The previously returned error estimate can be computed as `norm(signm @ signm - signm, 1)`.

  Returns:
    signm(N, N) ndarray

      Value of the sign function at A

    errestfloat

      (if disp == False)

      1-norm of the estimated error, ||err||_1 / ||A||_1

  Examples

      >>> from scipy.linalg import signm, eigvals
      >>> a = [[1,2,3], [1,2,1], [1,1,1]]
      >>> eigvals(a)
      array([ 4.12488542+0.j, -0.76155718+0.j,  0.63667176+0.j])
      >>> eigvals(signm(a))
      array([-1.+0.j,  1.+0.j,  1.+0.j])