Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce the general linear group and the multiplication group operation. #12

Merged
merged 69 commits into from
Nov 3, 2024
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
b9d2282
Initial commit.
kellertuer Oct 23, 2024
5e7a3b9
update news.
kellertuer Oct 24, 2024
e276573
Setup GeneralLinear.
kellertuer Oct 24, 2024
1ca24a3
Starts a bit towards multiplication groups.
kellertuer Oct 24, 2024
baf7fc8
Rename a tutorial, start test suite for GLn
kellertuer Oct 25, 2024
3527bb5
Bump dependencies and remove a function that is now available in Mani…
kellertuer Oct 25, 2024
301e5ff
Resolve ambiguities.
kellertuer Oct 25, 2024
6e6844b
fix transition table.
kellertuer Oct 25, 2024
4524af6
Add two manual tutorials that are not qmd.s
kellertuer Oct 25, 2024
8ece955
A few steps towards multiplication groups.
kellertuer Oct 25, 2024
c2a01a8
Extend docs.
kellertuer Oct 26, 2024
71bd589
Add literature.
kellertuer Oct 26, 2024
9e1f688
document replacements for `inverse_translate_diff` terms.
kellertuer Oct 26, 2024
b1f69a0
add tests.
kellertuer Oct 26, 2024
5f95209
Fix actions
kellertuer Oct 26, 2024
76453da
Implement get_vector and get_coordinates.
kellertuer Oct 27, 2024
4ec07bd
Finish most functions on General Linear
kellertuer Oct 27, 2024
df8478e
Fix documentation.
kellertuer Oct 27, 2024
7af3a0e
Add rand and rand!
kellertuer Oct 28, 2024
5c50b92
some typos
mateuszbaran Oct 28, 2024
b3e3eda
one more typo
mateuszbaran Oct 28, 2024
0d7b004
mention in-place diff_inv! in docstring
mateuszbaran Oct 28, 2024
aa53b26
make the docstring consistently use `g`
mateuszbaran Oct 28, 2024
58edef3
Apply suggestions from code review
kellertuer Oct 28, 2024
a73b2dd
typo
mateuszbaran Oct 28, 2024
76ecadd
typo
mateuszbaran Oct 28, 2024
9339660
minor improvements to transition docs
mateuszbaran Oct 28, 2024
8f76a50
Add rand and rand!
kellertuer Oct 28, 2024
d702a76
fix a warning.
kellertuer Oct 28, 2024
a3c2c36
Merge branch 'kellertuer/general-linear-group' of github.com:JuliaMan…
kellertuer Oct 28, 2024
3e54b7b
minor improvements
mateuszbaran Oct 28, 2024
8b30d9d
simplify a little
mateuszbaran Oct 28, 2024
0c7d5db
Update docs/src/tutorials/transition.md
kellertuer Oct 28, 2024
08ea126
A bit of work on the test coverage.
kellertuer Oct 29, 2024
ef88470
Merge branch 'kellertuer/general-linear-group' of github.com:JuliaMan…
kellertuer Oct 29, 2024
3e4708a
remove a line that is no longer necessary (covered in ManifoldsBase.j…
kellertuer Oct 29, 2024
827b1fd
add a test.
kellertuer Oct 29, 2024
9e97504
test a tricky exp fallback.
kellertuer Oct 29, 2024
0e3eca3
Same fallback e test for log.
kellertuer Oct 29, 2024
e9a90b7
Starts testing mult op.
kellertuer Oct 30, 2024
26ba0e3
Merge branch 'kellertuer/general-linear-group' of github.com:JuliaMan…
kellertuer Oct 30, 2024
ff49d53
notes for next tests.
kellertuer Oct 30, 2024
81fd436
Fix an export.
kellertuer Oct 30, 2024
bd969b9
further test coverage.
kellertuer Oct 30, 2024
8a726a9
Add one further small test.
kellertuer Oct 30, 2024
834ea73
Add inv.tests.
kellertuer Oct 30, 2024
37f3310
Fix a typo.
kellertuer Oct 30, 2024
2312845
runs formatter.
kellertuer Oct 30, 2024
8b193eb
add rand tests.
kellertuer Oct 30, 2024
1e6dad6
fix a few bugs and increase test cov.
kellertuer Oct 30, 2024
a4313ed
Fix a typo.
kellertuer Oct 30, 2024
99ae845
Fallbacks and tests for hat/vee.
kellertuer Oct 31, 2024
5b876fa
Fix a test and a variable.
kellertuer Oct 31, 2024
c4a796a
Fix a bug in vee.
kellertuer Oct 31, 2024
187c78c
Fix a typo.
kellertuer Oct 31, 2024
95dfccd
Fix fallbacks, add code cov.
kellertuer Nov 2, 2024
76e89f2
Hopefully one last fix.
kellertuer Nov 2, 2024
daedf66
Remove a line that was indeed not necessary and add a doc string.
kellertuer Nov 2, 2024
f64566c
fix some typos and minor things
mateuszbaran Nov 3, 2024
c7714d8
more tests
mateuszbaran Nov 3, 2024
4124646
adress points from code review.
kellertuer Nov 3, 2024
7ee90a5
Fix complex general linear.
kellertuer Nov 3, 2024
7d0ca04
one last broken test
mateuszbaran Nov 3, 2024
b783747
fix typo
mateuszbaran Nov 3, 2024
2e66666
Maybe this fixes it?
kellertuer Nov 3, 2024
eb3673e
Fix is_points for identity.
kellertuer Nov 3, 2024
56524db
Like so?
kellertuer Nov 3, 2024
bb313bd
Variant 4.
kellertuer Nov 3, 2024
516e083
I am a slave of CI: Does rewriting help?
kellertuer Nov 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ignore:
- "src/documentation_glossary.jl" # exclude this since it is just use to create the docs and code cov goes bogus on this.
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Everything denoted by “formerly” refers to the previous name in [`Manifolds.

* `LieAlgebra`
* `LieGroup` (formerly `GroupManifold`) as well as the concrete groups
* `AdditiveGroup` (formerly `TranslationGroup`)
* `TranslationGroup`
* `AbstractGroupOperation` as well as its concrete subtypes
* `AdditionGroupOperation` (formerly `AdditionOperation`)
* `AbstractGroupActionType` with its 2 specific (new) abstract
Expand All @@ -29,6 +29,7 @@ Everything denoted by “formerly” refers to the previous name in [`Manifolds.
* `compose` and `compose!`
* `conjugate` and `conjugate!`
* `diff_apply`, `diff_apply!`, `diff_group_apply`, and `diff_group_apply!` (formerly `apply_diff_[group][!]`)
* `diff_conjugate` and `diff_conjugate!`
* `diff_left_compose`, `diff_left_compose!`, `diff_right_compose`, `diff_right_compose!` (formerly `translate_diff` with different sides)
* `exp(G::LieGroup, g, X)` and `exp!(G::LieGroup, h, g, X)` (formerly `exp_inv` and `exp_inv!`)
* `exp(G::LieGroup, ::Identity, X)` and `exp!(G::LieGroup, h, ::Identity, X)` (formerly `exp_lie` and `exp_lie!`)
Expand Down
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ ManifoldsBase = "3362f125-f0bb-47a3-aa74-596ffd7ef2fb"
[compat]
Aqua = "0.8"
LinearAlgebra = "1.6"
Manifolds = "0.10"
ManifoldsBase = "0.15.16"
Manifolds = "0.10.5"
ManifoldsBase = "0.15.20"
Test = "1.6"
julia = "1.6"

Expand Down
6 changes: 5 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@
</picture>
</div>

[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://juliamanifolds.github.io/Manifolds.jl/latest/)
[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://juliamanifolds.github.io/LieGroups.jl/dev/)
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle) [![CI](https://github.com/JuliaManifolds/LieGroups.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/JuliaManifolds/LieGroups.jl/actions?query=workflow%3ACI+branch%3Amain) [![codecov.io](http://codecov.io/github/JuliaManifolds/LieGroups.jl/coverage.svg?branch=main)](https://codecov.io/gh/JuliaManifolds/LieGroups.jl/)

This is a package to rework the Lie group features of [`Manifolds.jl`](https://juliamanifolds.github.io/Manifolds.jl/stable/) in a unified way into a separate package.

> [!NOTE]
> Since this is a rework of the features from [`Manifolds.jl`](https://juliamanifolds.github.io/Manifolds.jl/stable/), both `LieGroups.jl` and `Manifolds.jl` 0.10 export a few types. For that reason it's not recommended to load both packages in a productive environment, unless you are aware, which variables you want to import wherefrom.
mateuszbaran marked this conversation as resolved.
Show resolved Hide resolved
> see [transition from Manifolds.jl](https://juliamanifolds.github.io/LieGroups.jl/stable/tutorials/transition-from-manifoldsjl.html) for a comprehensive list.

This especially also includes a few different choices in default behaviour that
is different from the [`Manifolds.jl`](https://juliamanifolds.github.io/Manifolds.jl/stable/) one. For purely manifold-based operations, any Lie group still is “build upon” a Riemannian manifold.

Expand Down
15 changes: 10 additions & 5 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ for (md_file, doc_file) in [("CONTRIBUTING.md", "contributing.md"), ("NEWS.md",
end

## Build tutorials menu
tutorials_menu = "How to..." => ["Get started with Lie Groups" => "index.md"]
tutorials_menu =
"How to..." => [
"🚀 Get Started with LieGroups.jl" => "tutorials/getstarted.md",
"Transistion from `GroupManifolds`" => "tutorials/transition.md",
]
# (e) finally make docs
bib = CitationBibliography(joinpath(@__DIR__, "src", "references.bib"); style=:alpha)
links = InterLinks(
Expand All @@ -118,16 +122,17 @@ makedocs(;
"Home" => "index.md",
"About" => "about.md",
(tutorials_in_menu ? [tutorials_menu] : [])...,
"Lie groups" => [
"List of Lie Groups" => "groups/index.md",
"General Linear" => "groups/general_linear.md",
"Translation group" => "groups/translation.md",
],
"Interfaces" => [
"Lie group" => "interface/group.md",
"Lie algebra" => "interface/algebra.md",
"Group operation" => "interface/operations.md",
"Group action" => "interface/actions.md",
],
"Lie groups" => [
"List of Lie Groups" => "groups/index.md",
"Translation group" => "groups/translation.md",
],
"Contributing to LieGroups.jl" => "contributing.md",
"Notation" => "notation.md",
"Changelog" => "news.md",
Expand Down
7 changes: 7 additions & 0 deletions docs/src/groups/general_linear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# The general linear group

```@autodocs
Modules = [LieGroups]
Pages = ["groups/general_linear_group.jl"]
Order = [:type, :function]
```
1 change: 1 addition & 0 deletions docs/src/groups/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@

| Group | Manifold | ``∘`` | Comment |
|:------|:---------|:---------:|:------|
| [`GeneralLinearGroup`](@ref) | [`InvertibleMatrices`](@extref `Manifolds.InvertibleMatrices`) | [`*`](@ref MatrixMultiplicationGroupOperation) | |
| [`TranslationGroup`](@ref) | [`Euclidean`](@extref `Manifolds.Euclidean`) | [`+`](@ref AdditionGroupOperation) | |
10 changes: 9 additions & 1 deletion docs/src/interface/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ The following sections collect these.

```@autodocs
Modules = [LieGroups]
Pages = ["addition.jl"]
Pages = ["addition_operation.jl"]
Order = [:type, :function]
```

## [Multiplication group operation](@id multiplication-operation-sec)

```@autodocs
Modules = [LieGroups]
Pages = ["multiplication_operation.jl"]
Order = [:type, :function]
```
2 changes: 1 addition & 1 deletion docs/src/notation.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
In this package,the notation introduced in [Manifolds.jl Notation](https://juliamanifolds.github.io/Manifolds.jl/latest/misc/notation.html) is used with the following additional parts.

| Symbol | Description | Also used | Comment |
|:--:|:--------------- |:--:|:-- |
|:----:|:--------------- |:----:|:--- |
| ``∘`` | a group operation | | |
| ``c_g:\mathcal G → \mathcal G`` | the conjugation map (with `g`) | | |
| ``\mathrm{e}`` | identity element of a group | | |
Expand Down
1 change: 1 addition & 0 deletions docs/src/tutorials/getstarted.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# 🚀 Get Started with LieGroups.jl
45 changes: 45 additions & 0 deletions docs/src/tutorials/transition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Transition from `GroupManifolds` in `Manifolds.jl`

One predecessor of `LieGroups.jl` are the [`GroupManifold`]()s in `Manifoldsjl`.
While this package provides the same features, one reason for a new package is,
that a “restart” offers the opportunity to put the main focus for the functions in this package
really on Lie groups.

This tutorial provides an overview of the necessary changes to your code if you based it on the predecessor.

## Table of function names and its successors

The following table lists all functions related to `GroupManifolds` and their new names
or replacements here in `LieGroups.jl`. In this code `G` always refers to the `GroupManifold`
in the first column and the [`LieGroup`](@ref) in the second.
Lie group elements (points) are always `g,h`,
Lie algebra elements (vectors) always `X, Y`.

New functions and types in this package are only mentioned, if they are worth a comment and if something changed.

The list is alphabetical, but first lists types, then functions

| `Manifolds.jl` | `LieGroups.jl` | Comment |
|:---------- |:---------- |:-------------- |
| `AdditionOperation` | [`AdditionGroupOperation`](@ref) | |
| `LeftForwardAction` | [`LeftGroupOperation`](@ref)
| `RightBackwardAction` | [`RightGroupOperation`](@ref) | |
| `LeftBackwardAction` | [`InverseRightGroupOperation`](@ref) | note that this is now also aa [`AbstractLeftGroupActionType`](@ref) |
| | [`LieAlgebra`](@ref)`(G)` | new to emphasize its menifold- and vector structure as well as for a few dispatch methods. |
| `GroupManifold(M, op)` | [`LieGroup`](@ref)`(M, op)` | |
| `RightForwardAction` | [`InverseLeftGroupOperation`](@ref) | note that this is an [`AbstractRightGroupActionType`](@ref) |
| `adjoint` | [`adjoint`](@ref) | now implemented with a default, when you provide [`diff_conjugate!`](@ref).
kellertuer marked this conversation as resolved.
Show resolved Hide resolved
| `apply_diff` | [`diff_apply`](@ref) | modifiers (diff) come first, consistent with [`ManifoldsDiff.jl`](https://juliamanifolds.github.io/ManifoldDiff.jl/stable/) |
| `apply_diff_group` | [`diff_group_apply`](@ref) | modifiers (diff/group) come first, consistent with [`ManifoldsDiff.jl`](https://juliamanifolds.github.io/ManifoldDiff.jl/stable/) |
| | [`conjugate`](@ref), [`diff_conjugate`](@ref) | a new function to model ``c_g: \mathcal G → \mathcal G`` given by ``c_g(h) = g∘h∘g^{-1}`` |
| `exp(G, g, X)` | `exp(`[`base_manifold`](@ref base_manifold(G::LieGroup))`(G), g, X)` | the previous defaults whenever not agreeing with the invariant one can now be accessed on the internal manifold |
| `exp_inv(G, g, X)` | [`exp`](@ref exp(G::LieGroup, g, X, t::Number))`(G, g, X)` | the exponential map invariant to the group operation is the default on Lie groups here |
| `exp_lie(G, X)` | [`exp`](@ref exp(G::LieGroup, e::Identity, X, t::Number))`(G, `[`Identity`](@ref)`(G), X)` | the (matrix) exponential is now the one at the [`Identity`](@ref)`(G)`, since there it agrees with the invariant one |
| `invervse_translate(G, g, h, c)` | [`inv_left_compose`](@ref)`(G, g, h)`, [`inv_right_compose`](@ref)`(G, g, h)` | compute ``g^{-1}∘h`` and ``g∘h^{-1}``, resp. |
kellertuer marked this conversation as resolved.
Show resolved Hide resolved
| `log(G, g, h)` | `log(`[`base_manifold`](@ref base_manifold(G::LieGroup))`(G), g, h)` | you can now access the previous defaults on the internal manifold whenever they do not agree with the invariant one |
| `log_inv(G, g, h)` | [`log`](@ref log(G::LieGroup, g, h))`(G, g, h)` | the logarithmic map invariant to the group operation is the default on Lie groups here |
| `log_lie(G, g)` | [`log`](@ref log(G::LieGroup, e::Identity, g))`(G, `[`Identity`](@ref)`(G), g)` | the (matrix) logarithm is now the one at the identity, since there it agrees with the invariant one |
| `switch_direction(A)` | [`inv`](@ref inv(::AbstractGroupAction))`(A)` | switches from an action to its inverse action (formerly the direction forward/backward, sometimes even left/right, do not confuse with the side left/right). |
| `switch_side(A)` | [`switch`](@ref switch(::AbstractGroupAction))`(A)` | switches from a left action to its corresponding right action. |
| `translate(G, g, h)` | [`compose`](@ref)`(G, g, h)` | unified to `compose` |
| `translate_diff(G, g, X, c)` | [`diff_left_compose`](@ref)`(G, g, h, X)`, [`diff_right_compose`](@ref)`(G, g, h, X)` | for compose ``∘(g,h)` we specify now whether we take the derivative with respect to the left (`g`) or right (`h`) argument
8 changes: 6 additions & 2 deletions src/LieGroups.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,31 @@ include("documentation_glossary.jl")
include("interface.jl")
include("Lie_algebra/Lie_algebra_interface.jl")
# Generic Operations
include("group_operations/addition.jl")
include("group_operations/addition_operation.jl")
include("group_operations/multiplication_operation.jl")

# Actions
include("group_actions/group_action_interface.jl")
include("group_actions/group_operation_action.jl")

# Lie groups
include("groups/translation_group.jl")
include("groups/general_linear_group.jl")

export LieGroup, LieAlgebra

export AbstractGroupOperation, Identity
export AdditionGroupOperation
export AbstractMultiplicationGroupOperation
export MatrixMultiplicationGroupOperation

export AbstractGroupActionType, AbstractGroupAction
export AbstractLeftGroupActionType, AbstractRightGroupActionType
export LeftGroupOperation, RightGroupOperation
export InverseLeftGroupOperation, InverseRightGroupOperation
export GroupOperationAction

export TranslationGroup
export TranslationGroup, GeneralLinearGroup

export adjoint, adjoint!, apply, apply!
export base_lie_group, base_manifold
Expand Down
3 changes: 0 additions & 3 deletions src/Lie_algebra/Lie_algebra_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ function ManifoldsBase.is_point(𝔤::LieAlgebra, X; kwargs...)
return ManifoldsBase.is_vector(G.manifold, e, X; kwargs...)
end

# Move this line already to ManifoldsBase? On Fibers of course.
LinearAlgebra.norm(𝔤::LieAlgebra, X) = LinearAlgebra.norm(𝔤.manifold, 𝔤.point, X)
# Non-mutating case with single number -> avoid ambiguity
LinearAlgebra.norm(𝔤::LieAlgebra, X::Real) = LinearAlgebra.norm(𝔤.manifold, 𝔤.point, X)
function LinearAlgebra.norm(
G::LieGroup{𝔽,O}, ::Identity{O}, X
Expand Down
24 changes: 23 additions & 1 deletion src/documentation_glossary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ end
# LaTeX
# Define LaTeX shortcuts
_tex(args...; kwargs...) = glossary(:LaTeX, args...; kwargs...)
define!(:LaTeX, :big, raw"\big")
define!(:LaTeX, :bigl, raw"\bigl")
define!(:LaTeX, :bigr, raw"\bigr")
define!(:LaTeX, :Big, raw"\Big")
Expand All @@ -59,11 +60,32 @@ define!(:LaTeX, :Bigr, raw"\Bigr")
define!(:LaTeX, :def, raw"\coloneqq")
define!(:LaTeX, :Cal, (letter) -> raw"\mathcal " * "$letter")
define!(:LaTeX, :exp, raw"\exp")
define!(:LaTeX, :frac, (a, b) -> raw"\frac" * "{$a}{$b}")
define!(:LaTeX, :Frak, (letter) -> raw"\mathfrak " * "$letter")
define!(:LaTeX, :l, "") # lazy fallback for sets
define!(:LaTeX, :r, "") # lazy fallback for sets
define!(:LaTeX, :log, raw"\log")
define!(:LaTeX, :qquad, raw"\qquad")
define!(:LaTeX, :quad, raw"\quad")
define!(:LaTeX, :rm, (letter) -> raw"\mathrm " * "$letter")
define!(:LaTeX, :rm, (letter) -> raw"\mathrm" * "{$letter}")
define!(
:LaTeX,
:Set,
(content, size="") ->
_tex(Symbol("$(size)l")) *
raw"\{ " *
"$(content)" *
_tex(Symbol("$(size)r")) *
raw" \}",
)
define!(
:LaTeX,
:SetDef,
(elem, cond, size="") ->
_tex(:Set, elem * raw"\ " * _tex(Symbol("$(size)")) * raw"|\ " * "$(cond)", size),
)
define!(:LaTeX, :sum, raw"\sum")
define!(:LaTeX, :transp, raw"\mathm{T}")
#
# ---
# Mathematics and semantic symbols
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Base.exp(

@doc "$(_doc_exp_add)"
function ManifoldsBase.exp!(
G::LieGroup{𝔽,AdditionGroupOperation},
::LieGroup{𝔽,AdditionGroupOperation},
g,
::Identity{AdditionGroupOperation},
X,
Expand Down
Loading
Loading