Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

Chapter Contents
Chapter Introduction
NAG Toolbox

# NAG Toolbox: nag_lapack_zupmtr (f08gu)

## Purpose

nag_lapack_zupmtr (f08gu) multiplies an arbitrary complex matrix C$C$ by the complex unitary matrix Q$Q$ which was determined by nag_lapack_zhptrd (f08gs) when reducing a complex Hermitian matrix to tridiagonal form.

## Syntax

[ap, c, info] = f08gu(side, uplo, trans, ap, tau, c, 'm', m, 'n', n)
[ap, c, info] = nag_lapack_zupmtr(side, uplo, trans, ap, tau, c, 'm', m, 'n', n)

## Description

nag_lapack_zupmtr (f08gu) is intended to be used after a call to nag_lapack_zhptrd (f08gs), which reduces a complex Hermitian matrix A$A$ to real symmetric tridiagonal form T$T$ by a unitary similarity transformation: A = QTQH$A=QT{Q}^{\mathrm{H}}$. nag_lapack_zhptrd (f08gs) represents the unitary matrix Q$Q$ as a product of elementary reflectors.
This function may be used to form one of the matrix products
 QC , QHC , CQ ​ or ​ CQH , $QC , QHC , CQ ​ or ​ CQH ,$
overwriting the result on C$C$ (which may be any complex rectangular matrix).
A common application of this function is to transform a matrix Z$Z$ of eigenvectors of T$T$ to the matrix QZ$QZ$ of eigenvectors of A$A$.

## References

Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore

## Parameters

### Compulsory Input Parameters

1:     side – string (length ≥ 1)
Indicates how Q$Q$ or QH${Q}^{\mathrm{H}}$ is to be applied to C$C$.
side = 'L'${\mathbf{side}}=\text{'L'}$
Q$Q$ or QH${Q}^{\mathrm{H}}$ is applied to C$C$ from the left.
side = 'R'${\mathbf{side}}=\text{'R'}$
Q$Q$ or QH${Q}^{\mathrm{H}}$ is applied to C$C$ from the right.
Constraint: side = 'L'${\mathbf{side}}=\text{'L'}$ or 'R'$\text{'R'}$.
2:     uplo – string (length ≥ 1)
This must be the same parameter uplo as supplied to nag_lapack_zhptrd (f08gs).
Constraint: uplo = 'U'${\mathbf{uplo}}=\text{'U'}$ or 'L'$\text{'L'}$.
3:     trans – string (length ≥ 1)
Indicates whether Q$Q$ or QH${Q}^{\mathrm{H}}$ is to be applied to C$C$.
trans = 'N'${\mathbf{trans}}=\text{'N'}$
Q$Q$ is applied to C$C$.
trans = 'C'${\mathbf{trans}}=\text{'C'}$
QH${Q}^{\mathrm{H}}$ is applied to C$C$.
Constraint: trans = 'N'${\mathbf{trans}}=\text{'N'}$ or 'C'$\text{'C'}$.
4:     ap( : $:$) – complex array
Note: the dimension of the array ap must be at least max (1, m × (m + 1) / 2 ) $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}×\left({\mathbf{m}}+1\right)/2\right)$ if side = 'L'${\mathbf{side}}=\text{'L'}$ and at least max (1, n × (n + 1) / 2 ) $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}×\left({\mathbf{n}}+1\right)/2\right)$ if side = 'R'${\mathbf{side}}=\text{'R'}$.
Details of the vectors which define the elementary reflectors, as returned by nag_lapack_zhptrd (f08gs).
5:     tau( : $:$) – complex array
Note: the dimension of the array tau must be at least max (1,m1)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}-1\right)$ if side = 'L'${\mathbf{side}}=\text{'L'}$ and at least max (1,n1)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}-1\right)$ if side = 'R'${\mathbf{side}}=\text{'R'}$.
Further details of the elementary reflectors, as returned by nag_lapack_zhptrd (f08gs).
6:     c(ldc, : $:$) – complex array
The first dimension of the array c must be at least max (1,m)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}\right)$
The second dimension of the array must be at least max (1,n)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$
The m$m$ by n$n$ matrix C$C$.

### Optional Input Parameters

1:     m – int64int32nag_int scalar
Default: The first dimension of the array c.
m$m$, the number of rows of the matrix C$C$; m$m$ is also the order of Q$Q$ if side = 'L'${\mathbf{side}}=\text{'L'}$.
Constraint: m0${\mathbf{m}}\ge 0$.
2:     n – int64int32nag_int scalar
Default: The second dimension of the array c.
n$n$, the number of columns of the matrix C$C$; n$n$ is also the order of Q$Q$ if side = 'R'${\mathbf{side}}=\text{'R'}$.
Constraint: n0${\mathbf{n}}\ge 0$.

ldc work

### Output Parameters

