PDF version (NAG web site
, 64-bit version, 64-bit version)
NAG Toolbox: nag_lapack_zuncsd (f08rn)
Purpose
nag_lapack_zuncsd (f08rn) computes the CS decomposition of a complex by unitary matrix , partitioned into a by array of submatrices.
Syntax
[
x11,
x12,
x21,
x22,
theta,
u1,
u2,
v1t,
v2t,
info] = f08rn(
m,
p,
q,
x11,
x12,
x21,
x22, 'jobu1',
jobu1, 'jobu2',
jobu2, 'jobv1t',
jobv1t, 'jobv2t',
jobv2t, 'trans',
trans, 'signs',
signs)
[
x11,
x12,
x21,
x22,
theta,
u1,
u2,
v1t,
v2t,
info] = nag_lapack_zuncsd(
m,
p,
q,
x11,
x12,
x21,
x22, 'jobu1',
jobu1, 'jobu2',
jobu2, 'jobv1t',
jobv1t, 'jobv2t',
jobv2t, 'trans',
trans, 'signs',
signs)
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.
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
Parameters
Compulsory Input Parameters
- 1:
– int64int32nag_int scalar
-
, the number of rows and columns in the unitary matrix .
Constraint:
.
- 2:
– int64int32nag_int scalar
-
, the number of rows in and .
Constraint:
.
- 3:
– int64int32nag_int scalar
-
, the number of columns in and .
Constraint:
.
- 4:
– complex array
-
The first dimension,
, of the array
x11 must satisfy
- if , ;
- otherwise .
The second dimension of the array
x11 must be at least
if
, and at least
otherwise.
The upper left partition of the unitary matrix whose CSD is desired.
- 5:
– complex array
-
The first dimension,
, of the array
x12 must satisfy
- if , ;
- otherwise .
The second dimension of the array
x12 must be at least
if
, and at least
otherwise.
The upper right partition of the unitary matrix whose CSD is desired.
- 6:
– complex array
-
The first dimension,
, of the array
x21 must satisfy
- if , ;
- otherwise .
The second dimension of the array
x21 must be at least
if
, and at least
otherwise.
The lower left partition of the unitary matrix whose CSD is desired.
- 7:
– complex array
-
The first dimension,
, of the array
x22 must satisfy
- if , ;
- otherwise .
The second dimension of the array
x22 must be at least
if
, and at least
otherwise.
The lower right partition of the unitary matrix CSD is desired.
Optional Input Parameters
- 1:
– string (length ≥ 1)
Default:
- if , is computed;
- otherwise, is not computed.
- 2:
– string (length ≥ 1)
Default:
- if , is computed;
- otherwise, is not computed.
- 3:
– string (length ≥ 1)
Default:
- if , is computed;
- otherwise, is not computed.
- 4:
– string (length ≥ 1)
Default:
- if , is computed;
- otherwise, is not computed.
- 5:
– string (length ≥ 1)
Default:
- if , , , , and are stored in row-major order;
- otherwise, , , , and are stored in column-major order.
- 6:
– string (length ≥ 1)
Default:
- if , the lower-left block is made nonpositive (the other convention);
- otherwise, the upper-right block is made nonpositive (the default convention).
Output Parameters
- 1:
– complex array
-
The first dimension,
, of the array
x11 will be
- if , ;
- otherwise .
The second dimension of the array
x11 will be
if
and
otherwise.
Contains details of the unitary matrix used in a simultaneous bidiagonalization process.
- 2:
– complex array
-
The first dimension,
, of the array
x12 will be
- if , ;
- otherwise .
The second dimension of the array
x12 will be
if
and
otherwise.
Contains details of the unitary matrix used in a simultaneous bidiagonalization process.
- 3:
– complex array
-
The first dimension,
, of the array
x21 will be
- if , ;
- otherwise .
The second dimension of the array
x21 will be
if
and
otherwise.
Contains details of the unitary matrix used in a simultaneous bidiagonalization process.
- 4:
– complex array
-
The first dimension,
, of the array
x22 will be
- if , ;
- otherwise .
The second dimension of the array
x22 will be
if
and
otherwise.
Contains details of the unitary matrix used in a simultaneous bidiagonalization process.
- 5:
– double array
-
The values
for
where
. The diagonal submatrices
and
of
are constructed from these values as
- and
- .
- 6:
– complex array
-
The first dimension of the array
u1 will be if
,
.
The second dimension of the array
u1 will be
if
and
otherwise.
If
,
u1 contains the
by
unitary matrix
.
- 7:
– complex array
-
The first dimension of the array
u2 will be if
,
.
The second dimension of the array
u2 will be
if
and
otherwise.
If
,
u2 contains the
by
unitary matrix
.
- 8:
– complex array
-
The first dimension of the array
v1t will be if
,
.
The second dimension of the array
v1t will be
if
and
otherwise.
If
,
v1t contains the
by
unitary matrix
.
- 9:
– complex array
-
The first dimension of the array
v2t will be if
,
.
The second dimension of the array
v2t will be
if
and
otherwise.
If
,
v2t contains the
by
unitary matrix
.
- 10:
– int64int32nag_int scalar
unless the function detects an error (see
Error Indicators and Warnings).
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.
Accuracy
The computed
decomposition is nearly the exact
decomposition for the nearby matrix
, where
and
is the
machine precision.
Further Comments
The total number of floating-point operations required to perform the full decomposition is approximately .
The real analogue of this function is
nag_lapack_dorcsd (f08ra).
Example
This example finds the full CS decomposition of a unitary by matrix 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.
Open in the MATLAB editor:
f08rn_example
function f08rn_example
fprintf('f08rn example results\n\n');
m = int64(6);
p = int64(2);
q = int64(4);
xr = [-1.3038E-02 -1.4039E-01 2.5177E-01 -5.0956E-02 -4.5947E-02 -5.2773E-02;
4.2764E-01 8.6298E-02 -3.2188E-01 1.1979E-01 -8.0311E-02 -3.8117E-02;
-3.2595E-01 3.8163E-01 1.3231E-01 -5.0671E-01 5.9714E-02 -1.3850E-01;
1.5906E-01 -2.8207E-01 2.1598E-01 -4.0163E-01 -4.6443E-02 -3.7354E-01;
-1.7210E-01 -5.0942E-01 3.6488E-02 1.9271E-01 5.7843E-01 -1.8815E-02;
-2.6336E-01 -1.0861E-01 1.0906E-01 -8.8159E-02 1.5763E-02 6.5007E-01];
xi = [-3.2595E-01 -2.6167E-01 -7.9789E-01 -2.1750E-01 1.4052E-04 -2.2492E-01;
-6.2582E-01 -3.8174E-02 1.6112E-01 1.6319E-01 -4.3605E-01 -2.1907E-01;
1.6428E-01 -1.8219E-01 -1.4565E-02 1.8615E-01 -5.8974E-01 -9.0941E-02;
-5.2151E-03 1.9732E-01 1.8813E-01 2.6787E-01 3.0864E-01 -5.5148E-01;
-1.3038E-02 -5.0319E-01 2.0316E-01 1.5574E-01 -1.2439E-01 -5.5686E-02;
-2.4772E-01 2.8474E-01 -1.2712E-01 5.6169E-01 4.7130E-02 4.9173E-03];
x = xr + i*xi;
x11 = x(1:p, 1:q); x12 = x(1:p, q+1:m);
x21 = x(p+1:m,1:q); x22 = x(p+1:m,q+1:m);
[x11, x12, x21, x22, theta, u1, u2, v1t, v2t, info] = ...
f08rn(...
m, p, q, x11, x12, x21, x22);
disp('Components of CS factorization of X:');
disp(' Theta');
disp(theta);
disp(' U1');
disp(u1);
disp(' U2');
disp(u2);
disp(' V1');
disp(v1t');
disp(' V2');
disp(v2t');
f08rn example results
Components of CS factorization of X:
Theta
0.1973
0.5386
U1
-0.2084 - 0.9384i 0.1565 + 0.2269i
-0.0490 + 0.2713i 0.1972 + 0.9408i
U2
0.1599 - 0.2574i -0.0334 - 0.6270i 0.0573 + 0.6677i 0.2378 + 0.0912i
0.3473 + 0.6047i -0.3155 - 0.0122i 0.0703 - 0.1039i 0.4497 + 0.4427i
0.3373 - 0.0221i 0.5536 - 0.1556i 0.6869 - 0.2398i -0.1173 + 0.1096i
-0.5483 + 0.0839i 0.4188 + 0.0043i 0.0576 - 0.0505i 0.7043 - 0.1224i
V1
0.1202 + 0.0302i -0.6762 + 0.6685i -0.0150 - 0.1654i -0.1297 + 0.1903i
0.2654 + 0.1007i -0.1168 + 0.1140i -0.3900 + 0.7376i -0.0721 - 0.4376i
0.7707 - 0.4915i -0.0624 - 0.1777i -0.0175 - 0.0930i 0.3209 + 0.1306i
0.2581 + 0.0438i 0.1396 + 0.1200i 0.1007 - 0.5071i -0.3019 - 0.7342i
V2
0.5354 + 0.0000i 0.8446 + 0.0000i
-0.8393 + 0.0941i 0.5321 - 0.0596i
PDF version (NAG web site
, 64-bit version, 64-bit version)
© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2015