Stiefel
Common and metric independent functions
Manifolds.CayleyRetraction
— TypeCayleyRetraction <: AbstractRetractionMethod
A retraction based on the Cayley transform, which is realized by using the PadeRetraction
{1}
.
Manifolds.PadeRetraction
— TypePadeRetraction{m} <: AbstractRetractionMethod
A retraction based on the Padé approximation of order $m$
Manifolds.Stiefel
— TypeStiefel{n,k,𝔽} <: AbstractEmbeddedManifold{𝔽,DefaultIsometricEmbeddingType}
The Stiefel manifold consists of all $n × k$, $n ≥ k$ unitary matrices, i.e.
\[\operatorname{St}(n,k) = \bigl\{ p ∈ 𝔽^{n × k}\ \big|\ p^{\mathrm{H}}p = I_k \bigr\},\]
where $𝔽 ∈ \{ℝ, ℂ\}$, $\cdot^{\mathrm{H}}$ denotes the complex conjugate transpose or Hermitian, and $I_k ∈ ℝ^{k × k}$ denotes the $k × k$ identity matrix.
The tangent space at a point $p ∈ \mathcal M$ is given by
\[T_p \mathcal M = \{ X ∈ 𝔽^{n × k} : p^{\mathrm{H}}X + \overline{X^{\mathrm{H}}p} = 0_k\},\]
where $0_k$ is the $k × k$ zero matrix and $\overline{\cdot}$ the (elementwise) complex conjugate.
This manifold is modeled as an embedded manifold to the Euclidean
, i.e. several functions like the inner
product and the zero_vector
are inherited from the embedding.
The manifold is named after Eduard L. Stiefel (1909–1978).
Constructor
Stiefel(n, k, field = ℝ)
Generate the (real-valued) Stiefel manifold of $n × k$ dimensional orthonormal matrices.
Manifolds.uniform_distribution
— Methoduniform_distribution(M::Stiefel{n,k,ℝ}, p)
Uniform distribution on given (real-valued) Stiefel
M
. Specifically, this is the normalized Haar and Hausdorff measure on M
. Generated points will be of similar type as p
.
The implementation is based on Section 2.5.1 in [Chikuse2003]; see also Theorem 2.2.1(iii) in [Chikuse2003].
ManifoldsBase.check_point
— Methodcheck_point(M::Stiefel, p; kwargs...)
Check whether p
is a valid point on the Stiefel
M
=$\operatorname{St}(n,k)$, i.e. that it has the right AbstractNumbers
type and $p^{\mathrm{H}}p$ is (approximately) the identity, where $\cdot^{\mathrm{H}}$ is the complex conjugate transpose. The settings for approximately can be set with kwargs...
.
ManifoldsBase.check_vector
— Methodcheck_vector(M::Stiefel, p, X; kwargs...)
Checks whether X
is a valid tangent vector at p
on the Stiefel
M
=$\operatorname{St}(n,k)$, i.e. the AbstractNumbers
fits and it (approximately) holds that $p^{\mathrm{H}}X + \overline{X^{\mathrm{H}}p} = 0$, where $\cdot^{\mathrm{H}}$ denotes the Hermitian and $\overline{\cdot}$ the (elementwise) complex conjugate. The settings for approximately can be set with kwargs...
.
ManifoldsBase.inverse_retract
— Methodinverse_retract(M::Stiefel, p, q, ::PolarInverseRetraction)
Compute the inverse retraction based on a singular value decomposition for two points p
, q
on the Stiefel
manifold M
. This follows the folloing approach: From the Polar retraction we know that
\[\operatorname{retr}_p^{-1}q = qs - t\]
if such a symmetric positive definite $k × k$ matrix exists. Since $qs - t$ is also a tangent vector at $p$ we obtain
\[p^{\mathrm{H}}qs + s(p^{\mathrm{H}}q)^{\mathrm{H}} + 2I_k = 0,\]
which can either be solved by a Lyapunov approach or a continuous-time algebraic Riccati equation.
This implementation follows the Lyapunov approach.
ManifoldsBase.inverse_retract
— Methodinverse_retract(M::Stiefel, p, q, ::QRInverseRetraction)
Compute the inverse retraction based on a qr decomposition for two points p
, q
on the Stiefel
manifold M
and return the resulting tangent vector in X
. The computation follows Algorithm 1 in [KanekoFioriTanaka2013].
ManifoldsBase.manifold_dimension
— Methodmanifold_dimension(M::Stiefel)
Return the dimension of the Stiefel
manifold M
=$\operatorname{St}(n,k,𝔽)$. The dimension is given by
\[\begin{aligned} \dim \mathrm{St}(n, k, ℝ) &= nk - \frac{1}{2}k(k+1)\\ \dim \mathrm{St}(n, k, ℂ) &= 2nk - k^2\\ \dim \mathrm{St}(n, k, ℍ) &= 4nk - k(2k-1) \end{aligned}\]
ManifoldsBase.representation_size
— Methodrepresentation_size(M::Stiefel)
Returns the representation size of the Stiefel
M
=$\operatorname{St}(n,k)$, i.e. (n,k)
, which is the matrix dimensions.
ManifoldsBase.retract
— Methodretract(::Stiefel, p, X, ::CayleyRetraction)
Compute the retraction on the Stiefel
that is based on the Cayley transform[Zhu2017]. Using
\[ W_{p,X} = \operatorname{P}_pXp^{\mathrm{H}} - pX^{\mathrm{H}}\operatorname{P_p} \quad\text{where} \operatorname{P}_p = I - \frac{1}{2}pp^{\mathrm{H}}\]
the formula reads
\[ \operatorname{retr}_pX = \Bigl(I - \frac{1}{2}W_{p,X}\Bigr)^{-1}\Bigl(I + \frac{1}{2}W_{p,X}\Bigr)p.\]
It is implemented as the case $m=1$ of the PadeRetraction
.
ManifoldsBase.retract
— Methodretract(M::Stiefel, p, X, ::PadeRetraction{m})
Compute the retraction on the Stiefel
manifold M
based on the Padé approximation of order $m$[ZhuDuan2018]. Let $p_m$ and $q_m$ be defined for any matrix $A ∈ ℝ^{n×x}$ as
\[ p_m(A) = \sum_{k=0}^m \frac{(2m-k)!m!}{(2m)!(m-k)!}\frac{A^k}{k!}\]
and
\[ q_m(A) = \sum_{k=0}^m \frac{(2m-k)!m!}{(2m)!(m-k)!}\frac{(-A)^k}{k!}\]
respectively. Then the Padé approximation (of the matrix exponential $\exp(A)$) reads
\[ r_m(A) = q_m(A)^{-1}p_m(A)\]
Defining further
\[ W_{p,X} = \operatorname{P}_pXp^{\mathrm{H}} - pX^{\mathrm{H}}\operatorname{P_p} \quad\text{where} \operatorname{P}_p = I - \frac{1}{2}pp^{\mathrm{H}}\]
the retraction reads
\[ \operatorname{retr}_pX = r_m(W_{p,X})p\]
ManifoldsBase.retract
— Methodretract(M::Stiefel, p, X, ::PolarRetraction)
Compute the SVD-based retraction PolarRetraction
on the Stiefel
manifold M
. With $USV = p + X$ the retraction reads
\[\operatorname{retr}_p X = U\bar{V}^\mathrm{H}.\]
ManifoldsBase.retract
— Methodretract(M::Stiefel, p, X, ::QRRetraction)
Compute the QR-based retraction QRRetraction
on the Stiefel
manifold M
. With $QR = p + X$ the retraction reads
\[\operatorname{retr}_p X = QD,\]
where $D$ is a $n × k$ matrix with
\[D = \operatorname{diag}\bigl(\operatorname{sgn}(R_{ii}+0,5)_{i=1}^k \bigr),\]
where $\operatorname{sgn}(p) = \begin{cases} 1 & \text{ for } p > 0,\\ 0 & \text{ for } p = 0,\\ -1& \text{ for } p < 0. \end{cases}$
ManifoldsBase.vector_transport_direction
— Methodvector_transport_direction(::Stiefel, p, X, d, ::DifferentiatedRetractionVectorTransport{CayleyRetraction})
Compute the vector transport given by the differentiated retraction of the CayleyRetraction
, cf. [Zhu2017] Equation (17).
The formula reads
\[\operatorname{T}_{p,d}(X) = \Bigl(I - \frac{1}{2}W_{p,d}\Bigr)^{-1}W_{p,X}\Bigl(I - \frac{1}{2}W_{p,d}\Bigr)^{-1}p,\]
with
\[ W_{p,X} = \operatorname{P}_pXp^{\mathrm{H}} - pX^{\mathrm{H}}\operatorname{P_p} \quad\text{where} \operatorname{P}_p = I - \frac{1}{2}pp^{\mathrm{H}}\]
Since this is the differentiated retraction as a vector transport, the result will be in the tangent space at $q=\operatorname{retr}_p(d)$ using the CayleyRetraction
.
ManifoldsBase.vector_transport_direction
— Methodvector_transport_direction(M::Stiefel, p, X, d, DifferentiatedRetractionVectorTransport{PolarRetraction})
Compute the vector transport by computing the push forward of retract(::Stiefel, ::Any, ::Any, ::PolarRetraction)
Section 3.5 of [Zhu2017]:
\[T_{p,d}^{\text{Pol}}(X) = q*Λ + (I-qq^{\mathrm{T}})X(1+d^\mathrm{T}d)^{-\frac{1}{2}},\]
where $q = \operatorname{retr}^{\mathrm{Pol}}_p(d)$, and $Λ$ is the unique solution of the Sylvester equation
\[ Λ(I+d^\mathrm{T}d)^{\frac{1}{2}} + (I + d^\mathrm{T}d)^{\frac{1}{2}} = q^\mathrm{T}X - X^\mathrm{T}q\]
ManifoldsBase.vector_transport_direction
— Methodvector_transport_direction(M::Stiefel, p, X, d, DifferentiatedRetractionVectorTransport{QRRetraction})
Compute the vector transport by computing the push forward of the retract(::Stiefel, ::Any, ::Any, ::QRRetraction)
, See [AbsilMahonySepulchre2008], p. 173, or Section 3.5 of [Zhu2017].
\[T_{p,d}^{\text{QR}}(X) = q*\rho_{\mathrm{s}}(q^\mathrm{T}XR^{-1}) + (I-qq^{\mathrm{T}})XR^{-1},\]
where $q = \operatorname{retr}^{\mathrm{QR}}_p(d)$, $R$ is the $R$ factor of the QR decomposition of $p + d$, and
\[\bigl( \rho_{\mathrm{s}}(A) \bigr)_{ij} = \begin{cases} A_{ij}&\text{ if } i > j\\ 0 \text{ if } i = j\\ -A_{ji} \text{ if } i < j.\\ \end{cases}\]
ManifoldsBase.vector_transport_to
— Methodvector_transport_to(M::Stiefel, p, X, q, DifferentiatedRetractionVectorTransport{PolarRetraction})
Compute the vector transport by computing the push forward of the retract(M::Stiefel, ::Any, ::Any, ::PolarRetraction)
, see Section 4 of [HuangGallivanAbsil2015] or Section 3.5 of [Zhu2017]:
\[T_{q\gets p}^{\text{Pol}}(X) = q*Λ + (I-qq^{\mathrm{T}})X(1+d^\mathrm{T}d)^{-\frac{1}{2}},\]
where $d = \bigl( \operatorname{retr}^{\mathrm{Pol}}_p\bigr)^{-1}(q)$, and $Λ$ is the unique solution of the Sylvester equation
\[ Λ(I+d^\mathrm{T}d)^{\frac{1}{2}} + (I + d^\mathrm{T}d)^{\frac{1}{2}} = q^\mathrm{T}X - X^\mathrm{T}q\]
ManifoldsBase.vector_transport_to
— Methodvector_transport_to(M::Stiefel, p, X, q, DifferentiatedRetractionVectorTransport{QRRetraction})
Compute the vector transport by computing the push forward of the retract(M::Stiefel, ::Any, ::Any, ::QRRetraction)
, see [AbsilMahonySepulchre2008], p. 173, or Section 3.5 of [Zhu2017].
\[T_{q \gets p}^{\text{QR}}(X) = q*\rho_{\mathrm{s}}(q^\mathrm{T}XR^{-1}) + (I-qq^{\mathrm{T}})XR^{-1},\]
where $d = \bigl(\operatorname{retr}^{\mathrm{QR}}\bigr)^{-1}_p(q)$, $R$ is the $R$ factor of the QR decomposition of $p+X$, and
\[\bigl( \rho_{\mathrm{s}}(A) \bigr)_{ij} = \begin{cases} A_{ij}&\text{ if } i > j\\ 0 \text{ if } i = j\\ -A_{ji} \text{ if } i < j.\\ \end{cases}\]
ManifoldsBase.vector_transport_to
— Methodvector_transport_to(M::Stiefel, p, X, q, ::ProjectionTransport)
Compute a vector transport by projection, i.e. project X
from the tangent space at p
by projection it onto the tangent space at q
.
Default metric: the Euclidean metric
The EuclideanMetric
is obtained from the embedding of the Stiefel manifold in $ℝ^{n,k}$.
Base.exp
— Methodexp(M::Stiefel, p, X)
Compute the exponential map on the Stiefel
{n,k,𝔽}
() manifold M
emanating from p
in tangent direction X
.
\[\exp_p X = \begin{pmatrix} p\\X \end{pmatrix} \operatorname{Exp} \left( \begin{pmatrix} p^{\mathrm{H}}X & - X^{\mathrm{H}}X\\ I_n & p^{\mathrm{H}}X\end{pmatrix} \right) \begin{pmatrix} \exp( -p^{\mathrm{H}}X) \\ 0_n\end{pmatrix},\]
where $\operatorname{Exp}$ denotes matrix exponential, $\cdot^{\mathrm{H}}$ denotes the complex conjugate transpose or Hermitian, and $I_k$ and $0_k$ are the identity matrix and the zero matrix of dimension $k × k$, respectively.
ManifoldsBase.get_basis
— Methodget_basis(M::Stiefel{n,k,ℝ}, p, B::DefaultOrthonormalBasis) where {n,k}
Create the default basis using the parametrization for any $X ∈ T_p\mathcal M$. Set $p_\bot \in ℝ^{n\times(n-k)}$ the matrix such that the $n\times n$ matrix of the common columns $[p\ p_\bot]$ is an ONB. For any skew symmetric matrix $a ∈ ℝ^{k\times k}$ and any $b ∈ ℝ^{(n-k)\times k}$ the matrix
\[X = pa + p_\bot b ∈ T_p\mathcal M\]
and we can use the $\frac{1}{2}k(k-1) + (n-k)k = nk-\frac{1}{2}k(k+1)$ entries of $a$ and $b$ to specify a basis for the tangent space. using unit vectors for constructing both the upper matrix of $a$ to build a skew symmetric matrix and the matrix b, the default basis is constructed.
Since $[p\ p_\bot]$ is an automorphism on $ℝ^{n\times p}$ the elements of $a$ and $b$ are orthonormal coordinates for the tangent space. To be precise exactly one element in the upper trangular entries of $a$ is set to $1$ its symmetric entry to $-1$ and we normalize with the factor $\frac{1}{\sqrt{2}}$ and for $b$ one can just use unit vectors reshaped to a matrix to obtain orthonormal set of parameters.
ManifoldsBase.project
— Methodproject(M::Stiefel,p)
Projects p
from the embedding onto the Stiefel
M
, i.e. compute q
as the polar decomposition of $p$ such that $q^{\mathrm{H}q$ is the identity, where $\cdot^{\mathrm{H}}$ denotes the hermitian, i.e. complex conjugate transposed.
ManifoldsBase.project
— Methodproject(M::Stiefel, p, X)
Project X
onto the tangent space of p
to the Stiefel
manifold M
. The formula reads
\[\operatorname{proj}_{\mathcal M}(p, X) = X - p \operatorname{Sym}(p^{\mathrm{H}}X),\]
where $\operatorname{Sym}(q)$ is the symmetrization of $q$, e.g. by $\operatorname{Sym}(q) = \frac{q^{\mathrm{H}}+q}{2}$.
The canonical metric
Any $X∈T_p\mathcal M$, $p∈\mathcal M$, can be written as
\[X = pA + (I_n-pp^{\mathrm{T}})B, \quad A ∈ ℝ^{p×p} \text{ skew-symmetric}, \quad B ∈ ℝ^{n×p} \text{ arbitrary.}\]
In the EuclideanMetric
, the elements from $A$ are counted twice (i.e. weighted with a factor of 2). The canonical metric avoids this.
Manifolds.ApproximateLogarithmicMap
— TypeApproximateLogarithmicMap <: ApproximateInverseRetraction
An approximate implementation of the logarithmic map, which is an inverse_retract
ion. See inverse_retract(::MetricManifold{ℝ,Stiefel{n,k,ℝ},CanonicalMetric}, ::Any, ::Any, ::ApproximateLogarithmicMap) where {n,k}
for a use case.
Fields
max_iterations
– maximal number of iterations used in the approximationtolerance
– a tolerance used as a stopping criterion
Manifolds.CanonicalMetric
— TypeCanonicalMetric <: AbstractMetric
The Canonical Metric refers to a metric for the Stiefel
manifold, see[EdelmanAriasSmith1998].
Base.exp
— Methodq = exp(M::MetricManifold{ℝ, Stiefel{n,k,ℝ}, CanonicalMetric}, p, X)
exp!(M::MetricManifold{ℝ, Stiefel{n,k,ℝ}, q, CanonicalMetric}, p, X)
Compute the exponential map on the Stiefel
(n,k)
manifold with respect to the CanonicalMetric
.
First, decompose The tangent vector $X$ into its horizontal and vertical component with respect to $p$, i.e.
\[X = pp^{\mathrm{T}}X + (I_n-pp^{\mathrm{T}})X,\]
where $I_n$ is the $n\times n$ identity matrix. We introduce $A=p^{\mathrm{T}}X$ and $QR = (I_n-pp^{\mathrm{T}})X$ the qr
decomposition of the vertical component. Then using the matrix exponential $\operatorname{Exp}$ we introduce $B$ and $C$ as
\[\begin{pmatrix} B\\C \end{pmatrix} \coloneqq \operatorname{Exp}\left( \begin{pmatrix} A & -R^{\mathrm{T}}\\ R & 0 \end{pmatrix} \right) \begin{pmatrix}I_k\\0\end{pmatrix}\]
the exponential map reads
\[q = \exp_p X = pC + QB.\]
For more details, see [EdelmanAriasSmith1998][Zimmermann2017].
ManifoldsBase.inner
— Methodinner(M::MetricManifold{ℝ, Stiefel{n,k,ℝ}, X, CanonicalMetric}, p, X, Y)
compute the inner procuct on the Stiefel
manifold with respect to the CanonicalMetric
. The formula reads
\[g_p(X,Y) = \operatorname{tr}\bigl( X^{\mathrm{T}}(I_n - \frac{1}{2}pp^{\mathrm{T}})Y \bigr).\]
ManifoldsBase.inverse_retract
— MethodX = inverse_retract(M::MetricManifold{ℝ, Stiefel{n,k,ℝ}, CanonicalMetric}, p, q, a::ApproximateLogarithmicMap)
inverse_retract!(M::MetricManifold{ℝ, Stiefel{n,k,ℝ}, X, CanonicalMetric}, p, q, a::ApproximateLogarithmicMap)
Compute an approximation to the logarithmic map on the Stiefel
(n,k)
manifold with respect to the CanonicalMetric
using a matrix-algebraic based approach to an iterative inversion of the formula of the exp
.
The algorithm is derived in[Zimmermann2017] and it uses the max_iterations
and the tolerance
field from the ApproximateLogarithmicMap
.
Literature
- Chikuse2003
Y. Chikuse: "Statistics on Special Manifolds", Springer New York, 2003, doi: 10.1007/978-0-387-21540-2.
- KanekoFioriTanaka2013
T. Kaneko, S. Fiori, T. Tanaka: "Empirical Arithmetic Averaging over the Compact Stiefel AbstractManifold", IEEE Transactions on Signal Processing, 2013, doi: 10.1109/TSP.2012.2226167.
- Zhu2017
X. Zhu: A Riemannian conjugate gradient method for optimizazion on the Stiefel manifold, Computational Optimization and Applications 67(1), pp. 73–110, 2017. doi 10.1007/s10589-016-9883-4.
- ZhuDuan2018
X. Zhu, C. Duan: On matrix exponentials and their approximations related to optimization on the Stiefel manifold, Optimizazion Letters 13(5), pp. 1069–1083, 2018. doi 10.1007/s11590-018-1341-z.
- AbsilMahonySepulchre2008
Absil, P.-A., Mahony, R. and Sepulchre R., Optimization Algorithms on Matrix Manifolds Princeton University Press, 2008, doi: 10.1515/9781400830244 open access
- HuangGallivanAbsil2015
Huang, W., Gallivan, K. A., and Absil, P.-A.: A Broyden class of quasi-Newton methods for Riemannian optimization SIAM Journal of Optimization, 2015, Vol. 25, No. 3, pp. 1660–1685 doi: 10.1137/140955483 pdf: tech. report
- EdelmanAriasSmith1998
Edelman, A., Ariar, T. A., Smith, S. T.: The Geometry of Algorihthms with Orthogonality Constraints, SIAM Journal on Matrix Analysis and Applications (20(2), pp. 303–353, 1998. doi: 10.1137/S0895479895290954 arxiv: 9806030
- Zimmermann2017
Zimmermann, R.: _A matrix-algebraic algorithm for the Riemannian logarithm on the Stiefel manifold under the canoncial metric. SIAM Journal on Matrix Analysis and Applications 28(2), pp. 322-342, 2017. doi: 10.1137/16M1074485, arXiv: 1604.05054.