1:     ap( : $:$) – complex array
Note: the dimension of the array ap must be at least max (1, m × (m + 1) / 2 ) $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}×\left({\mathbf{m}}+1\right)/2\right)$ if side = 'L'${\mathbf{side}}=\text{'L'}$ and at least max (1, n × (n + 1) / 2 ) $\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}×\left({\mathbf{n}}+1\right)/2\right)$ if side = 'R'${\mathbf{side}}=\text{'R'}$.
Is used as internal workspace prior to being restored and hence is unchanged.
2:     c(ldc, : $:$) – complex array
The first dimension of the array c will be max (1,m)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}\right)$
The second dimension of the array will be max (1,n)$\mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{n}}\right)$
ldcmax (1,m)$\mathit{ldc}\ge \mathrm{max}\phantom{\rule{0.125em}{0ex}}\left(1,{\mathbf{m}}\right)$.
c stores QC$QC$ or QHC${Q}^{\mathrm{H}}C$ or CQ$CQ$ or CQH$C{Q}^{\mathrm{H}}$ as specified by side and trans.
3:     info – int64int32nag_int scalar
info = 0${\mathbf{info}}=0$ unless the function detects an error (see Section [Error Indicators and Warnings]).

## Error Indicators and Warnings

info = i${\mathbf{info}}=-i$
If info = i${\mathbf{info}}=-i$, parameter i$i$ had an illegal value on entry. The parameters are numbered as follows:
1: side, 2: uplo, 3: trans, 4: m, 5: n, 6: ap, 7: tau, 8: c, 9: ldc, 10: work, 11: info.
It is possible that info refers to a parameter that is omitted from the MATLAB interface. This usually indicates that an error in one of the other input parameters has caused an incorrect value to be inferred.

## Accuracy

The computed result differs from the exact result by a matrix E$E$ such that
 ‖E‖2 = O(ε) ‖C‖2 , $‖E‖2 = O(ε) ‖C‖2 ,$
where ε$\epsilon$ is the machine precision.

The total number of real floating point operations is approximately 8m2n$8{m}^{2}n$ if side = 'L'${\mathbf{side}}=\text{'L'}$ and 8mn2$8m{n}^{2}$ if side = 'R'${\mathbf{side}}=\text{'R'}$.
The real analogue of this function is nag_lapack_dopmtr (f08gg).

## Example

```function nag_lapack_zupmtr_example
side = 'Left';
uplo = 'L';
trans = 'No transpose';
ap = [complex(-2.28);
-4.33845594653213 + 0i;
0.3278606760921924 - 0.1251226092264437i;
-0.1412565637506947 - 0.366636483973957i;
-0.1284569816493291 + 0i;
-2.022594578622617 + 0i;
-0.308321908008089 + 0.1763226364726777i;
-0.1665932537524081 + 0i;
-1.802322978338735 + 0i;
-1.924949764598263 + 0i];
tau = [ 1.410284216766754 + 0.4679084045148932i;
1.302420369434775 + 0.7853320742529579i;
1.093973715923082 - 0.9955746786231597i];
c = complex([ 0.7298945743917051,  -0.2595449733877608;
0.6258777805557931,  -0.04325496258655371;
0.2513449473644084,  0.495247410182068;
0.1111603864444915,  0.8279465065502341]);
[apOut, cOut, info] = nag_lapack_zupmtr(side, uplo, trans, ap, tau, c)
```
```

apOut =

-2.2800 + 0.0000i
-4.3385 + 0.0000i
0.3279 - 0.1251i
-0.1413 - 0.3666i
-0.1285 + 0.0000i
-2.0226 + 0.0000i
-0.3083 + 0.1763i
-0.1666 + 0.0000i
-1.8023 + 0.0000i
-1.9249 + 0.0000i

cOut =

0.7299 + 0.0000i  -0.2595 + 0.0000i
-0.1663 - 0.2061i   0.5969 + 0.4214i
-0.4165 - 0.1417i  -0.2965 - 0.1507i
0.1743 + 0.4162i   0.3482 + 0.4085i

info =

0

```
```function f08gu_example
side = 'Left';
uplo = 'L';
trans = 'No transpose';
ap = [complex(-2.28);
-4.33845594653213 + 0i;
0.3278606760921924 - 0.1251226092264437i;
-0.1412565637506947 - 0.366636483973957i;
-0.1284569816493291 + 0i;
-2.022594578622617 + 0i;
-0.308321908008089 + 0.1763226364726777i;
-0.1665932537524081 + 0i;
-1.802322978338735 + 0i;
-1.924949764598263 + 0i];
tau = [ 1.410284216766754 + 0.4679084045148932i;
1.302420369434775 + 0.7853320742529579i;
1.093973715923082 - 0.9955746786231597i];
c = complex([ 0.7298945743917051,  -0.2595449733877608;
0.6258777805557931,  -0.04325496258655371;
0.2513449473644084,  0.495247410182068;
0.1111603864444915,  0.8279465065502341]);
[apOut, cOut, info] = f08gu(side, uplo, trans, ap, tau, c)
```
```

apOut =

-2.2800 + 0.0000i
-4.3385 + 0.0000i
0.3279 - 0.1251i
-0.1413 - 0.3666i
-0.1285 + 0.0000i
-2.0226 + 0.0000i
-0.3083 + 0.1763i
-0.1666 + 0.0000i
-1.8023 + 0.0000i
-1.9249 + 0.0000i

cOut =

0.7299 + 0.0000i  -0.2595 + 0.0000i
-0.1663 - 0.2061i   0.5969 + 0.4214i
-0.4165 - 0.1417i  -0.2965 - 0.1507i
0.1743 + 0.4162i   0.3482 + 0.4085i

info =

0

```