Skip to content

Commit

Permalink
is_flat returns true for Cholesky space and SPD with log-Cholesky met… (
Browse files Browse the repository at this point in the history
#685)

* 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 <[email protected]>
Co-authored-by: Mateusz Baran <[email protected]>
Co-authored-by: Simon Jacobsson <[email protected]>
  • Loading branch information
4 people authored Nov 15, 2023
1 parent 5d267d5 commit e5b5ae8
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 9 deletions.
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Manifolds"
uuid = "1cead3c2-87b3-11e9-0ccd-23c62b72b94e"
authors = ["Seth Axen <[email protected]>", "Mateusz Baran <[email protected]>", "Ronny Bergmann <[email protected]>", "Antoine Levitt <[email protected]>"]
version = "0.9.6"
version = "0.9.7"

[deps]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Expand Down
4 changes: 2 additions & 2 deletions src/manifolds/CholeskySpace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/manifolds/SymmetricPositiveDefiniteLogCholesky.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/manifolds/SymmetricPositiveSemidefiniteFixedRank.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion test/manifolds/cholesky_space.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
6 changes: 5 additions & 1 deletion test/manifolds/symmetric_positive_definite.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down

2 comments on commit e5b5ae8

@mateuszbaran
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register

Release notes:

Fixed

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/95387

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.9.7 -m "<description of version>" e5b5ae87683d9a98c9abfb003bf129b02a63b11d
git push origin v0.9.7

Please sign in to comment.