Home > manopt > manifolds > symfixedrank > spectrahedronfactory.m

spectrahedronfactory

PURPOSE

Manifold of n-by-n symmetric positive semidefinite matrices of rank k

SYNOPSIS

function M = spectrahedronfactory(n, k)

DESCRIPTION

``` Manifold of n-by-n symmetric positive semidefinite matrices of rank k
with trace (sum of diagonal elements) equal to 1.

function M = spectrahedronfactory(n, k)

A point X on the manifold is parameterized as YY^T where Y is a matrix of
size nxk. As such, X is symmetric, positive semidefinite. We restrict to
full-rank Y's, such that X has rank exactly k. The point X is numerically
represented by Y (this is more efficient than working with X, which may
be big). Tangent vectors are represented as matrices of the same size as
Y, call them Ydot, so that Xdot = Y Ydot' + Ydot Y and trace(Xdot) == 0.
The metric is the canonical Euclidean metric on Y.

The trace constraint on X (trace(X) == 1) translates to a unit Frobenius
norm constraint on Y: trace(X) = norm(Y, 'fro')^2 == 1. The set of such
Y's forms the unit sphere in R^(nxk): see spherefactory. But because for
any orthogonal Q of size k, it holds that (YQ)(YQ)' = YY', we "group" all
matrices of the form YQ in an equivalence class. The set of equivalence
classes is a Riemannian quotient manifold, implemented here.

Note that this geometry formally breaks down at rank-deficient Y's.
As an alternative, you may use the sphere manifold (it has larger
dimension (by 1), but does not break down at rank drop.)

The geometry is taken from the 2010 paper:
M. Journee, P.-A. Absil, F. Bach and R. Sepulchre,
"Low-Rank Optimization on the Cone of Positive Semidefinite Matrices".

Please cite the Manopt paper as well as the research paper:
@Article{journee2010low,
Title   = {Low-rank optimization on the cone of positive semidefinite matrices},
Author  = {Journ{\'e}e, M. and Bach, F. and Absil, P.-A. and Sepulchre, R.},
Journal = {SIAM Journal on Optimization},
Year    = {2010},
Number  = {5},
Pages   = {2327--2351},
Volume  = {20},
Doi     = {10.1137/080731359}
}

CROSS-REFERENCE INFORMATION

This function calls:
• hashmd5 Computes the MD5 hash of input data.
• matrixlincomb Linear combination function for tangent vectors represented as matrices.
This function is called by:

SOURCE CODE

```0001 function M = spectrahedronfactory(n, k)
0002 % Manifold of n-by-n symmetric positive semidefinite matrices of rank k
0003 % with trace (sum of diagonal elements) equal to 1.
0004 %
0005 % function M = spectrahedronfactory(n, k)
0006 %
0007 % A point X on the manifold is parameterized as YY^T where Y is a matrix of
0008 % size nxk. As such, X is symmetric, positive semidefinite. We restrict to
0009 % full-rank Y's, such that X has rank exactly k. The point X is numerically
0010 % represented by Y (this is more efficient than working with X, which may
0011 % be big). Tangent vectors are represented as matrices of the same size as
0012 % Y, call them Ydot, so that Xdot = Y Ydot' + Ydot Y and trace(Xdot) == 0.
0013 % The metric is the canonical Euclidean metric on Y.
0014 %
0015 % The trace constraint on X (trace(X) == 1) translates to a unit Frobenius
0016 % norm constraint on Y: trace(X) = norm(Y, 'fro')^2 == 1. The set of such
0017 % Y's forms the unit sphere in R^(nxk): see spherefactory. But because for
0018 % any orthogonal Q of size k, it holds that (YQ)(YQ)' = YY', we "group" all
0019 % matrices of the form YQ in an equivalence class. The set of equivalence
0020 % classes is a Riemannian quotient manifold, implemented here.
0021 %
0022 %
0023 % Note that this geometry formally breaks down at rank-deficient Y's.
0024 % As an alternative, you may use the sphere manifold (it has larger
0025 % dimension (by 1), but does not break down at rank drop.)
0026 %
0027 % The geometry is taken from the 2010 paper:
0028 % M. Journee, P.-A. Absil, F. Bach and R. Sepulchre,
0029 % "Low-Rank Optimization on the Cone of Positive Semidefinite Matrices".
0031 %
0032 %
0033 % Please cite the Manopt paper as well as the research paper:
0034 %     @Article{journee2010low,
0035 %       Title   = {Low-rank optimization on the cone of positive semidefinite matrices},
0036 %       Author  = {Journ{\'e}e, M. and Bach, F. and Absil, P.-A. and Sepulchre, R.},
0037 %       Journal = {SIAM Journal on Optimization},
0038 %       Year    = {2010},
0039 %       Number  = {5},
0040 %       Pages   = {2327--2351},
0041 %       Volume  = {20},
0042 %       Doi     = {10.1137/080731359}
0043 %     }
0044 %
0045 %
0047
0048 % This file is part of Manopt: www.manopt.org.
0049 % Original author: Bamdev Mishra, July 11, 2013.
0050 % Contributors: Nicolas Boumal
0051 % Change log:
0052 %
0053 %   April 2, 2015 (NB):
0054 %       Replaced trace(A'*B) by A(:)'*B(:) (equivalent but faster).
0055 %       Updated documentation.
0056
0057
0058
0059     M.name = @() sprintf('YY'' quotient manifold of %dx%d psd matrices of rank %d with trace 1', n, k);
0060
0061     M.dim = @() n*k - 1 - k*(k-1)/2;
0062
0063     % Euclidean metric on the total space
0064     M.inner = @(Y, eta, zeta) eta(:)'*zeta(:);
0065
0066     M.norm = @(Y, eta) sqrt(M.inner(Y, eta, eta));
0067
0068     M.dist = @(Y, Z) error('spectrahedronfactory.dist not implemented yet.');
0069
0070     M.typicaldist = @() 10*k;
0071
0072     M.proj = @projection;
0073     function etaproj = projection(Y, eta)
0074         % Projection onto the tangent space, i.e., on the tangent space of
0075         % ||Y|| = 1
0076
0077         eta = eta - (eta(:)'*Y(:))*Y;
0078
0079         % Projection onto the horizontal space
0080         YtY = Y'*Y;
0081         SS = YtY;
0082         AS = Y'*eta - eta'*Y;
0083         Omega = lyap(SS, -AS);
0084         etaproj = eta - Y*Omega;
0085     end
0086
0087     M.tangent = M.proj;
0088     M.tangent2ambient = @(Y, eta) eta;
0089
0090     M.retr = @retraction;
0091     function Ynew = retraction(Y, eta, t)
0092         if nargin < 3
0093             t = 1.0;
0094         end
0095         Ynew = Y + t*eta;
0096         Ynew = Ynew/norm(Ynew, 'fro');
0097     end
0098
0099
0101
0102     M.ehess2rhess = @ehess2rhess;
0103     function Hess = ehess2rhess(Y, egrad, ehess, eta)
0104
0105         % Directional derivative of the Riemannian gradient
0106         Hess = ehess - (egrad(:)'*Y(:))*eta - ( (ehess(:)'*Y(:)) + (eta(:)'*egrad(:)) )*Y;
0107         Hess = Hess - (Hess(:)'*Y(:))*Y;
0108
0109         % Project on the horizontal space
0110         Hess = M.proj(Y, Hess);
0111
0112     end
0113
0114     M.exp = @exponential;
0115     function Ynew = exponential(Y, eta, t)
0116         if nargin < 3
0117             t = 1.0;
0118         end
0119
0120         Ynew = retraction(Y, eta, t);
0121         warning('manopt:spectrahedronfactory:exp', ...
0122             ['Exponential for fixed rank spectrahedron ' ...
0123             'manifold not implenented yet. Used retraction instead.']);
0124     end
0125
0126     % Notice that the hash of two equivalent points will be different...
0127     M.hash = @(Y) ['z' hashmd5(Y(:))];
0128
0129     M.rand = @random;
0130
0131     function Y = random()
0132         Y = randn(n, k);
0133         Y = Y/norm(Y,'fro');
0134     end
0135
0136     M.randvec = @randomvec;
0137     function eta = randomvec(Y)
0138         eta = randn(n, k);
0139         eta = projection(Y, eta);
0140         nrm = M.norm(Y, eta);
0141         eta = eta / nrm;
0142     end
0143
0144     M.lincomb = @matrixlincomb;
0145
0146     M.zerovec = @(Y) zeros(n, k);
0147
0148     M.transp = @(Y1, Y2, d) projection(Y2, d);
0149
0150     M.vec = @(Y, u_mat) u_mat(:);
0151     M.mat = @(Y, u_vec) reshape(u_vec, [n, k]);
0152     M.vecmatareisometries = @() true;
0153
0154 end```

Generated on Fri 08-Sep-2017 12:43:19 by m2html © 2005