|
| 1 | +@doc """ |
| 2 | + SpecialLinear{𝔽,T} |
| 3 | +
|
| 4 | +The special linear group ``$(_math(:SL))(n,𝔽)`` is the group of all invertible matrices |
| 5 | +with unit determinant in ``𝔽^{n×n}`` and the [`MatrixMultiplicationGroupOperation`](@ref) as group operation. |
| 6 | +
|
| 7 | +The Lie algebra ``$(_math(:sl))(n, 𝔽) = T_e $(_math(:SL))(n,𝔽)`` is the set of all matrices in |
| 8 | +``𝔽^{n×n}`` with trace of zero. By default, tangent vectors ``X_p ∈ T_p $(_math(:SL))(n,𝔽)`` |
| 9 | +for ``p ∈ $(_math(:SL))(n,𝔽)`` are represented with their corresponding Lie algebra vector |
| 10 | +``X_e = p^{-1}X_p ∈ 𝔰𝔩(n, 𝔽)``. |
| 11 | +
|
| 12 | +# Constructor |
| 13 | +
|
| 14 | + GeneralLinearGroup(n::Int, field=ℝ; kwargs...) |
| 15 | +
|
| 16 | +Generate the general linear group group on ``𝔽^{n×n}``. |
| 17 | +All keyword arguments in `kwargs...` are passed on to [`DeterminantOneMatrices`](@extref `Manifolds.DeterminantOneMatrices`). |
| 18 | +""" |
| 19 | +const SpecialLinearGroup{𝔽,T} = LieGroup{ |
| 20 | + 𝔽,MatrixMultiplicationGroupOperation,DeterminantOneMatrices{𝔽,T} |
| 21 | +} |
| 22 | + |
| 23 | +function SpecialLinearGroup(n::Int, field=ManifoldsBase.ℝ; kwargs...) |
| 24 | + M = Manifolds.DeterminantOneMatrices(n, field; kwargs...) |
| 25 | + return SpecialLinearGroup{typeof(M).parameters...}( |
| 26 | + M, MatrixMultiplicationGroupOperation() |
| 27 | + ) |
| 28 | +end |
| 29 | + |
| 30 | +# TODO: document hat/vee with the corresponding formulae |
| 31 | + |
| 32 | +function get_coordinates_lie!( |
| 33 | + ::LieAlgebra{ℝ,MatrixMultiplicationGroupOperation,<:SpecialLinearGroup}, |
| 34 | + c, |
| 35 | + X, |
| 36 | + ::DefaultLieAlgebraOrthogonalBasis{ℝ}, |
| 37 | +) |
| 38 | + c .= X[1:(end - 1)] |
| 39 | + return c |
| 40 | +end |
| 41 | + |
| 42 | +function get_vector_lie!( |
| 43 | + 𝔤::LieAlgebra{ℝ,MatrixMultiplicationGroupOperation,<:SpecialLinearGroup}, |
| 44 | + X, |
| 45 | + c, |
| 46 | + ::DefaultLieAlgebraOrthogonalBasis{ℝ}, |
| 47 | +) |
| 48 | + X[1:(end - 1)] .= c |
| 49 | + X[end] = 0 |
| 50 | + X[end] = -tr(X) |
| 51 | + return X |
| 52 | +end |
| 53 | + |
| 54 | +_doc_hat_special_linear = """ |
| 55 | + X = hat(𝔤::LieAlgebra{ℝ,MatrixMultiplicationGroupOperation,<:SpecialLinearGroup}, c) |
| 56 | + hat!(𝔤::LieAlgebra{ℝ,MatrixMultiplicationGroupOperation,<:SpecialLinearGroup}, X, c) |
| 57 | +
|
| 58 | +Compute the hat map ``(⋅)^{\\wedge} : ℝ^{n^2-1} → 𝔤`` that turns a vector of coordinates `c` |
| 59 | +into a tangent vector in the Lie algebra. |
| 60 | +
|
| 61 | +The formula on the Lie algebra ``𝔤`` of the [`SpecialLinearGroup`](@ref)`(n)` is given by |
| 62 | +reshaping ``c ∈ ℝ^{n^2-1}`` into an ``n``-by``n`` matrix ``X`` with the final entry `X[n,n]` |
| 63 | +initialised to zero and then set to the trace of this initial matrix. |
| 64 | +
|
| 65 | +This can be computed in-place of `X`. |
| 66 | +""" |
| 67 | + |
| 68 | +@doc "$(_doc_hat_special_linear)" |
| 69 | +ManifoldsBase.hat( |
| 70 | + ::LieAlgebra{ℝ,MatrixMultiplicationGroupOperation,<:SpecialLinearGroup}, c |
| 71 | +) |
| 72 | + |
| 73 | +@doc "$(_doc_hat_special_linear)" |
| 74 | +ManifoldsBase.hat!( |
| 75 | + ::LieAlgebra{ℝ,MatrixMultiplicationGroupOperation,<:SpecialLinearGroup}, X, c |
| 76 | +) |
| 77 | + |
| 78 | +function Base.show( |
| 79 | + io::IO, ::SpecialLinearGroup{𝔽,ManifoldsBase.TypeParameter{Tuple{n}}} |
| 80 | +) where {𝔽,n} |
| 81 | + return print(io, "SpecialLinearGroup($n, $(𝔽))") |
| 82 | +end |
| 83 | +function Base.show(io::IO, G::SpecialLinearGroup{𝔽,Tuple{Int}}) where {𝔽} |
| 84 | + M = base_manifold(G) |
| 85 | + n = ManifoldsBase.get_parameter(M.size)[1] |
| 86 | + return print(io, "SpecialLinearGroup($n, $(𝔽); parameter=:field)") |
| 87 | +end |
| 88 | + |
| 89 | +_doc_vee_special_linear = """ |
| 90 | + c = vee(𝔤::LieAlgebra{ℝ,MatrixMultiplicationGroupOperation,<:SpecialLinearGroup}, X) |
| 91 | + vee!(𝔤::LieAlgebra{ℝ,MatrixMultiplicationGroupOperation,<:SpecialLinearGroup}, c, X) |
| 92 | +
|
| 93 | +Compute the vee map ``(⋅)^{\\vee}: $(_math(:𝔤)) → ℝ^{n^2-1}`` that maps a tangent vector |
| 94 | +from the Lie algebra to a vector of coordinates `c`. |
| 95 | +
|
| 96 | +The formula on the Lie algebra ``𝔤`` of the [`SpecialLinearGroup`](@ref)`(n)` is given by |
| 97 | +reshaping ``X ∈ ℝ^{n×n}`` into a vector and omitting the last entry, since that |
| 98 | +can be reconstructed by considering that ``X`` has to be of trace zero. |
| 99 | +
|
| 100 | +This can be computed in-place of `c`. |
| 101 | +""" |
| 102 | + |
| 103 | +@doc "$(_doc_vee_special_linear)" |
| 104 | +ManifoldsBase.vee( |
| 105 | + ::LieAlgebra{ℝ,MatrixMultiplicationGroupOperation,<:SpecialLinearGroup}, X |
| 106 | +) |
| 107 | + |
| 108 | +@doc "$(_doc_vee_special_linear)" |
| 109 | +ManifoldsBase.vee!( |
| 110 | + ::LieAlgebra{ℝ,MatrixMultiplicationGroupOperation,<:SpecialLinearGroup}, c, X |
| 111 | +) |
0 commit comments