Sphere and unit norm arrays

Manifolds.AbstractSphere โ€” Type
AbstractSphere{๐”ฝ} <: AbstractEmbeddedManifold{๐”ฝ,DefaultIsometricEmbeddingType}

An abstract type to represent a unit sphere that is represented isometrically in the embedding.

The classical sphere, i.e. unit norm (real- or complex-valued) vectors can be generated as usual: to create the 2-dimensional sphere (in $โ„^3$), use Sphere(2) and Sphere(2,โ„‚), respectively.

Manifolds.Sphere โ€” Type
Sphere{n,๐”ฝ} <: AbstractSphere{๐”ฝ}

The (unit) sphere manifold $๐•Š^{n}$ is the set of all unit norm vectors in $๐”ฝ^{n+1}$. The sphere is represented in the embedding, i.e.

\[๐•Š^{n} := \bigl\{ p \in ๐”ฝ^{n+1}\ \big|\ \lVert p \rVert = 1 \bigr\}\]

where $๐”ฝ\in\{โ„,โ„‚,โ„\}$. Note that compared to the ArraySphere, here the argument n of the manifold is the dimension of the manifold, i.e. $๐•Š^{n} โŠ‚ ๐”ฝ^{n+1}$, $n\in โ„•$.

The tangent space at point $p$ is given by

\[T_p๐•Š^{n} := \bigl\{ X โˆˆ ๐”ฝ^{n+1}\ |\ \Re(โŸจp,XโŸฉ) = 0 \bigr \},\]

where $๐”ฝ\in\{โ„,โ„‚,โ„\}$ and $โŸจ\cdot,\cdotโŸฉ$ denotes the inner product in the embedding $๐”ฝ^{n+1}$.

For $๐”ฝ=โ„‚$, the manifold is the complex sphere, written $โ„‚๐•Š^n$, embedded in $โ„‚^{n+1}$. $โ„‚๐•Š^n$ is the complexification of the real sphere $๐•Š^{2n+1}$. Likewise, the quaternionic sphere $โ„๐•Š^n$ is the quaternionification of the real sphere $๐•Š^{4n+3}$. Consequently, $โ„‚๐•Š^0$ is equivalent to $๐•Š^1$ and Circle, while $โ„‚๐•Š^1$ and $โ„๐•Š^0$ are equivalent to $๐•Š^3$, though with different default representations.

This manifold is modeled as a special case of the more general case, i.e. as an embedded manifold to the Euclidean, and several functions like the inner product and the zero_tangent_vector are inherited from the embedding.

Constructor

Sphere(n[, field=โ„])

Generate the (real-valued) sphere $๐•Š^{n} โŠ‚ โ„^{n+1}$, where field can also be used to generate the complex- and quaternionic-valued sphere.

For the higher-dimensional arrays, for example unit (Frobenius) norm matrices, the manifold is generated using the size of the matrix. To create the unit sphere of $3ร—2$ real-valued matrices, write ArraySphere(3,2) and the complex case is done โ€“ as for the Euclidean case โ€“ with an keyword argument ArraySphere(3,2; field = โ„‚). This case also covers the classical sphere as a special case, but you specify the size of the vectors/embedding instead: The 2-sphere can here be generated ArraySphere(3).

Manifolds.ArraySphere โ€” Type
ArraySphere{T<:Tuple,๐”ฝ} <: AbstractSphere{๐”ฝ}

The (unit) sphere manifold $๐•Š^{nโ‚,nโ‚‚,...,nแตข}$ is the set of all unit (Frobenius) norm elements of $๐”ฝ^{nโ‚,nโ‚‚,...,nแตข}$, where ๐”ฝ\in{โ„,โ„‚,โ„}. The generalized sphere is represented in the embedding, and supports arbitrary sized arrays or in other words arbitrary tensors of unit norm. The set formally reads

