Orthogonal and Unitary matrices
Both OrthogonalMatrices and UnitaryMatrices have similar formulae and implementations, as are Rotations, as well as unitary matrices with determinant equal to one. These share a common implementation.
Orthogonal matrices
Manifolds.OrthogonalMatrices — Type
OrthogonalMatrices{n} = GeneralUnitaryMatrices{ℝ, n, AbsoluteDeterminantOneMatrixType}The manifold of (real) orthogonal $n×n$ matrices $\mathrm{O}(n)$. They are precisely the $n×n$ real matrices $M$ that satisfy
\[ M^{T}M=MM^{T}= \mathrm{I}_n,\]
where $M^{T}$ is the transpose of $M$ and $\mathrm{I}_n$ is the $n×n$ identity matrix. Thus, their columns and rows represent $n$ pairwise orthonormal vectors. Such matrices $M$ have the property that $\lVert \det(M) \rVert = 1$.
This is the same manifold as the Stiefel(n, n, ℝ) manifold.
Constructor
OrthogonalMatrices(n; parameter::Symbol=:type)Unitary matrices
Manifolds.UnitaryMatrices — Type
const UnitaryMatrices{𝔽, T} = GeneralUnitaryMatrices{𝔽, T, AbsoluteDeterminantOneMatrixType}The manifold $U(n,𝔽)$ of $n×n$ complex matrices (when 𝔽=ℂ) or quaternionic matrices (when 𝔽=ℍ) such that
\[ p^{\mathrm{H}}p = \mathrm{I}_n,\]
where $p^{\mathrm{H}}$ is the conjugate transpose of $p$ and $\mathrm{I}_n$ is the $n×n$ identity matrix. Such matrices p have a property that $\lVert \det(p) \rVert = 1$.
The tangent spaces are given by
\[ T_pU(n) \coloneqq \bigl\{ X \big| pY \text{ where } Y \text{ is skew symmetric, i. e. } Y = -Y^{\mathrm{H}} \bigr\}\]
But note that tangent vectors are represented in the Lie algebra, i.e. just using $Y$ in the representation above. If you prefer the representation as X you can use the Stiefel(n, n, ℂ) manifold.
Constructor
UnitaryMatrices(n, 𝔽::AbstractNumbers=ℂ; parameter::Symbol=:type)see also OrthogonalMatrices for the real valued case.
Base.rand — Method
rand(::UnitaryMatrices; vector_at=nothing, σ::Real=1.0)Generate a random point on the UnitaryMatrices manifold, if vector_at is nothing, by computing the QR decomposition of an $n×n$ matrix.
Generate a tangent vector at vector_at by projecting a normally distributed matrix onto the tangent space.
ManifoldDiff.riemannian_Hessian — Method
riemannian_Hessian(M::UnitaryMatrices, p, G, H, X)The Riemannian Hessian can be computed by adopting Eq. (5.6) [Ngu23], so very similar to the complex Stiefel manifold. The only difference is, that here the tangent vectors are stored in the Lie algebra, i.e. the update direction is actually $pX$ instead of just $X$ (in Stiefel). and that means the inverse has to be applied to the (Euclidean) Hessian to map it into the Lie algebra.
ManifoldsBase.Weingarten — Method
Weingarten(M::UnitaryMatrices, p, X, V)Compute the Weingarten map $\mathcal W_p$ at p on the UnitaryMatrices M with respect to the tangent vector $X \in T_p\mathcal M$ and the normal vector $V \in N_p\mathcal M$.
The formula is due to [AMT13] given by
\[\mathcal W_p(X,V) = -\frac{1}{2}\bigl(XS + SX\bigr), \qquad S = p^{\mathrm{H}}V.\]
ManifoldsBase.get_coordinates — Method
get_coordinates(M::UnitaryMatrices, p, X, B::DefaultOrthonormalBasis)Extract the unique tangent vector coordinates $X^i$ at point p on UnitaryMatrices from the skew-Hermitian tangent vector X.
For $\mathrm{U}(n)$, coordinates are ordered over the upper triangular part: diagonal entries contribute their imaginary parts, and each strict upper-triangular entry contributes real and imaginary parts, both scaled by $\sqrt{2}$.
ManifoldsBase.get_vector — Method
get_vector(M::UnitaryMatrices, p, c, B::DefaultOrthonormalBasis)Convert tangent coordinates c at point p on UnitaryMatrices to the skew-Hermitian tangent vector X.
This is the inverse of get_coordinates for the default orthonormal basis.
ManifoldsBase.manifold_dimension — Method
manifold_dimension(M::UnitaryMatrices{n,ℂ}) where {n}Return the dimension of the manifold unitary matrices.
\[\dim_{\mathrm{U}(n)} = n^2.\]
ManifoldsBase.manifold_dimension — Method
manifold_dimension(M::UnitaryMatrices{<:Any,ℍ})Return the dimension of the manifold unitary matrices.
\[\dim_{\mathrm{U}(n, ℍ)} = n(2n+1).\]
Special Unitary matrices
Manifolds.SpecialUnitaryMatrices — Type
const SpecialUnitaryMatrices{T} = GeneralUnitaryMatrices{ℂ, T, DeterminantOneMatrixType}The manifold $SU(n)$ of $n×n$ complex matrices such that
\[ p^{\mathrm{H}}p = \mathrm{I}_n \text{ and } \det(p) = 1,\]
where $p^{\mathrm{H}}$ is the conjugate transpose of $p$ and $\mathrm{I}_n$ is the $n×n$ identity matrix.
The tangent spaces are given by
\[ T_pU(n) \coloneqq \bigl\{ X \big| pY \text{ where } Y \text{ is skew symmetric and traceless, i. e. } Y = -Y^{\mathrm{H}} \text{ and } \operatorname{tr}(Y) = 0 \bigr\}\]
But note that tangent vectors are represented in the Lie algebra, i.e. just using $Y$ in the representation above.
Constructor
SpecialUnitaryMatrices(n; parameter::Symbol = :type)see also Rotations for the real valued case.
Base.rand — Method
rand(M::SpecialUnitaryMatrices; vector_at = nothing, σ::Real = 1.0)Generate a random point on the SpecialUnitaryMatrices M, if vector_at is nothing. The point is drawn as on the UnitaryMatrices from the QR decomposition of an $n×n$ matrix, with its first row divided by the sign of the determinant, so that the determinant is one.
Generate a tangent vector at vector_at by projecting a normally distributed matrix onto the tangent space.
Manifolds.manifold_volume — Method
manifold_volume(::SpecialUnitaryMatrices)Volume of the manifold of complex general unitary matrices of determinant one with respect to the metric of inner, Eqs. (3.9) and (A22) in [ZS03]:
\[\sqrt{n} (2π)^{(n-1)(n+2)/2} \prod_{k=1}^{n-1}\frac{1}{k!}.\]
ManifoldsBase.injectivity_radius — Method
injectivity_radius(G::SpecialUnitaryMatrices)Return the injectivity radius for general complex unitary matrix manifolds, where the determinant is $+1$, which is[1]
\[ \operatorname{inj}_{\mathrm{SU}(n)} = π \sqrt{2}.\]
ManifoldsBase.is_vector — Method
is_vector(M::SpecialUnitaryMatrices, p, X; atol, rtol, kwargs...)Check whether X is a tangent vector at p on the SpecialUnitaryMatrices M. That is the case if X lies in the Lie algebra $\mathfrak{su}(n)$ of the skew-Hermitian matrices of trace zero, see Section 3.4, Proposition 3.24 of [Hal15].
The skew-Hermitian check is performed with isapprox, which receives atol, rtol and all further keyword arguments. The trace has to vanish up to max(atol, rtol * sqrt(n) * norm(X)). The relative tolerance rtol refers to the size of X; its default is the one of isapprox.
ManifoldsBase.manifold_dimension — Method
manifold_dimension(M::SpecialUnitaryMatrices)Return the dimension of the manifold of special unitary matrices.
\[\dim_{\mathrm{SU}(n)} = n^2-1.\]
ManifoldsBase.project — Method
project(M::SpecialUnitaryMatrices, p, X)
project!(M::SpecialUnitaryMatrices, Y, p, X)Orthogonally project $X ∈ ℂ^{n×n}$ onto the tangent space of M at p and change the representer to the Lie algebra $\mathfrak{su}(n)$. That is, compute the skew-Hermitian part $Y$ of $p^{\mathrm{H}}X$ and subtract $\frac{1}{n}\operatorname{tr}(Y)$ from its diagonal, as the projection on the DeterminantOneMatrices does.
Common functions
Manifolds.AbsoluteDeterminantOneMatrixType — Type
AbsoluteDeterminantOneMatrixType <: AbstractMatrixTypeA type to indicate that we require (orthogonal / unitary) matrices with normed determinant, i.e. that the absolute value of the determinant is 1.
Manifolds.AbstractMatrixType — Type
AbstractMatrixTypeA plain type to distinguish different types of matrices, for example DeterminantOneMatrixType and AbsoluteDeterminantOneMatrixType.
Manifolds.DeterminantOneMatrixType — Type
DeterminantOneMatrixType <: AbstractMatrixTypeA type to indicate that we require special (orthogonal / unitary) matrices, i.e. of determinant 1.
Manifolds.GeneralUnitaryMatrices — Type
GeneralUnitaryMatrices{𝔽, T, S<:AbstractMatrixType} <: AbstractDecoratorManifoldA common parametric type for matrices with a unitary property of size $n×n$ over the field $𝔽$ which additionally have the AbstractMatrixType, e.g. are DeterminantOneMatrixType.
Base.exp — Method
exp(M::Rotations, p, X)
exp(M::OrthogonalMatrices, p, X)
exp(M::UnitaryMatrices, p, X)Compute the exponential map, that is, since $X$ is represented in the Lie algebra,
\[exp_p(X) = p\mathrm{e}^X\]
For different sizes, like $n=2,3,4$, there are specialized implementations.
The algorithm used is a more numerically stable form of those proposed in [GX02] and [AR13].
Base.exp — Method
exp(M::GeneralUnitaryMatrices{ℝ, TypeParameter{Tuple{3}}}, p::SMatrix, X::SMatrix)Compute the exponential map on the three by three real GeneralUnitaryMatrices M for static matrices by the Rodrigues formula, Proposition 2.7 in [GQ20],
\[\exp_p X = p\mathrm{e}^X = p\bigl(I + aX + bX^2\bigr), \qquad a = \frac{\sin θ}{θ}, \qquad b = \frac{1 - \cos θ}{θ^2}, \qquad θ = \frac{\lVert X \rVert_p}{\sqrt{2}}.\]
If $θ^2$ evaluates to zero, $a = 1 - θ^2/6$ and $b = 1/2 - θ^2/24$ are used instead, the first two terms of the series of $a$ and $b$ in the proof of Proposition 2.7, page 32, in [GQ20].
Base.log — Method
log(M::Rotations, p, X)
log(M::OrthogonalMatrices, p, X)
log(M::UnitaryMatrices, p, X)Compute the logarithmic map, that is, since the resulting $X$ is represented in the Lie algebra,
\[\log_p q = \log(p^{\mathrm{H}}q)\]
which is projected onto the skew symmetric matrices for numerical stability.
Base.log — Method
log(M::Rotations, p, q)Compute the logarithmic map on the Rotations manifold M which is given by
\[\log_p q = \log(p^{\mathrm{T}}q)\]
where $\log$ denotes the matrix logarithm. For numerical stability, the result is projected onto the set of skew symmetric matrices.
For antipodal rotations the function returns deterministically one of the tangent vectors that point at q.
Base.log — Method
log(M::SpecialUnitaryMatrices, p, q)Compute the logarithmic map on the SpecialUnitaryMatrices M.
Let $p^{\mathrm{H}}q = V\operatorname{diag}(e^{\mathrm{i}θ_1}, …, e^{\mathrm{i}θ_n})V^{\mathrm{H}}$ with $-π < θ_1 ≤ … ≤ θ_n ≤ π$. Since $\det(p^{\mathrm{H}}q) = 1$, the angles sum to $2πζ$ for an integer $ζ$, and
\[\log_p q = V\operatorname{diag}(\mathrm{i}φ_1, …, \mathrm{i}φ_n)V^{\mathrm{H}},\]
where $φ_j = θ_j - 2π$ for the $ζ$ largest angles if $ζ > 0$, $φ_j = θ_j + 2π$ for the $-ζ$ smallest angles if $ζ < 0$, and $φ_j = θ_j$ otherwise. This is the logarithm of $p^{\mathrm{H}}q$ in $\mathfrak{su}(n)$ of minimal norm, Theorems 1 and 2 and Lemma 1 in [Tal26].
Manifolds._exp_half — Method
_exp_half(::GeneralUnitaryMatrices, d)Calculate exp(d / 2).
Manifolds._exp_half — Method
_exp_half(::GeneralUnitaryMatrices{ℝ, TypeParameter{Tuple{3}}}, d)Calculate exp(d / 2) for the three by three real matrices, that is Rotations(3) and OrthogonalMatrices(3), by the Rodrigues formula, Proposition 2.7 in [GQ20]. For d / 2 it reads I + (a / 2) d + (b / 4) d^2 with a = sin(θ) / θ, b = (1 - cos(θ)) / θ^2 and θ = norm(d) / (2 * sqrt(2)). If θ^2 evaluates to zero, a = 1 - θ^2 / 6 and b = 1 / 2 - θ^2 / 24 are used instead, the first two terms of the series of a and b in the proof of Proposition 2.7, page 32, in [GQ20].
Manifolds.cos_angles_4d_rotation_matrix — Method
cos_angles_4d_rotation_matrix(R)4D rotations can be described by two orthogonal planes that are unchanged by the action of the rotation (vectors within a plane rotate only within the plane). The cosines of the two angles $α,β$ of rotation about these planes may be obtained from the distinct real parts of the eigenvalues of the rotation matrix. This function computes these more efficiently by solving the system
\[\begin{aligned} \cos α + \cos β &= \frac{1}{2} \operatorname{tr}(R)\\ \cos α \cos β &= \frac{1}{8} \operatorname{tr}(R)^2 - \frac{1}{16} \operatorname{tr}((R - R^T)^2) - 1. \end{aligned}\]
By convention, the returned values are sorted in decreasing order. See also angles_4d_skew_sym_matrix.
Manifolds.manifold_volume — Method
manifold_volume(::GeneralUnitaryMatrices{ℝ,<:Any,AbsoluteDeterminantOneMatrixType})Volume of the manifold of real orthogonal matrices of absolute determinant one with respect to the metric of inner, Eq. (A27) in [ZS03]:
\[2^{n(n+3)/4} \prod_{k=1}^{n} \frac{π^{k/2}}{Γ(k/2)},\]
twice the volume of the Rotations.
Manifolds.manifold_volume — Method
manifold_volume(::GeneralUnitaryMatrices{ℝ,<:Any,DeterminantOneMatrixType})Volume of the manifold of real orthogonal matrices of determinant one with respect to the metric of inner, Eq. (A31) in [ZS03]:
\[2^{n(n+3)/4-1} \prod_{k=1}^{n} \frac{π^{k/2}}{Γ(k/2)}.\]
Manifolds.manifold_volume — Method
manifold_volume(::GeneralUnitaryMatrices{ℂ,<:Any,AbsoluteDeterminantOneMatrixType})Volume of the manifold of complex general unitary matrices of absolute determinant one with respect to the metric of inner, Eq. (3.9) in [ZS03]:
\[(2π)^{n(n+1)/2} \prod_{k=1}^{n-1}\frac{1}{k!}.\]
Manifolds.volume_density — Method
volume_density(M::GeneralUnitaryMatrices{ℝ, TypeParameter{Tuple{2}}}, p, X)Volume density on O(2)/SO(2) is equal to 1.
Manifolds.volume_density — Method
volume_density(M::GeneralUnitaryMatrices{ℝ, TypeParameter{Tuple{3}}}, p, X)Compute the volume density on O(3)/SO(3). With the rotation angle $θ = \frac{\lVert X\rVert}{\sqrt{2}}$ it is the reciprocal of Eq. (5) in [FdHDF19], that is
\[\frac{2\bigl(1-\cos θ\bigr)}{θ^2} = \left(\frac{\sin\frac{θ}{2}}{\frac{θ}{2}}\right)^2.\]
Manifolds.volume_density — Method
volume_density(M::GeneralUnitaryMatrices{ℝ}, p, X)Compute volume density function of M, i.e. determinant of the differential of exponential map exp(M, p, X). It is derived from Eq. (4.1) and Corollary 4.4 in [CLLD22]. See also Theorem 4.1 in [FdHDF19], (note that it uses a different convention).
ManifoldsBase.change_metric — Method
change_metric(M::GeneralUnitaryMatrices, ::EuclideanMetric, p, X)Change X to the corresponding vector with respect to the metric of the GeneralUnitaryMatrices M, which is just the identity, since the manifold is isometrically embedded.
ManifoldsBase.change_representer — Method
change_representer(M::GeneralUnitaryMatrices, ::EuclideanMetric, p, X)Change X to the corresponding representer of a cotangent vector at p. Since the GeneralUnitaryMatrices manifold M is isometrically embedded, this is the identity.
ManifoldsBase.check_point — Method
check_point(M::Rotations, p; kwargs...)Check whether p is a valid point on the UnitaryMatrices M, i.e. that $p$ has a determinant of absolute value one, i.e. that $p^{\mathrm{H}}p = \mathrm{I}_n$
The tolerance for the last test can be set using the kwargs....
ManifoldsBase.check_point — Method
check_point(M::UnitaryMatrices, p; kwargs...)
check_point(M::OrthogonalMatrices, p; kwargs...)
check_point(M::GeneralUnitaryMatrices, p; kwargs...)Check whether p is a valid point on the UnitaryMatrices or [OrthogonalMatrices] M, i.e. that $p$ has a determinant of absolute value one.
The tolerance for the last test can be set using the kwargs....
ManifoldsBase.check_vector — Method
check_vector(M::UnitaryMatrices, p, X; kwargs... )
check_vector(M::OrthogonalMatrices, p, X; kwargs... )
check_vector(M::Rotations, p, X; kwargs... )
check_vector(M::GeneralUnitaryMatrices, p, X; kwargs... )Check whether X is a tangent vector to p on the UnitaryMatrices space M, i.e. after check_point(M,p), X has to be skew symmetric (Hermitian) and orthogonal to p.
The tolerance for the last test can be set using the kwargs....
ManifoldsBase.embed — Method
embed(M::GeneralUnitaryMatrices, p, X)Embed the tangent vector X at point p in M from its Lie algebra representation (set of skew matrices) into the Riemannian submanifold representation
The formula reads
\[X_{\text{embedded}} = p * X\]
ManifoldsBase.exp_fused! — Method
exp_fused!(M::GeneralUnitaryMatrices{ℝ, TypeParameter{Tuple{3}}}, q, p, X, t::Real)Compute $\exp_p(tX)$ on the three by three real GeneralUnitaryMatrices M and store the result in q, by the Rodrigues formula, Proposition 2.7 in [GQ20],
\[\exp_p(tX) = p\mathrm{e}^{tX} = p\bigl(I + a\,tX + b\,t^2X^2\bigr), \qquad a = \frac{\sin θ}{θ}, \qquad b = \frac{1 - \cos θ}{θ^2}, \qquad θ = \frac{\lvert t \rvert \lVert X \rVert_p}{\sqrt{2}}.\]
If $θ^2$ evaluates to zero, $a = 1 - θ^2/6$ and $b = 1/2 - θ^2/24$ are used instead, the first two terms of the series of $a$ and $b$ in the proof of Proposition 2.7, page 32, in [GQ20].
ManifoldsBase.get_coordinates — Method
get_coordinates(M::Rotations, p, X)
get_coordinates(M::OrthogonalMatrices, p, X)
get_coordinates(M::UnitaryMatrices, p, X)Extract the unique tangent vector components $X^i$ at point p on Rotations $\mathrm{SO}(n)$ from the matrix representation X of the tangent vector.
The basis on the Lie algebra $𝔰𝔬(n)$ is chosen such that for $\mathrm{SO}(2)$, $X^1 = θ = X_{21}$ is the angle of rotation, and for $\mathrm{SO}(3)$, $(X^1, X^2, X^3) = (X_{32}, X_{13}, X_{21}) = θ u$ is the angular velocity and axis-angle representation, where $u$ is the unit vector along the axis of rotation.
For $\mathrm{SO}(n)$ where $n ≥ 4$, the additional elements of $X^i$ are $X^{j (j - 3)/2 + k + 1} = X_{jk}$, for $j ∈ [4,n], k ∈ [1,j)$.
ManifoldsBase.get_embedding — Method
get_embedding(M::OrthogonalMatrices)
get_embedding(M::Rotations)
get_embedding(M::UnitaryMatrices)Return the embedding, i.e. The $\mathbb F^{n×n}$, where $\mathbb F = \mathbb R$ for the first two and $\mathbb F = \mathbb C$ for the unitary matrices.
ManifoldsBase.get_vector — Method
get_vector(M::OrthogonalMatrices, p, Xⁱ, B::DefaultOrthogonalBasis)
get_vector(M::Rotations, p, Xⁱ, B::DefaultOrthogonalBasis)Convert the unique tangent vector components Xⁱ at point p on Rotations or OrthogonalMatrices to the matrix representation $X$ of the tangent vector. See get_coordinates for the conventions used.
ManifoldsBase.injectivity_radius — Method
injectivity_radius(M::GeneralUnitaryMatrices)Return the injectivity radius for general unitary matrix manifolds, which is[1]
\[ \operatorname{inj}_{\mathrm{U}(n)} = π.\]
ManifoldsBase.injectivity_radius — Method
injectivity_radius(M::Rotations)
injectivity_radius(M::OrthogonalMatrices)
injectivity_radius(M::Rotations, ::ExponentialRetraction)
injectivity_radius(M::OrthogonalMatrices, ::ExponentialRetraction)Return the radius of injectivity on the Rotations and OrthogonalMatrices M of $n×n$ matrices, which is $π\sqrt{2}$ for $n ≥ 2$[1] and $0$ for $n = 1$.
ManifoldsBase.inverse_retract — Method
inverse_retract(M::Rotations, p, q, ::PolarInverseRetraction)
inverse_retract(M::OrthogonalMatrices, p, q, ::PolarInverseRetraction)Compute a vector X (as an element of the Lie algebra) from the tangent space $T_p\mathcal M$ of the point p on the real GeneralUnitaryMatrices manifold M. This covers the Rotations and the OrthogonalMatrices, and with X the point q is reached by the PolarRetraction from the point p after time 1.
The formula reads
\[\operatorname{retr}^{-1}_p(q) = -\frac{1}{2}(p^{\mathrm{T}}qs - (p^{\mathrm{T}}qs)^{\mathrm{T}})\]
where $s$ is the solution to the Sylvester equation
$p^{\mathrm{T}}qs + s(p^{\mathrm{T}}q)^{\mathrm{T}} + 2I_n = 0.$
The polar retraction does not leave the connected component of p, since $\operatorname{retr}_p(X) = p (I + X)(I - X^2)^{-1/2}$ and $\det(I + X) > 0$. Hence the inverse is only defined for p and q with $\det(p^{\mathrm{T}}q) > 0$, and a DomainError is thrown otherwise.
ManifoldsBase.inverse_retract — Method
inverse_retract(M::Rotations, p, q, ::QRInverseRetraction)
inverse_retract(M::OrthogonalMatrices, p, q, ::QRInverseRetraction)Compute a vector X (as an element of the Lie algebra) from the tangent space $T_p\mathcal M$ of the point p on the real GeneralUnitaryMatrices manifold M. This covers the Rotations and the OrthogonalMatrices, and with X the point q is reached by the QRRetraction from the point p after time 1.
The QR retraction does not leave the connected component of p, since $\operatorname{retr}_p(X) = p \operatorname{qf}(I + X)$ and $\det(\operatorname{qf}(I + X)) = 1$. Hence the inverse is only defined for p and q with $\det(p^{\mathrm{T}}q) > 0$, and a DomainError is thrown otherwise.
ManifoldsBase.is_flat — Method
is_flat(M::GeneralUnitaryMatrices)Return true if GeneralUnitaryMatrices M is O(2), SO(2), U(1) or SU(1) and false otherwise.
ManifoldsBase.manifold_dimension — Method
manifold_dimension(M::Rotations)
manifold_dimension(M::OrthogonalMatrices)Return the dimension of the manifold orthogonal matrices and of the manifold of rotations
\[\dim_{\mathrm{O}(n)} = \dim_{\mathrm{SO}(n)} = \frac{n(n-1)}{2}.\]
ManifoldsBase.parallel_transport_direction — Method
parallel_transport_direction(M::GeneralUnitaryMatrices, p, X, d)Compute the parallel transport of X from p in direction d on the GeneralUnitaryMatrices M. This covers the Rotations, the OrthogonalMatrices, the UnitaryMatrices and the SpecialUnitaryMatrices, with tangent vectors represented in the Lie algebra. The formula, provided in [Ren11] for the rotations, reads
\[\mathcal P_{q\gets p}X = q^{\mathrm{H}}p \operatorname{Exp}(d/2) X \operatorname{Exp}(d/2),\]
where $q = \exp_p d$ and $\operatorname{Exp}$ denotes the matrix exponential.
ManifoldsBase.parallel_transport_direction — Method
parallel_transport_direction(M::GeneralUnitaryMatrices{ℝ, TypeParameter{Tuple{2}}}, p, X, d)Return X, the parallel transport of X from p in direction d on the two by two real GeneralUnitaryMatrices M. Two skew-symmetric two by two matrices commute, so $\operatorname{Exp}(-d/2) X \operatorname{Exp}(d/2) = X$.
ManifoldsBase.parallel_transport_to — Method
parallel_transport_to(M::GeneralUnitaryMatrices, p, X, q)Compute the parallel transport of X from p to q on the GeneralUnitaryMatrices M, with tangent vectors represented in the Lie algebra. With $d = \log_p q$, the formula of [Ren11] reads
\[\mathcal P_{q\gets p}X = q^{\mathrm{H}}p \operatorname{Exp}(d/2) X \operatorname{Exp}(d/2),\]
where $\operatorname{Exp}$ denotes the matrix exponential.
ManifoldsBase.parallel_transport_to — Method
parallel_transport_to(M::GeneralUnitaryMatrices{ℝ, TypeParameter{Tuple{2}}}, p, X, q)Return X, the parallel transport of X from p to q on the two by two real GeneralUnitaryMatrices M. Two skew-symmetric two by two matrices commute, so $\operatorname{Exp}(-d/2) X \operatorname{Exp}(d/2) = X$ for $d = \log_p q$.
ManifoldsBase.project — Method
project(M::OrthogonalMatrices, p, X)
project(M::Rotations, p, X)
project(M::UnitaryMatrices, p, X)Orthogonally project the tangent vector $X ∈ 𝔽^{n×n}$, $\mathbb F ∈ \{\mathbb R, \mathbb C\}$ to the tangent space of M at p, and change the representer to use the corresponding Lie algebra, i.e. we compute
\[ \operatorname{proj}_p(X) = \frac{p^{\mathrm{H}} X - (p^{\mathrm{H}} X)^{\mathrm{H}}}{2}.\]
ManifoldsBase.project — Method
project(G::UnitaryMatrices, p)
project(G::OrthogonalMatrices, p)Project the point $p ∈ 𝔽^{n×n}$ to the nearest point in $\mathrm{U}(n,𝔽)=$UnitaryMatrices(n,𝔽) under the Frobenius norm. If $p = U S V^\mathrm{H}$ is the singular value decomposition of $p$, then the projection is
\[ \operatorname{proj}_{\mathrm{U}(n,𝔽)} \colon p ↦ U V^\mathrm{H}.\]
ManifoldsBase.retract — Method
retract(M::Rotations, p, X, ::PolarRetraction)
retract(M::OrthogonalMatrices, p, X, ::PolarRetraction)Compute the SVD-based retraction on the Rotations and OrthogonalMatrices M from p in direction X (as an element of the Lie algebra) and is a second-order approximation of the exponential map. Let
\[USV = p + pX\]
be the singular value decomposition, then the formula reads
\[\operatorname{retr}_p X = UV^\mathrm{T}.\]
ManifoldsBase.retract — Method
retract(M::Rotations, p, X, ::QRRetraction)
retract(M::OrthogonalMatrices, p, X, ::QRRetraction)Compute the QR-based retraction on the Rotations and OrthogonalMatrices M from p in direction X (as an element of the Lie algebra), which is a first-order approximation of the exponential map.
This is also the default retraction on these manifolds.
ManifoldsBase.riemann_tensor — Method
riemann_tensor(::GeneralUnitaryMatrices, p, X, Y, Z)Compute the value of Riemann tensor on the GeneralUnitaryMatrices manifold. The formula reads [Ren11]
\[R(X,Y)Z=\frac{1}{4}[Z, [X, Y]].\]
Statistics.mean — Method
mean(
M::Rotations,
x::AbstractVector,
[w::AbstractWeights,]
method = GeodesicInterpolationWithinRadius(π/2/√2);
kwargs...,
)Compute the Riemannian mean of x using GeodesicInterpolationWithinRadius.
Footnotes and References
- [AMT13]
- P.-A. Absil, R. Mahony and J. Trumpf. An Extrinsic Look at the Riemannian Hessian. In: Geometric Science of Information, edited by F. Nielsen and F. Barbaresco (Springer Berlin Heidelberg, 2013); pp. 361–368.
- [AR13]
- D. Andrica and R.-A. Rohan. Computing the Rodrigues coefficients of the exponential map of the Lie groups of matrices. Balkan Journal of Geometry and Its Applications 18, 1–10 (2013).
- [CLLD22]
- E. Chevallier, D. Li, Y. Lu and D. B. Dunson. Exponential-wrapped distributions on symmetric spaces. ArXiv Preprint (2022).
- [FdHDF19]
- L. Falorsi, P. de Haan, T. R. Davidson and P. Forré. Reparameterizing Distributions on Lie Groups. In: Proceedings of the Twenty-Second International Conference on Artificial Intelligence and Statistics, Vol. 89 of Proceedings of Machine Learning Research (PMLR, 2019); pp. 3244–3253.
- [GX02]
- J. Gallier and D. Xu. Computing exponentials of skew-symmetric matrices and logarithms of orthogonal matrices. International Journal of Robotics and Automation 17, 1–11 (2002).
- [GQ20]
- J. Gallier and J. Quaintance. Differential Geometry and Lie Groups: A Computational Perspective. Vol. 12 of Geometry and Computing (Springer International Publishing, Cham, 2020).
- [Hal15]
- B. C. Hall. Lie Groups, Lie Algebras, and Representations: An Elementary Introduction. Graduate Texts in Mathematics (Springer International Publishing, 2015).
- [Ngu23]
- D. Nguyen. Operator-Valued Formulas for Riemannian Gradient and Hessian and Families of Tractable Metrics in Riemannian Optimization. Journal of Optimization Theory and Applications 198, 135–164 (2023), arXiv:2009.10159.
- [Ren11]
- Q. Rentmeesters. A gradient method for geodesic data fitting on some symmetric Riemannian manifolds. In: IEEE Conference on Decision and Control and European Control Conference (2011); pp. 7141–7146.
- [Tal26]
- S. Talaganis. Drift-Adapted Lattice Geodesics for Quantum Gate Synthesis: Exact Global Optima for Full-Isotropic SU(n) and Weighted Commuting Sectors. Universe 12, 219 (2026).
- [ZS03]
- K. Życzkowski and H.-J. Sommers. Hilbert–Schmidt volume of the set of mixed quantum states. Journal of Physics A: Mathematical and General 36, 10115–10130 (2003).
- 1
For a derivation of the injectivity radius, see sethaxen.com/blog/2023/02/the-injectivity-radii-of-the-unitary-groups/.
- 1
For a derivation of the injectivity radius, see sethaxen.com/blog/2023/02/the-injectivity-radii-of-the-unitary-groups/.