hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_matop_complex_herm_matrix_exp (f01fd)

Purpose

nag_matop_complex_herm_matrix_exp (f01fd) computes the matrix exponential, eAeA, of a complex Hermitian nn by nn matrix AA.

Syntax

[a, ifail] = f01fd(uplo, a, 'n', n)
[a, ifail] = nag_matop_complex_herm_matrix_exp(uplo, a, 'n', n)

Description

eAeA is computed using a spectral factorization of AA 
A = Q D QH ,
A = Q D QH ,
where DD is the diagonal matrix whose diagonal elements, didi, are the eigenvalues of AA, and QQ is a unitary matrix whose columns are the eigenvectors of AA. eAeA is then given by
eA = Q eD QH ,
eA = Q eD QH ,
where eDeD is the diagonal matrix whose iith diagonal element is ediedi. See for example Section 4.5 of Higham (2008).

References

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

Parameters

Compulsory Input Parameters

1:     uplo – string (length ≥ 1)
If uplo = 'U'uplo='U', the upper triangle of the matrix AA is stored.
If uplo = 'L'uplo='L', the lower triangle of the matrix AA is stored.
Constraint: uplo = 'U'uplo='U' or 'L''L'.
2:     a(lda, : :) – complex array
The first dimension of the array a must be at least nn
The second dimension of the array must be at least nn
The nn by nn Hermitian matrix AA.
  • If uplo = 'U'uplo='U', the upper triangular part of aa must be stored and the elements of the array below the diagonal are not referenced.
  • If uplo = 'L'uplo='L', the lower triangular part of aa must be stored and the elements of the array above the diagonal are not referenced.

Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The first dimension of the array a.
nn, the order of the matrix AA.
Constraint: n0n0.

Input Parameters Omitted from the MATLAB Interface

lda

Output Parameters

1:     a(lda, : :) – complex array
The first dimension of the array a will be nn
The second dimension of the array will be nn
ldanldan.
If ifail = 0ifail=0, the upper or lower triangular part of the nn by nn matrix exponential, eAeA.
2:     ifail – int64int32nag_int scalar
ifail = 0ifail=0 unless the function detects an error (see [Error Indicators and Warnings]).

Error Indicators and Warnings

Errors or warnings detected by the function:
  ifail > 0ifail>0
The computation of the spectral factorization failed to converge.
  ifail = 1ifail=-1
On entry, uplo was invalid.
  ifail = 2ifail=-2
Constraint: n0n0.
  ifail = 3ifail=-3
An internal error occurred when computing the spectral factorization. Please contact NAG.
  ifail = 4ifail=-4
Constraint: ldanldan.
  ifail = 999ifail=-999
Dynamic memory allocation failed.

Accuracy

For an Hermitian matrix AA, the matrix eAeA, has the relative condition number
κ(A) = A2 ,
κ(A) = A2 ,
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.

Further Comments

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

Example

function nag_matop_complex_herm_matrix_exp_example
uplo = 'u';
a = [1,  2 + 1i,  3 + 2i,  4 + 3i;
                 0,   1 + 0i,  2 + 1i,  3 + 2i;
                 0,             0,   1 + 0i,  2 + 1i;
                 0,             0,              0,  1 + 0i];
% Compute exp(a)
[aOut, ifail] = nag_matop_complex_herm_matrix_exp(uplo, a);
% Display results
[ifail] = nag_file_print_matrix_complex_gen(uplo, 'n', aOut, 'Hermitian Exp(a)')
 
 Hermitian Exp(a)
               1            2            3            4
 1    1.1457E+04   8.7983E+03   7.8120E+03   8.3103E+03
      0.0000E+00   2.0776E+03   4.5500E+03   7.8871E+03

 2                 7.1339E+03   6.8242E+03   7.8120E+03
                   0.0000E+00   2.0776E+03   4.5500E+03

 3                              7.1339E+03   8.7983E+03
                                0.0000E+00   2.0776E+03

 4                                           1.1457E+04
                                             0.0000E+00

ifail =

                    0


function f01fd_example
uplo = 'u';
a = [1,  2 + 1i,  3 + 2i,  4 + 3i;
                 0,   1 + 0i,  2 + 1i,  3 + 2i;
                 0,             0,   1 + 0i,  2 + 1i;
                 0,             0,              0,  1 + 0i];
% Compute exp(a)
[aOut, ifail] = f01fd(uplo, a);
% Display results
[ifail] = x04da(uplo, 'n', aOut, 'Hermitian Exp(a)')
 
 Hermitian Exp(a)
               1            2            3            4
 1    1.1457E+04   8.7983E+03   7.8120E+03   8.3103E+03
      0.0000E+00   2.0776E+03   4.5500E+03   7.8871E+03

 2                 7.1339E+03   6.8242E+03   7.8120E+03
                   0.0000E+00   2.0776E+03   4.5500E+03

 3                              7.1339E+03   8.7983E+03
                                0.0000E+00   2.0776E+03

 4                                           1.1457E+04
                                             0.0000E+00

ifail =

                    0



PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013