f01fd computes the matrix exponential, eA, of a complex Hermitian n by n matrix A.


public static void f01fd(
	string uplo,
	int n,
	Complex[,] a,
	out int ifail
Visual Basic
Public Shared Sub f01fd ( _
	uplo As String, _
	n As Integer, _
	a As Complex(,), _
	<OutAttribute> ByRef ifail As Integer _
Visual C++
static void f01fd(
	String^ uplo, 
	int n, 
	array<Complex,2>^ a, 
	[OutAttribute] int% ifail
static member f01fd : 
        uplo : string * 
        n : int * 
        a : Complex[,] * 
        ifail : int byref -> unit 


Type: System..::..String
On entry: if uplo="U", the upper triangle of the matrix A is stored.
If uplo="L", the lower triangle of the matrix A is stored.
Constraint: uplo="U" or "L".
Type: System..::..Int32
On entry: n, the order of the matrix A.
Constraint: n0.
Type: array<NagLibrary..::..Complex,2>[,](,)[,][,]
An array of size [dim1, dim2]
Note: dim1 must satisfy the constraint: dim1n
Note: the second dimension of the array a must be at least n.
On entry: the n by n Hermitian matrix A.
  • If uplo="U", the upper triangular part of A must be stored and the elements of the array below the diagonal are not referenced.
  • If uplo="L", the lower triangular part of A must be stored and the elements of the array above the diagonal are not referenced.
On exit: if ifail=0, the upper or lower triangular part of the n by n matrix exponential, eA.
Type: System..::..Int32%
On exit: ifail=0 unless the method detects an error or a warning has been flagged (see [Error Indicators and Warnings]).


eA is computed using a spectral factorization of A 
where D is the diagonal matrix whose diagonal elements, di, are the eigenvalues of A, and Q is a unitary matrix whose columns are the eigenvectors of A. eA is then given by
where eD is the diagonal matrix whose ith diagonal element is edi. See for example Section 4.5 of Higham (2008).


Higham N J (2005) The scaling and squaring method for the matrix exponential revisited SIAM J. Matrix Anal. Appl. 26(4) 1179–1193
Higham N J (2008) Functions of Matrices: Theory and Computation SIAM, Philadelphia, PA, USA
Moler C B and Van Loan C F (2003) Nineteen dubious ways to compute the exponential of a matrix, twenty-five years later SIAM Rev. 45 3–49

Error Indicators and Warnings

Errors or warnings detected by the method:
Some error messages may refer to parameters that are dropped from this interface (LDA) In these cases, an error in another parameter has usually caused an incorrect value to be inferred.
If ifail=-i, the ith argument had an illegal value.
Allocation of memory failed. The INTEGER allocatable memory required is n, the real allocatable memory required is n and the complex allocatable memory required is approximately n+nb+1×n, where nb is the block size required by f08fn.
The algorithm to compute the spectral factorization failed to converge; i off-diagonal elements of an intermediate tridiagonal form did not converge to zero (see f08fn).
Note: this failure is unlikely to occur.
An error occured, see message report.
Invalid Parameters value
Invalid dimension for array value
Negative dimension for array value
Invalid Parameters value


For an Hermitian matrix A, the matrix eA, has the relative condition number
which is the minimal possible for the matrix exponential and so the computed matrix exponential is guaranteed to be close to the exact matrix. See Section 10.2 of Higham (2008) for details and further discussion.

Parallelism and Performance


Further Comments

The cost of the algorithm is On3.
As well as the excellent book cited above, the classic reference for the computation of the matrix exponential is Moler and Van Loan (2003).


This example finds the matrix exponential of the Hermitian matrix

Example program (C#): f01fde.cs

Example program data: f01fde.d

Example program results: f01fde.r

See Also