\[๐•Š^{n_1, n_2, โ€ฆ, n_i} := \bigl\{ p \in ๐”ฝ^{n_1, n_2, โ€ฆ, n_i}\ \big|\ \lVert p \rVert = 1 \bigr\}\]

where $๐”ฝ\in\{โ„,โ„‚,โ„\}$. Setting $i=1$ and $๐”ฝ=โ„$ this simplifies to unit vectors in $โ„^n$, see Sphere for this special case. Note that compared to this classical case, the argument for the generalized case here is given by the dimension of the embedding. This means that Sphere(2) and ArraySphere(3) are the same manifold.

The tangent space at point $p$ is given by

\[T_p ๐•Š^{n_1, n_2, โ€ฆ, n_i} := \bigl\{ X โˆˆ ๐”ฝ^{n_1, n_2, โ€ฆ, n_i}\ |\ \Re(โŸจp,XโŸฉ) = 0 \bigr \},\]

where $๐”ฝ\in\{โ„,โ„‚,โ„\}$ and $โŸจ\cdot,\cdotโŸฉ$ denotes the (Frobenius) inner product in the embedding $๐”ฝ^{n_1, n_2, โ€ฆ, n_i}$.

This manifold is modeled as an embedded manifold to the Euclidean, i.e. several functions like the inner product and the zero_tangent_vector are inherited from the embedding.

Constructor

ArraySphere(nโ‚,nโ‚‚,...,nแตข; field=โ„)

Generate sphere in $๐”ฝ^{n_1, n_2, โ€ฆ, n_i}$, where $๐”ฝ$ defaults to the real-valued case $โ„$.

Functions on unit spheres

Base.exp โ€” Method
exp(M::AbstractSphere, p, X)

Compute the exponential map from p in the tangent direction X on the AbstractSphereM by following the great arc eminating from p in direction X.

\[\exp_p X = \cos(\lVert X \rVert_p)p + \sin(\lVert X \rVert_p)\frac{X}{\lVert X \rVert_p},\]

where $\lVert X \rVert_p$ is the norm on the tangent space at p of the AbstractSphereM.

Base.log โ€” Method
log(M::AbstractSphere, p, q)

Compute the logarithmic map on the AbstractSphereM, i.e. the tangent vector, whose geodesic starting from p reaches q after time 1. The formula reads for $x โ‰  -y$

\[\log_p q = d_{๐•Š}(p,q) \frac{q-\Re(โŸจp,qโŸฉ) p}{\lVert q-\Re(โŸจp,qโŸฉ) p \rVert_2},\]

and a deterministic choice from the set of tangent vectors is returned if $x=-y$, i.e. for opposite points.

Manifolds.normal_tvector_distribution โ€” Method
normal_tvector_distribution(S::Sphere{n,โ„}, p, ฯƒ)

Generate a distribution in the tangent space at p by generating a normal distribution in ambient space with standard deviation ฯƒ projected to the tangent space at p.

Manifolds.uniform_distribution โ€” Method
uniform_distribution(M::Sphere{n,โ„}, p) where {n}

Uniform distribution on given SphereM. Generated points will be of similar type as p.

ManifoldsBase.check_manifold_point โ€” Method
check_manifold_point(M::AbstractSphere, p; kwargs...)

Check whether p is a valid point on the AbstractSphereM, i.e. is a point in the embedding of unit length. The tolerance for the last test can be set using the kwargs....

ManifoldsBase.check_tangent_vector โ€” Method
check_tangent_vector(M::AbstractSphere, p, X; check_base_point = true, kwargs... )

Check whether X is a tangent vector to p on the AbstractSphereM, i.e. after check_manifold_point(M,p), X has to be of same dimension as p and orthogonal to p. The optional parameter check_base_point indicates, whether to call check_manifold_point for p or not. The tolerance for the last test can be set using the kwargs....

ManifoldsBase.distance โ€” Method
distance(M::AbstractSphere, p, q)

