__init__.py 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. """
  2. ====================================
  3. Linear algebra (:mod:`scipy.linalg`)
  4. ====================================
  5. .. currentmodule:: scipy.linalg
  6. .. toctree::
  7. :hidden:
  8. linalg.blas
  9. linalg.cython_blas
  10. linalg.cython_lapack
  11. linalg.interpolative
  12. linalg.lapack
  13. Linear algebra functions.
  14. .. eventually, we should replace the numpy.linalg HTML link with just `numpy.linalg`
  15. .. seealso::
  16. `numpy.linalg <https://www.numpy.org/devdocs/reference/routines.linalg.html>`__
  17. for more linear algebra functions. Note that identically named
  18. functions from `scipy.linalg` may offer more or slightly differing
  19. functionality.
  20. Basics
  21. ======
  22. .. autosummary::
  23. :toctree: generated/
  24. inv - Find the inverse of a square matrix
  25. solve - Solve a linear system of equations
  26. solve_banded - Solve a banded linear system
  27. solveh_banded - Solve a Hermitian or symmetric banded system
  28. solve_circulant - Solve a circulant system
  29. solve_triangular - Solve a triangular matrix
  30. solve_toeplitz - Solve a toeplitz matrix
  31. matmul_toeplitz - Multiply a Toeplitz matrix with an array.
  32. det - Find the determinant of a square matrix
  33. norm - Matrix and vector norm
  34. lstsq - Solve a linear least-squares problem
  35. pinv - Pseudo-inverse (Moore-Penrose) using lstsq
  36. pinvh - Pseudo-inverse of hermitian matrix
  37. khatri_rao - Khatri-Rao product of two arrays
  38. orthogonal_procrustes - Solve an orthogonal Procrustes problem
  39. matrix_balance - Balance matrix entries with a similarity transformation
  40. subspace_angles - Compute the subspace angles between two matrices
  41. bandwidth - Return the lower and upper bandwidth of an array
  42. issymmetric - Check if a square 2D array is symmetric
  43. ishermitian - Check if a square 2D array is Hermitian
  44. LinAlgError
  45. LinAlgWarning
  46. Eigenvalue Problems
  47. ===================
  48. .. autosummary::
  49. :toctree: generated/
  50. eig - Find the eigenvalues and eigenvectors of a square matrix
  51. eigvals - Find just the eigenvalues of a square matrix
  52. eigh - Find the e-vals and e-vectors of a Hermitian or symmetric matrix
  53. eigvalsh - Find just the eigenvalues of a Hermitian or symmetric matrix
  54. eig_banded - Find the eigenvalues and eigenvectors of a banded matrix
  55. eigvals_banded - Find just the eigenvalues of a banded matrix
  56. eigh_tridiagonal - Find the eigenvalues and eigenvectors of a tridiagonal matrix
  57. eigvalsh_tridiagonal - Find just the eigenvalues of a tridiagonal matrix
  58. Decompositions
  59. ==============
  60. .. autosummary::
  61. :toctree: generated/
  62. lu - LU decomposition of a matrix
  63. lu_factor - LU decomposition returning unordered matrix and pivots
  64. lu_solve - Solve Ax=b using back substitution with output of lu_factor
  65. svd - Singular value decomposition of a matrix
  66. svdvals - Singular values of a matrix
  67. diagsvd - Construct matrix of singular values from output of svd
  68. orth - Construct orthonormal basis for the range of A using svd
  69. null_space - Construct orthonormal basis for the null space of A using svd
  70. ldl - LDL.T decomposition of a Hermitian or a symmetric matrix.
  71. cholesky - Cholesky decomposition of a matrix
  72. cholesky_banded - Cholesky decomp. of a sym. or Hermitian banded matrix
  73. cho_factor - Cholesky decomposition for use in solving a linear system
  74. cho_solve - Solve previously factored linear system
  75. cho_solve_banded - Solve previously factored banded linear system
  76. polar - Compute the polar decomposition.
  77. qr - QR decomposition of a matrix
  78. qr_multiply - QR decomposition and multiplication by Q
  79. qr_update - Rank k QR update
  80. qr_delete - QR downdate on row or column deletion
  81. qr_insert - QR update on row or column insertion
  82. rq - RQ decomposition of a matrix
  83. qz - QZ decomposition of a pair of matrices
  84. ordqz - QZ decomposition of a pair of matrices with reordering
  85. schur - Schur decomposition of a matrix
  86. rsf2csf - Real to complex Schur form
  87. hessenberg - Hessenberg form of a matrix
  88. cdf2rdf - Complex diagonal form to real diagonal block form
  89. cossin - Cosine sine decomposition of a unitary or orthogonal matrix
  90. .. seealso::
  91. `scipy.linalg.interpolative` -- Interpolative matrix decompositions
  92. Matrix Functions
  93. ================
  94. .. autosummary::
  95. :toctree: generated/
  96. expm - Matrix exponential
  97. logm - Matrix logarithm
  98. cosm - Matrix cosine
  99. sinm - Matrix sine
  100. tanm - Matrix tangent
  101. coshm - Matrix hyperbolic cosine
  102. sinhm - Matrix hyperbolic sine
  103. tanhm - Matrix hyperbolic tangent
  104. signm - Matrix sign
  105. sqrtm - Matrix square root
  106. funm - Evaluating an arbitrary matrix function
  107. expm_frechet - Frechet derivative of the matrix exponential
  108. expm_cond - Relative condition number of expm in the Frobenius norm
  109. fractional_matrix_power - Fractional matrix power
  110. Matrix Equation Solvers
  111. =======================
  112. .. autosummary::
  113. :toctree: generated/
  114. solve_sylvester - Solve the Sylvester matrix equation
  115. solve_continuous_are - Solve the continuous-time algebraic Riccati equation
  116. solve_discrete_are - Solve the discrete-time algebraic Riccati equation
  117. solve_continuous_lyapunov - Solve the continuous-time Lyapunov equation
  118. solve_discrete_lyapunov - Solve the discrete-time Lyapunov equation
  119. Sketches and Random Projections
  120. ===============================
  121. .. autosummary::
  122. :toctree: generated/
  123. clarkson_woodruff_transform - Applies the Clarkson Woodruff Sketch (a.k.a CountMin Sketch)
  124. Special Matrices
  125. ================
  126. .. autosummary::
  127. :toctree: generated/
  128. block_diag - Construct a block diagonal matrix from submatrices
  129. circulant - Circulant matrix
  130. companion - Companion matrix
  131. convolution_matrix - Convolution matrix
  132. dft - Discrete Fourier transform matrix
  133. fiedler - Fiedler matrix
  134. fiedler_companion - Fiedler companion matrix
  135. hadamard - Hadamard matrix of order 2**n
  136. hankel - Hankel matrix
  137. helmert - Helmert matrix
  138. hilbert - Hilbert matrix
  139. invhilbert - Inverse Hilbert matrix
  140. leslie - Leslie matrix
  141. pascal - Pascal matrix
  142. invpascal - Inverse Pascal matrix
  143. toeplitz - Toeplitz matrix
  144. Low-level routines
  145. ==================
  146. .. autosummary::
  147. :toctree: generated/
  148. get_blas_funcs
  149. get_lapack_funcs
  150. find_best_blas_type
  151. .. seealso::
  152. `scipy.linalg.blas` -- Low-level BLAS functions
  153. `scipy.linalg.lapack` -- Low-level LAPACK functions
  154. `scipy.linalg.cython_blas` -- Low-level BLAS functions for Cython
  155. `scipy.linalg.cython_lapack` -- Low-level LAPACK functions for Cython
  156. """ # noqa: E501
  157. from ._misc import *
  158. from ._cythonized_array_utils import *
  159. from ._basic import *
  160. from ._decomp import *
  161. from ._decomp_lu import *
  162. from ._decomp_ldl import *
  163. from ._decomp_cholesky import *
  164. from ._decomp_qr import *
  165. from ._decomp_qz import *
  166. from ._decomp_svd import *
  167. from ._decomp_schur import *
  168. from ._decomp_polar import *
  169. from ._matfuncs import *
  170. from .blas import *
  171. from .lapack import *
  172. from ._special_matrices import *
  173. from ._solvers import *
  174. from ._procrustes import *
  175. from ._decomp_update import *
  176. from ._sketches import *
  177. from ._decomp_cossin import *
  178. # Deprecated namespaces, to be removed in v2.0.0
  179. from . import (
  180. decomp, decomp_cholesky, decomp_lu, decomp_qr, decomp_svd, decomp_schur,
  181. basic, misc, special_matrices, matfuncs,
  182. )
  183. __all__ = [s for s in dir() if not s.startswith('_')]
  184. from scipy._lib._testutils import PytestTester
  185. test = PytestTester(__name__)
  186. del PytestTester