Skip to contents

Applies the Riemannian logarithm of \(Gr(n, k)\) at base point \(U_0\), computed with Algorithm 5.3 of Bendokat, Zimmermann and Absil (2021). The result for each row is the horizontal lift \(\Delta\), an n x k matrix with \(U_0^T \Delta = 0\) whose singular values are the principal angles between the two subspaces. It is expressed in the coordinates \(B = U_\perp^T \Delta\), where \(U_\perp\) is a fixed orthonormal basis of the orthogonal complement of \(U_0\), and returned as as.vector(B), of length \((n-k)k\). This identification is an isometry: the Euclidean norm of the coordinates is the geodesic distance to \(U_0\). Points on the cut locus of \(U_0\) (see is_valid_grassmann) are mapped to the boundary of the cut domain, where the logarithm is not unique.

Usage

log_map_grassmann(X, p, n, k)

Arguments

X

A matrix or data frame of Grassmann data; rows are samples, with n * k columns (see manifold_grassmann).

p

The base point: a vector of length n * k or an n x k matrix with orthonormal columns.

n

Integer: dimension of the ambient space.

k

Integer: dimension of the subspaces, 1 <= k <= n - 1.

Value

A numeric matrix with nrow(X) rows and (n - k) * k columns: the tangent-space coordinates of each row of X.

References

Bendokat, T., Zimmermann, R. and Absil, P.-A. (2021). A Grassmann manifold handbook: basic geometry and computational aspects. arXiv:2011.13699.

Examples

U0 <- diag(4)[, 1:2]
X <- exp_map_grassmann(matrix(rnorm(40, sd = 0.3), nrow = 10), U0)
log_map_grassmann(X, U0, n = 4, k = 2)
#>              [,1]        [,2]        [,3]        [,4]
#>  [1,]  0.40914135  0.34327469  0.30770553 -0.23471375
#>  [2,] -0.21345724 -0.37167307 -0.21923358 -0.19923148
#>  [3,]  0.19865364  0.79646950 -0.05704365  0.18789293
#>  [4,]  0.08733907 -0.04707516  0.15865941 -0.15217446
#>  [5,]  0.05938740 -0.12704704  0.16506316  0.08110840
#>  [6,] -0.36106983 -0.05951612  0.16490530  0.14024306
#>  [7,] -0.01194511 -0.26844072 -0.19786271  0.21719849
#>  [8,]  0.20609474  0.27128074  0.01722651  0.18415108
#>  [9,]  0.21158010  0.02389476 -0.84240315 -0.18536076
#> [10,]  0.29743250 -0.37764817 -0.27367793  0.06621747