Specific manifold functions
This small section extends the functions available from ManifoldsBase.jl and Manifolds.jl, especially a few random generators, that are simpler than the available functions.
ManifoldsBase.mid_point
— Methodmid_point(M, p, q, x)
mid_point!(M, y, p, q, x)
Compute the mid point between p
and q
. If there is more than one mid point of (not neccessarily minimizing) geodesics (e.g. on the sphere), the one nearest to x
is returned (in place of y
).
Manopt.reflect
— Methodreflect(M, p, x)
reflect!(M, q, p, x)
reflect the point x
from the manifold M
at point p
, i.e.
\[ \operatorname{refl}_p(x) = \exp_p(-\log_p x).\]
where exp and log denote the exponential and logarithmic map on M
. This can also be done in place of q
.
Manopt.reflect
— Methodreflect(M, f, x)
reflect!(M, q, f, x)
reflect the point x
from the manifold M
at the point f(x)
of the function $f: \mathcal M → \mathcal M$, i.e.,
\[ \operatorname{refl}_f(x) = \operatorname{refl}_{f(x)}(x),\]
Compute the result in q
.
see also reflect
(M,p,x)
.
Simplified random functions
While statistics are available in Manifolds.jl, the following functions provide default random points and vectors on manifolds.
Manopt.random_point
— Functionrandom_point(M::Sphere, :Gaussian[, σ=1.0])
return a random point on the Sphere by projecting a normal distributed vector from within the embedding to the sphere.
Manopt.random_point
— Functionrandom_point(M::Rotations, :Gaussian [, σ=1.0])
return a random point p
on the manifold Rotations
by generating a (Gaussian) random orthogonal matrix with determinant $+1$. Let $QR = A$ be the QR decomposition of a random matrix $A$, then the formula reads $p = QD$ where $D$ is a diagonal matrix with the signs of the diagonal entries of $R$, i.e.
\[D_{ij}=\begin{cases} \operatorname{sgn}(R_{ij}) & \text{if} \; i=j \\ 0 & \, \text{otherwise.} \end{cases}\]
It can happen that the matrix gets -1 as a determinant. In this case, the first and second columns are swapped.
Manopt.random_point
— Methodrandom_point(M::AbstractManifold, s::Symbol, options...)
generate a random point using a noise model given by s
with its additional options
just passed on.
Manopt.random_point
— Methodrandom_point(M::AbstractManifold)
generate a random point on a manifold. By default it uses random_point(M,:Gaussian)
.
Manopt.random_point
— Methodrandom_point(M::Circle, :Uniform)
return a random point on the Circle
$\mathbb S^1$ by picking a random element from $[-\pi,\pi)$ uniformly.
Manopt.random_point
— Methodrandom_point(M::Euclidean[,:Gaussian, σ::Float64=1.0])
generate a random point on the Euclidean
manifold M
, where the optional parameter determines the type of the entries of the resulting point on the Euclidean space d.
Manopt.random_point
— Methodrandom_point(M::ProductManifold, options...)
return a random point x
on Grassmannian
manifold M
by generating a random (Gaussian) matrix with standard deviation σ
in matching size, which is orthonormal.
Manopt.random_point
— Methodrandom_point(M::TangentBundle, options...)
generate a random point on the tangent bundle by calling a random_point
and a random_tangent
with the given options...
Manopt.random_point
— Methodrandom_point(M::TangentSpaceAtPoint, options...)
generate a random point in the the tangent space of M.point
with the given options...
.
Manopt.random_point
— Methodrandom_point(M::AbstractPowerManifold, options...)
generate a random point on the AbstractPowerManifold
M
given options
that are passed on.
Manopt.random_point
— Methodrandom_point(M::SymmetricPositiveDefinite, :Gaussian[, σ=1.0])
generate a random symmetric positive definite matrix on the SymmetricPositiveDefinite
manifold M
.
Manopt.random_point
— Methodrandom_point(M::FixedRankMatrices, options...)
return a random point on the FixedRankMatrices manifold. The orthogonal matrices are sampled from the Stiefel manifold and the singular values are sampled uniformly at random.
Manopt.random_point
— Methodrandom_point(M::Grassmannian, :Gaussian [, σ=1.0])
return a random point x
on Grassmannian
manifold M
by generating a random (Gaussian) matrix with standard deviation σ
in matching size, which is orthonormal.
Manopt.random_point
— Methodrandom_point(M::Stiefel, :Gaussian[, σ=1.0])
return a random (Gaussian) point x
on the Stiefel
manifold M
by generating a (Gaussian) matrix with standard deviation σ
and return the orthogonalized version, i.e. return the Q component of the QR decomposition of the random matrix of size $n×k$.
Manopt.random_tangent
— Functionrandom_tangent(M::SymmetricPositiveDefinite, p, :Rician [,σ = 0.01])
generate a random tangent vector in the tangent space of p
on the SymmetricPositiveDefinite
manifold M
by using a Rician distribution with standard deviation σ
.
Manopt.random_tangent
— Functionrandom_tangent(M::Sphere, p[, :Gaussian, σ=1.0])
return a random tangent vector in the tangent space of p
on the Sphere
M
.
Manopt.random_tangent
— Functionrandom_tangent(M::Stiefel, p[,type=:Gaussian, σ=1.0])
return a (Gaussian) random vector from the tangent space $T_p\mathrm{St}(n,k)$ with mean zero and standard deviation σ
by projecting a random Matrix onto the p
.
Manopt.random_tangent
— Functionrandom_tangent(M::Circle, p [, :Gaussian, σ=1.0])
return a random tangent vector from the tangent space of the point p
on the Circle $\mathbb S^1$ by using a normal distribution with mean 0 and standard deviation 1.
Manopt.random_tangent
— Functionrandom_tangent(M::Grassmann, p[,type=:Gaussian, σ=1.0])
return a (Gaussian) random vector from the tangent space $T_p\mathrm{Gr}(n,k)$ with mean zero and standard deviation σ
by projecting a random Matrix onto the p
.
Manopt.random_tangent
— Functionrandom_tangent(M::Hyperbolic, p, :Gaussian [, σ=1.0])
generate a random point on the Hyperbolic manifold by projecting a point from the embedding with respect to the Minkowski metric.
Manopt.random_tangent
— Functionrandom_tangent(M::Rotations, p[, type=:Gaussian, σ=1.0])
return a random tangent vector in the tangent space $T_x\mathrm{SO}(n)$ of the point x
on the Rotations
manifold M
by generating a random skew-symmetric matrix. The function takes the real upper triangular matrix of a (Gaussian) random matrix $A$ with dimension $n\times n$ and subtracts its transposed matrix. Finally, the matrix is normalized.
Manopt.random_tangent
— Functionrandom_tangent(M::SymmetricPositiveDefinite, p[, :Gaussian, σ = 1.0])
generate a random tangent vector in the tangent space of the point p
on the SymmetricPositiveDefinite
manifold M
by using a Gaussian distribution with standard deviation σ
on an ONB of the tangent space.
Manopt.random_tangent
— Methodrandom_tangent(M, p, options...)
generate a random tangent vector in the tangent space of p
on M
. By default this is a :Gaussian
distribution.
Manopt.random_tangent
— Methodrandom_tangent(M::ProductManifold, p)
generate a random tangent vector in the tangent space of the point p
on the ProductManifold
M
.
Manopt.random_tangent
— Methodrandom_tangent(M::TangentBundle, p, options...)
generate a random tangent vector at p
on the tangent bundle by calling random_tangent
with the given options...
twice.
Manopt.random_tangent
— Methodrandom_tangent(M::TangentSpaceAtPoint, _, options...)
generate a random tangent vector from the tangent space of M.point
with the given options...
, which is the same as generating a point in the tangent space at M.point
.
Manopt.random_tangent
— Methodrandom_tangent(M::FixedRankMatrices, p, options...)
generate a random tangent vector in the tangent space of the point p
on the FixedRankMatrices
manifold M
.