You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/stdlib/linalg.rst
+32-4Lines changed: 32 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -638,17 +638,45 @@ Linear algebra functions in Julia are largely implemented by calling functions f
638
638
639
639
.. function:: expm(A)
640
640
641
-
Compute the matrix exponential of ``A``.
641
+
Compute the matrix exponential of ``A``, defined by
642
+
643
+
.. math::
644
+
645
+
e^A = \sum_{n=0}^{\inf} \dfrac{A^n}{n!}.
646
+
647
+
For symmetric or Hermitian ``A``, an eigendecomposition (:func:`eigfact`) is used, otherwise the scaling and squaring algorithm (see [H05]_) is chosen.
648
+
649
+
.. [H05] Nicholas J. Higham, "The squaring and scaling method for the matrix
650
+
exponential revisited", SIAM Journal on Matrix Analysis and Applications,
If ``A`` has no negative real eigenvalue, compute the principal matrix logarithm of ``A``, i.e. the unique matrix :math:`X` such that :math:`e^X = A` and :math:`-\pi < Im(\lambda) < \pi` for all the eigenvalues :math:`\lambda` of :math:`X`. If ``A`` has nonpositive eigenvalues, a warning is printed and whenever possible a nonprimary matrix function is returned.
657
+
658
+
If `A` is symmetric or Hermitian, its eigendecomposition (:func:`eigfact`) is used, if `A` is triangular an improved version of the inverse scaling and squaring method is employed (see [AH12]_ and [AHR13]_). For general matrices, the complex Schur form (:func:`schur`) is computed and the triangular algorithm is used on the triangular factor.
659
+
660
+
661
+
.. [AH12] Awad H. Al-Mohy and Nicholas J. Higham, "Improved inverse scaling
662
+
and squaring algorithms for the matrix logarithm", SIAM Journal on
Compute the matrix square root of ``A``. If ``B = sqrtm(A)``, then ``B*B == A`` within roundoff error.
673
+
If ``A`` has no negative real eigenvalues, compute the principal matrix square root of ``A``, that is the unique matrix :math:`X` with eigenvalues having positive real part such that :math:`X^2 = A`. Otherwise, a nonprincipal square root is returned.
674
+
675
+
If `A` is symmetric or Hermitian, its eigendecomposition (:func:`eigfact`) is used to compute the square root. Otherwise, the square root is determined by means of the Björck-Hammarling method, which computes the complex Schur form (:func:`schur`) and then the complex square root of the triangular factor.
650
676
651
-
``sqrtm`` uses a polyalgorithm, computing the matrix square root using Schur factorizations (:func:`schurfact`) unless it detects the matrix to be Hermitian or real symmetric, in which case it computes the matrix square root from an eigendecomposition (:func:`eigfact`). In the latter situation for positive definite matrices, the matrix square root has ``Real`` elements, otherwise it has ``Complex`` elements.
677
+
.. [BH83] Åke Björck and Sven Hammarling, "A Schur method for the square root
678
+
of a matrix", Linear Algebra and its Applications, 52-53, 1983, 127-140.
0 commit comments