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


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


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 matrix A.
On exit: with ifail=0, 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 Padé approximant and the scaling and squaring method described in Al–Mohy and Higham (2009).


Al–Mohy A H and Higham N J (2009) A new scaling and squaring algorithm for the matrix exponential SIAM J. Matrix Anal. 31(3) 970–989
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.
The linear equations to be solved for the Padé approximant are singular; it is likely that this method has been called incorrectly.
The linear equations to be solved are nearly singular and the Padé approximant probably has no correct figures; it is likely that this method has been called incorrectly.
eA has been computed using an IEEE double precision Padé approximant, although the arithmetic precision is higher than IEEE double precision.
An unexpected internal error has occurred. Please contact NAG.
On entry, n=value.
Constraint: n0.
On entry, lda=value and n=value.
Constraint: ldan.
Dynamic memory allocation failed.
An error occured, see message report.
Invalid Parameters value
Invalid dimension for array value
Negative dimension for array value
Invalid Parameters value


For a normal matrix A (for which AHA=AAH) the computed matrix, eA, is guaranteed to be close to the exact matrix, that is, the method is forward stable. No such guarantee can be given for non-normal matrices. See Al–Mohy and Higham (2009) and Section 10.3 of Higham (2008) for details and further discussion.
If estimates of the condition number of the matrix exponential are required then (F01KGF not in this release) should be used.

Parallelism and Performance


Further Comments

The cost of the algorithm is On3; see Section 5 of Al–Mohy and Higham (2009). The complex allocatable memory required is approximately 6×n2.
If the Fréchet derivative of the matrix exponential is required then (F01KHF not in this release) should be used.
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 matrix

Example program (C#): f01fce.cs

Example program data: f01fce.d

Example program results: f01fce.r

See Also