From cdf3f6c1898b0d298c79131192930e5928ec50c4 Mon Sep 17 00:00:00 2001 From: Mateusz Baran Date: Fri, 27 Oct 2023 11:34:22 +0200 Subject: [PATCH] Add `get_embedding` for `GeneralUnitaryMultiplicationGroup` (#670) * Add `get_embedding` for `GeneralUnitaryMultiplicationGroup` * add changelog action --- .github/workflows/changelog.yml | 12 ++++++++++++ .gitignore | 2 ++ NEWS.md | 4 +++- Project.toml | 4 ++++ src/groups/general_unitary_groups.jl | 6 +++++- src/groups/special_orthogonal.jl | 2 +- test/groups/special_orthogonal.jl | 2 ++ 7 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/changelog.yml diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 0000000000..b01a5a8ee9 --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,12 @@ +name: Check Changelog +on: + pull_request: + +jobs: + Check-Changelog: + name: Check Changelog Action + runs-on: ubuntu-latest + steps: + - uses: tarides/changelog-check-action@v2 + with: + changelog: NEWS.md \ No newline at end of file diff --git a/.gitignore b/.gitignore index 68db5183b7..4549900525 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ docs/Manifest.toml docs/build docs/src/generated docs/src/misc/contributing.md +docs/src/misc/CONTRIBUTING.md +docs/src/misc/NEWS.md benchmark/tune.json benchmark/results* docs/src/tutorials/*.md diff --git a/NEWS.md b/NEWS.md index ecb9a0bfef..b8e20f299f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,11 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.9.2] - 2023-10-26 +## [0.9.2] - 2023-10-27 ### Added - `rand(G; vector_at=Identity(G))` now works for translation, special orthogonal and special Euclidean groups `G` (issue [#665](https://github.com/JuliaManifolds/Manifolds.jl/issues/665)). +- `get_embedding` now works for `GeneralUnitaryMultiplicationGroup`. +- Github action that checks for NEWS.md changes. ## [0.9.1] - 2023-10-25 diff --git a/Project.toml b/Project.toml index a0276cde46..1507262039 100644 --- a/Project.toml +++ b/Project.toml @@ -49,18 +49,22 @@ Einsum = "0.4" Graphs = "1.4" HybridArrays = "0.4" Kronecker = "0.4, 0.5" +LinearAlgebra = "1.6" ManifoldDiff = "0.3.7" ManifoldsBase = "0.15.0" +Markdown = "1.6" MatrixEquations = "2.2" OrdinaryDiffEq = "6.31" Plots = "1" Quaternions = "0.5, 0.6, 0.7" +Random = "1.6" RecipesBase = "1.1" RecursiveArrayTools = "2" Requires = "0.5, 1" SimpleWeightedGraphs = "1.2" SpecialFunctions = "0.8, 0.9, 0.10, 1.0, 2" StaticArrays = "1.4.3" +Statistics = "1.6" StatsBase = "0.32, 0.33, 0.34" julia = "1.6" diff --git a/src/groups/general_unitary_groups.jl b/src/groups/general_unitary_groups.jl index 39faa74d03..804e6eecea 100644 --- a/src/groups/general_unitary_groups.jl +++ b/src/groups/general_unitary_groups.jl @@ -1,5 +1,5 @@ @doc raw""" - GeneralUnitaryMultiplicationGroup{T,𝔽,M} = GroupManifold{𝔽,M,MultiplicationOperation} + GeneralUnitaryMultiplicationGroup{T,𝔽,S} <: AbstractDecoratorManifold{𝔽} A generic type for Lie groups based on a unitary property and matrix multiplcation, see e.g. [`Orthogonal`](@ref), [`SpecialOrthogonal`](@ref), [`Unitary`](@ref), and [`SpecialUnitary`](@ref) @@ -136,6 +136,10 @@ function exp_lie!(::GeneralUnitaryMultiplicationGroup{TypeParameter{Tuple{4}}, return q end +function get_embedding(G::GeneralUnitaryMultiplicationGroup) + return get_embedding(G.manifold) +end + function inverse_translate(G::GeneralUnitaryMultiplicationGroup, p, q, ::LeftForwardAction) return inv(G, p) * q end diff --git a/src/groups/special_orthogonal.jl b/src/groups/special_orthogonal.jl index 2baf90822f..e5d30cae13 100644 --- a/src/groups/special_orthogonal.jl +++ b/src/groups/special_orthogonal.jl @@ -1,5 +1,5 @@ @doc raw""" - SpecialOrthogonal{n} <: GroupManifold{ℝ,Rotations{n},MultiplicationOperation} + SpecialOrthogonal{n} = GeneralUnitaryMultiplicationGroup{n,ℝ,DeterminantOneMatrices} Special orthogonal group ``\mathrm{SO}(n)`` represented by rotation matrices, see [`Rotations`](@ref). diff --git a/test/groups/special_orthogonal.jl b/test/groups/special_orthogonal.jl index 1359cbf9bd..f7cc93c295 100644 --- a/test/groups/special_orthogonal.jl +++ b/test/groups/special_orthogonal.jl @@ -13,6 +13,8 @@ using Manifolds: LeftForwardAction, RightBackwardAction @test is_default_metric(MetricManifold(G, EuclideanMetric())) @test is_flat(G) == (n == 2) + @test get_embedding(G) == Euclidean(n, n) + types = [Matrix{Float64}] if n == 2