Compute the geodesic distance betweeen p and q on the AbstractSphereM. The formula is given by the (shorter) great arc length on the (or a) great circle both p and q lie on.

\[d_{๐•Š}(p,q) = \arccos(\Re(โŸจp,qโŸฉ)).\]

ManifoldsBase.get_coordinates โ€” Method
get_coordinates(M::AbstractSphere{โ„}, p, X, B::DefaultOrthonormalBasis)

Represent the tangent vector X at point p from the AbstractSphereM in an orthonormal basis by rotating the hyperplane containing X to a hyperplane whose normal is the $x$-axis.

Given $q = p ฮป + x$, where $ฮป = \operatorname{sgn}(โŸจx, pโŸฉ)$, and $โŸจโ‹…, โ‹…โŸฉ_{\mathrm{F}}$ denotes the Frobenius inner product, the formula for $Y$ is

\[\begin{pmatrix}0 \\ Y\end{pmatrix} = X - q\frac{2 โŸจq, XโŸฉ_{\mathrm{F}}}{โŸจq, qโŸฉ_{\mathrm{F}}}.\]

ManifoldsBase.get_vector โ€” Method
get_vector(M::AbstractSphere{โ„}, p, X, B::DefaultOrthonormalBasis)

Convert a one-dimensional vector of coefficients X in the basis B of the tangent space at p on the AbstractSphereM to a tangent vector Y at p by rotating the hyperplane containing X, whose normal is the $x$-axis, to the hyperplane whose normal is p.

Given $q = p ฮป + x$, where $ฮป = \operatorname{sgn}(โŸจx, pโŸฉ)$, and $โŸจโ‹…, โ‹…โŸฉ_{\mathrm{F}}$ denotes the Frobenius inner product, the formula for $Y$ is

\[Y = X - q\frac{2 \left\langle q, \begin{pmatrix}0 \\ X\end{pmatrix}\right\rangle_{\mathrm{F}}}{โŸจq, qโŸฉ_{\mathrm{F}}}.\]

ManifoldsBase.inverse_retract โ€” Method
inverse_retract(M::AbstractSphere, p, q, ::ProjectionInverseRetraction)

Compute the inverse of the projection based retraction on the AbstractSphereM, i.e. rearranging $p+X = q\lVert p+X\rVert_2$ yields since $\Re(โŸจp,XโŸฉ) = 0$ and when $d_{๐•Š^2}(p,q) โ‰ค \frac{ฯ€}{2}$ that

\[\operatorname{retr}_p^{-1}(q) = \frac{q}{\Re(โŸจp, qโŸฉ)} - p.\]

ManifoldsBase.project โ€” Method
project(M::AbstractSphere, p, X)

Project the point X onto the tangent space at p on the SphereM.

\[\operatorname{proj}_{p}(X) = X - \Re(โŸจp, XโŸฉ)p\]

ManifoldsBase.project โ€” Method
project(M::AbstractSphere, p)

Project the point p from the embedding onto the SphereM.

\[\operatorname{proj}(p) = \frac{p}{\lVert p \rVert},\]

where $\lVert\cdot\rVert$ denotes the usual 2-norm for vectors if $m=1$ and the Frobenius norm for the case $m>1$.

ManifoldsBase.retract โ€” Method
retract(M::AbstractSphere, p, X, ::ProjectionRetraction)

Compute the retraction that is based on projection, i.e.

\[\operatorname{retr}_p(X) = \frac{p+X}{\lVert p+X \rVert_2}\]

ManifoldsBase.vector_transport_to โ€” Method
vector_transport_to(M::AbstractSphere, p, X, q, ::ParallelTransport)

Compute the parallel transport on the Sphere of the tangent vector X at p to q, provided, the geodesic between p and q is unique. The formula reads

\[P_{pโ†q}(X) = X - \frac{\Re(โŸจ\log_p q,XโŸฉ_p)}{d^2_๐•Š(p,q)} \bigl(\log_p q + \log_q p \bigr).\]