From e5b5ae87683d9a98c9abfb003bf129b02a63b11d Mon Sep 17 00:00:00 2001 From: Simon Jacobsson <47160031+SimonKvantdator@users.noreply.github.com> Date: Wed, 15 Nov 2023 12:20:27 +0100 Subject: [PATCH] =?UTF-8?q?is=5Fflat=20returns=20true=20for=20Cholesky=20s?= =?UTF-8?q?pace=20and=20SPD=20with=20log-Cholesky=20met=E2=80=A6=20(#685)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * is_flat returns true for Cholesky space and SPD with log-Cholesky metric. * fix CI and bump version * add citation to `is_flat` * added reference for is_flat(::SymmetricPositiveSemidefiniteFixedRank) --------- Co-authored-by: Simon Jacobsson Co-authored-by: Mateusz Baran Co-authored-by: Simon Jacobsson --- NEWS.md | 6 ++++++ Project.toml | 2 +- src/manifolds/CholeskySpace.jl | 4 ++-- src/manifolds/SymmetricPositiveDefiniteLogCholesky.jl | 6 +++--- src/manifolds/SymmetricPositiveSemidefiniteFixedRank.jl | 2 +- test/manifolds/cholesky_space.jl | 2 +- test/manifolds/symmetric_positive_definite.jl | 6 +++++- 7 files changed, 19 insertions(+), 9 deletions(-) diff --git a/NEWS.md b/NEWS.md index 931ff41dda..b7bf9f8f4c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,6 +5,12 @@ 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.7] - 2023-11-14 + +### Fixed + +- Fixed `is_flat` for `CholeskySpace` and `SymmetricPositiveDefinite` with `LogCholeskyMetric` [https://github.com/JuliaManifolds/Manifolds.jl/issues/684](https://github.com/JuliaManifolds/Manifolds.jl/issues/684). + ## [0.9.6] - 2023-11-09 ### Fixed diff --git a/Project.toml b/Project.toml index 932393dddd..50ae539bec 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Manifolds" uuid = "1cead3c2-87b3-11e9-0ccd-23c62b72b94e" authors = ["Seth Axen ", "Mateusz Baran ", "Ronny Bergmann ", "Antoine Levitt "] -version = "0.9.6" +version = "0.9.7" [deps] Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" diff --git a/src/manifolds/CholeskySpace.jl b/src/manifolds/CholeskySpace.jl index ff3b9af276..5127235a07 100644 --- a/src/manifolds/CholeskySpace.jl +++ b/src/manifolds/CholeskySpace.jl @@ -132,9 +132,9 @@ end """ is_flat(::CholeskySpace) -Return false. [`CholeskySpace`](@ref) is not a flat manifold. +Return true. [`CholeskySpace`](@ref) is a flat manifold. See Proposition 8 of [Lin:2019](@cite). """ -is_flat(M::CholeskySpace) = false +is_flat(M::CholeskySpace) = true @doc raw""" log(M::CholeskySpace, X, p, q) diff --git a/src/manifolds/SymmetricPositiveDefiniteLogCholesky.jl b/src/manifolds/SymmetricPositiveDefiniteLogCholesky.jl index 25c7d22d42..47c43ea723 100644 --- a/src/manifolds/SymmetricPositiveDefiniteLogCholesky.jl +++ b/src/manifolds/SymmetricPositiveDefiniteLogCholesky.jl @@ -99,10 +99,10 @@ end """ is_flat(::MetricManifold{ℝ,<:SymmetricPositiveDefinite,LogCholeskyMetric}) -Return false. [`SymmetricPositiveDefinite`](@ref) with [`LogCholeskyMetric`](@ref) -is not a flat manifold. +Return true. [`SymmetricPositiveDefinite`](@ref) with [`LogCholeskyMetric`](@ref) +is a flat manifold. See Proposition 8 of [Lin:2019](@cite). """ -is_flat(M::MetricManifold{ℝ,<:SymmetricPositiveDefinite,LogCholeskyMetric}) = false +is_flat(M::MetricManifold{ℝ,<:SymmetricPositiveDefinite,LogCholeskyMetric}) = true @doc raw""" log(M::MetricManifold{ℝ,<:SymmetricPositiveDefinite,LogCholeskyMetric}, p, q) diff --git a/src/manifolds/SymmetricPositiveSemidefiniteFixedRank.jl b/src/manifolds/SymmetricPositiveSemidefiniteFixedRank.jl index 9be8593caf..0f096829b7 100644 --- a/src/manifolds/SymmetricPositiveSemidefiniteFixedRank.jl +++ b/src/manifolds/SymmetricPositiveSemidefiniteFixedRank.jl @@ -156,7 +156,7 @@ end """ is_flat(::SymmetricPositiveSemidefiniteFixedRank) -Return false. [`SymmetricPositiveSemidefiniteFixedRank`](@ref) is not a flat manifold. +Return false. [`SymmetricPositiveSemidefiniteFixedRank`](@ref) is not a flat manifold. See Theorem A.18 in [MassartAbsil:2020](@cite). """ is_flat(M::SymmetricPositiveSemidefiniteFixedRank) = false diff --git a/test/manifolds/cholesky_space.jl b/test/manifolds/cholesky_space.jl index 2cbd2e11db..3fe165f654 100644 --- a/test/manifolds/cholesky_space.jl +++ b/test/manifolds/cholesky_space.jl @@ -4,7 +4,7 @@ include("../utils.jl") M = Manifolds.CholeskySpace(3) @test repr(M) == "CholeskySpace(3)" - @test !is_flat(M) + @test is_flat(M) types = [Matrix{Float64}] TEST_FLOAT32 && push!(types, Matrix{Float32}) diff --git a/test/manifolds/symmetric_positive_definite.jl b/test/manifolds/symmetric_positive_definite.jl index 254f187f69..e8d0e6c091 100644 --- a/test/manifolds/symmetric_positive_definite.jl +++ b/test/manifolds/symmetric_positive_definite.jl @@ -34,7 +34,11 @@ include("../utils.jl") end @testset "$(typeof(M))" begin @test representation_size(M) == (3, 3) - @test !is_flat(M) + if M === M3 + @test is_flat(M) + else + @test !is_flat(M) + end for T in types exp_log_atol_multiplier = 8.0 if T <: MMatrix{3,3,Float64}