NAG Library Routine Document
F08RNF (ZUNCSD)
1 Purpose
F08RNF (ZUNCSD) computes the CS decomposition of a complex by unitary matrix , partitioned into a by array of submatrices.
2 Specification
SUBROUTINE F08RNF ( |
JOBU1, JOBU2, JOBV1T, JOBV2T, TRANS, SIGNS, M, P, Q, X11, LDX11, X12, LDX12, X21, LDX21, X22, LDX22, THETA, U1, LDU1, U2, LDU2, V1T, LDV1T, V2T, LDV2T, WORK, LWORK, RWORK, LRWORK, IWORK, INFO) |
INTEGER |
M, P, Q, LDX11, LDX12, LDX21, LDX22, LDU1, LDU2, LDV1T, LDV2T, LWORK, LRWORK, IWORK(M-min(P,M-P,Q,M-Q)), INFO |
REAL (KIND=nag_wp) |
THETA(min(P,M-P,Q,M-Q)), RWORK(max(1,LRWORK)) |
COMPLEX (KIND=nag_wp) |
X11(LDX11,*), X12(LDX12,*), X21(LDX21,*), X22(LDX22,*), U1(LDU1,*), U2(LDU2,*), V1T(LDV1T,*), V2T(LDV2T,*), WORK(max(1,LWORK)) |
CHARACTER(1) |
JOBU1, JOBU2, JOBV1T, JOBV2T, TRANS, SIGNS |
|
The routine may be called by its
LAPACK
name zuncsd.
3 Description
The
by
unitary matrix
is partitioned as
where
is a
by
submatrix and the dimensions of the other submatrices
,
and
are such that
remains
by
.
The CS decomposition of
is
where
,
and
are
by
matrices, such that
is a unitary matrix containing the
by
unitary matrix
and the
by
unitary matrix
;
is a unitary matrix containing the
by
unitary matrix
and the
by
unitary matrix
; and
contains the
by
non-negative diagonal submatrices
and
satisfying
, where
and the top left partition is
by
.
The identity matrix is of order and vanishes if .
The identity matrix is of order and vanishes if .
The identity matrix is of order and vanishes if .
The identity matrix is of order and vanishes if .
In each of the four cases at least two of the identity matrices vanish.
The indicated zeros represent augmentations by additional rows or columns (but not both) to the square diagonal matrices formed by and or .
does not need to be stored in full; it is sufficient to return only the values for where and .
The algorithm used to perform the complete
decomposition is described fully in
Sutton (2009) including discussions of the stability and accuracy of the algorithm.
4 References
Anderson E, Bai Z, Bischof C, Blackford S, Demmel J, Dongarra J J, Du Croz J J, Greenbaum A, Hammarling S, McKenney A and Sorensen D (1999)
LAPACK Users' Guide (3rd Edition) SIAM, Philadelphia
http://www.netlib.org/lapack/lug
Golub G H and Van Loan C F (2012) Matrix Computations (4th Edition) Johns Hopkins University Press, Baltimore
Sutton B D (2009) Computing the complete
decomposition
Numerical Algorithms (Volume 50) 1017–1398 Springer US 33–65
http://dx.doi.org/10.1007/s11075-008-9215-6
5 Parameters
- 1: – CHARACTER(1)Input
-
On entry:
- if , is computed;
- otherwise, is not computed.
- 2: – CHARACTER(1)Input
-
On entry:
- if , is computed;
- otherwise, is not computed.
- 3: – CHARACTER(1)Input
-
On entry:
- if , is computed;
- otherwise, is not computed.
- 4: – CHARACTER(1)Input
-
On entry:
- if , is computed;
- otherwise, is not computed.
- 5: – CHARACTER(1)Input
-
On entry:
- if , , , , and are stored in row-major order;
- otherwise, , , , and are stored in column-major order.
- 6: – CHARACTER(1)Input
-
On entry:
- if , the lower-left block is made nonpositive (the other convention);
- otherwise, the upper-right block is made nonpositive (the default convention).
- 7: – INTEGERInput
-
On entry: , the number of rows and columns in the unitary matrix .
Constraint:
.
- 8: – INTEGERInput
-
On entry: , the number of rows in and .
Constraint:
.
- 9: – INTEGERInput
-
On entry: , the number of columns in and .
Constraint:
.
- 10: – COMPLEX (KIND=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
X11
must be at least
if
, and at least
otherwise.
On entry: the upper left partition of the unitary matrix whose CSD is desired.
On exit: contains details of the unitary matrix used in a simultaneous bidiagonalization process.
- 11: – INTEGERInput
-
On entry: the first dimension of the array
X11 as declared in the (sub)program from which F08RNF (ZUNCSD) is called.
Constraints:
- if , ;
- otherwise .
- 12: – COMPLEX (KIND=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
X12
must be at least
if
, and at least
otherwise.
On entry: the upper right partition of the unitary matrix whose CSD is desired.
On exit: contains details of the unitary matrix used in a simultaneous bidiagonalization process.
- 13: – INTEGERInput
-
On entry: the first dimension of the array
X12 as declared in the (sub)program from which F08RNF (ZUNCSD) is called.
Constraints:
- if , ;
- otherwise .
- 14: – COMPLEX (KIND=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
X21
must be at least
if
, and at least
otherwise.
On entry: the lower left partition of the unitary matrix whose CSD is desired.
On exit: contains details of the unitary matrix used in a simultaneous bidiagonalization process.
- 15: – INTEGERInput
-
On entry: the first dimension of the array
X21 as declared in the (sub)program from which F08RNF (ZUNCSD) is called.
Constraints:
- if , ;
- otherwise .
- 16: – COMPLEX (KIND=nag_wp) arrayInput/Output
-
Note: the second dimension of the array
X22
must be at least
if
, and at least
otherwise.
On entry: the lower right partition of the unitary matrix CSD is desired.
On exit: contains details of the unitary matrix used in a simultaneous bidiagonalization process.
- 17: – INTEGERInput
-
On entry: the first dimension of the array
X22 as declared in the (sub)program from which F08RNF (ZUNCSD) is called.
Constraints:
- if , ;
- otherwise .
- 18: – REAL (KIND=nag_wp) arrayOutput
-
On exit: the values
for
where
. The diagonal submatrices
and
of
are constructed from these values as
- and
- .
- 19: – COMPLEX (KIND=nag_wp) arrayOutput
-
Note: the second dimension of the array
U1
must be at least
if
, and at least
otherwise.
On exit: if
,
U1 contains the
by
unitary matrix
.
- 20: – INTEGERInput
-
On entry: the first dimension of the array
U1 as declared in the (sub)program from which F08RNF (ZUNCSD) is called.
Constraint:
if , .
- 21: – COMPLEX (KIND=nag_wp) arrayOutput
-
Note: the second dimension of the array
U2
must be at least
if
, and at least
otherwise.
On exit: if
,
U2 contains the
by
unitary matrix
.
- 22: – INTEGERInput
-
On entry: the first dimension of the array
U2 as declared in the (sub)program from which F08RNF (ZUNCSD) is called.
Constraint:
if , .
- 23: – COMPLEX (KIND=nag_wp) arrayOutput
-
Note: the second dimension of the array
V1T
must be at least
if
, and at least
otherwise.
On exit: if
,
V1T contains the
by
unitary matrix
.
- 24: – INTEGERInput
-
On entry: the first dimension of the array
V1T as declared in the (sub)program from which F08RNF (ZUNCSD) is called.
Constraint:
if , .
- 25: – COMPLEX (KIND=nag_wp) arrayOutput
-
Note: the second dimension of the array
V2T
must be at least
if
, and at least
otherwise.
On exit: if
,
V2T contains the
by
unitary matrix
.
- 26: – INTEGERInput
-
On entry: the first dimension of the array
V2T as declared in the (sub)program from which F08RNF (ZUNCSD) is called.
Constraint:
if , .
- 27: – COMPLEX (KIND=nag_wp) arrayWorkspace
-
On exit: if
,
returns the optimal
LWORK.
If
on exit,
contains the values
that, together with
, define the matrix in intermediate bidiagonal-block form remaining after nonconvergence.
INFO specifies the number of nonzero PHI's.
- 28: – INTEGERInput
-
On entry:
If
, a workspace query is assumed; the routine only calculates the optimal size of the
WORK array, returns this value as the first entry of the
WORK array, and no error message related to
LWORK is issued.
The minimum workspace required is ; the optimal amount of workspace depends on internal block sizes and the relative problem dimensions.
Constraint:
or .
- 29: – REAL (KIND=nag_wp) arrayWorkspace
-
- 30: – INTEGERInput
-
On entry:
If
, a workspace query is assumed; the routine only calculates the optimal size of the
WORK array, returns this value as the first entry of the
WORK array, and no error message related to
LRWORK is issued. Otherwise the required workspace is
which equates to
for
,
for
and
when
.
Constraint:
.
- 31: – INTEGER arrayWorkspace
-
- 32: – INTEGEROutput
On exit:
unless the routine detects an error (see
Section 6).
6 Error Indicators and Warnings
If , argument had an illegal value. An explanatory message is output, and execution of the program is terminated.
-
The Jacobi-type procedure failed to converge during an internal reduction to bidiagonal-block form. The process requires convergence to
values, the value of
INFO gives the number of converged values.
7 Accuracy
The computed
decomposition is nearly the exact
decomposition for the nearby matrix
, where
and
is the
machine precision.
8 Parallelism and Performance
F08RNF (ZUNCSD) is threaded by NAG for parallel execution in multithreaded implementations of the NAG Library.
F08RNF (ZUNCSD) 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 total number of floating-point operations required to perform the full decomposition is approximately .
The real analogue of this routine is
F08RAF (DORCSD).
10 Example
This example finds the full CS decomposition of a unitary
by
matrix
(see
Section 10.2) partitioned in
by
blocks.
The decomposition is performed both on submatrices of the unitary matrix and on separated partition matrices. Code is also provided to perform a recombining check if required.
10.1 Program Text
Program Text (f08rnfe.f90)
10.2 Program Data
Program Data (f08rnfe.d)
10.3 Program Results
Program Results (f08rnfe.r)