NAG Library Routine Document
F01HAF
1 Purpose
F01HAF computes the action of the matrix exponential , on the matrix , where is a complex by matrix, is a complex by matrix and is a complex scalar.
2 Specification
INTEGER |
N, M, LDA, LDB, IFAIL |
COMPLEX (KIND=nag_wp) |
A(LDA,*), B(LDB,*), T |
|
3 Description
is computed using the algorithm described in
Al–Mohy and Higham (2011) which uses a truncated Taylor series to compute the product
without explicitly forming
.
4 References
Al–Mohy A H and Higham N J (2011) Computing the action of the matrix exponential, with an application to exponential integrators SIAM J. Sci. Statist. Comput. 33(2) 488-511
Higham N J (2008) Functions of Matrices: Theory and Computation SIAM, Philadelphia, PA, USA
5 Parameters
- 1: – INTEGERInput
-
On entry: , the order of the matrix .
Constraint:
.
- 2: – INTEGERInput
-
On entry: , the number of columns of the matrix .
Constraint:
.
- 3: – COMPLEX (KIND=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
A
must be at least
.
On entry: the by matrix .
On exit: is overwritten during the computation.
- 4: – INTEGERInput
-
On entry: the first dimension of the array
A as declared in the (sub)program from which F01HAF is called.
Constraint:
.
- 5: – COMPLEX (KIND=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
B
must be at least
.
On entry: the by matrix .
On exit: the by matrix .
- 6: – INTEGERInput
-
On entry: the first dimension of the array
B as declared in the (sub)program from which F01HAF is called.
Constraint:
.
- 7: – COMPLEX (KIND=nag_wp)Input
-
On entry: the scalar .
- 8: – INTEGERInput/Output
-
On entry:
IFAIL must be set to
,
. If you are unfamiliar with this parameter you should refer to
Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
is recommended. If the output of error messages is undesirable, then the value
is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is
.
When the value is used it is essential to test the value of IFAIL on exit.
On exit:
unless the routine detects an error or a warning has been flagged (see
Section 6).
6 Error Indicators and Warnings
If on entry
or
, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
Errors or warnings detected by the routine:
-
has been computed using an IEEE double precision Taylor series, although the arithmetic precision is higher than IEEE double precision.
-
On entry, .
Constraint: .
-
On entry, .
Constraint: .
-
On entry, and .
Constraint: .
-
On entry, and .
Constraint: .
An unexpected error has been triggered by this routine. Please
contact
NAG.
See
Section 3.8 in the Essential Introduction for further information.
Your licence key may have expired or may not have been installed correctly.
See
Section 3.7 in the Essential Introduction for further information.
Dynamic memory allocation failed.
See
Section 3.6 in the Essential Introduction for further information.
7 Accuracy
For a Hermitian matrix
(for which
) the computed matrix
is guaranteed to be close to the exact matrix, that is, the method is forward stable. No such guarantee can be given for non-Hermitian matrices. See Section 4 of
Al–Mohy and Higham (2011) for details and further discussion.
8 Parallelism and Performance
F01HAF is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
F01HAF makes calls to BLAS and/or LAPACK routines, which may be threaded within the vendor library used by this implementation. Consult the documentation for the vendor library for further information.
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementation-specific information.
The matrix
could be computed by explicitly forming
using
F01FCF and multiplying
by the result. However, experiments show that it is usually both more accurate and quicker to use F01HAF.
The cost of the algorithm is . The precise cost depends on since a combination of balancing, shifting and scaling is used prior to the Taylor series evaluation.
Approximately of complex allocatable memory is required by F01HAF.
F01GAF can be used to compute
for real
,
, and
.
F01HBF provides an implementation of the algorithm with a reverse communication interface, which returns control to the user when matrix multiplications are required. This should be used if
is large and sparse.
10 Example
This example computes
, where
and
10.1 Program Text
Program Text (f01hafe.f90)
10.2 Program Data
Program Data (f01hafe.d)
10.3 Program Results
Program Results (f01hafe.r)