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

Define Meta Manifolds already in ManifoldsBase #169

Merged
merged 62 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
164220a
Move Tangent spacae/bundle and Vector Bundle to ManifoldsBase.
kellertuer Sep 30, 2023
6cd5eea
Fix order and a typo.
kellertuer Sep 30, 2023
ba111da
add Requires.jl
kellertuer Oct 1, 2023
d402501
Work on Test coverage.
kellertuer Oct 1, 2023
70beb85
Switch do Documenter.jl 1.0 and introduce DocumenterCitations.
kellertuer Oct 1, 2023
e7754af
Upsi forgot to load Requires.
kellertuer Oct 1, 2023
8929bc2
half-done moving metamanifolds
mateuszbaran Oct 1, 2023
09224cf
update CI
mateuszbaran Oct 1, 2023
f820305
fix tests
mateuszbaran Oct 1, 2023
75b4826
Some ProductManifold fixes
mateuszbaran Oct 1, 2023
898e424
run ProductManifold tests on CI
mateuszbaran Oct 1, 2023
fc94b74
tests and fixes
mateuszbaran Oct 2, 2023
a3acb8e
more tests
mateuszbaran Oct 2, 2023
c58cce1
more tests
mateuszbaran Oct 2, 2023
e1a0a19
tests, tests, tests...
mateuszbaran Oct 2, 2023
a98fd0e
... tests, tests, tests...
mateuszbaran Oct 3, 2023
3a5e028
... tests, tests...
mateuszbaran Oct 3, 2023
4e6f0f3
Lost in documentation.
kellertuer Oct 3, 2023
d24b047
remove cotangent stuff
mateuszbaran Oct 3, 2023
4dc5ac3
forgot these two
mateuszbaran Oct 3, 2023
f6602d0
Documentation rework I
kellertuer Oct 4, 2023
bb6436e
... tests?
mateuszbaran Oct 4, 2023
773a766
test
mateuszbaran Oct 4, 2023
1f1ee78
Merge branch 'kellertuer/VectorBundle' of github.com:JuliaManifolds/M…
kellertuer Oct 4, 2023
d59f770
Reorganize code I
kellertuer Oct 4, 2023
4b05b19
move tensor product back to Manifolds.jl. move change_metric and repr…
mateuszbaran Oct 4, 2023
b6c3912
test!
mateuszbaran Oct 4, 2023
83a5d80
fix
mateuszbaran Oct 4, 2023
44e0a37
Move Vector transports over. Remove deprecated names.
kellertuer Oct 5, 2023
955b9b4
TangentSpace cleanup, part 1
mateuszbaran Oct 5, 2023
792c276
Add a wikipedia link.
kellertuer Oct 6, 2023
d77c997
Just a bit of docs before I got confused again
kellertuer Oct 7, 2023
58b39bd
remove bundles
mateuszbaran Oct 8, 2023
3810090
remove empty exports
mateuszbaran Oct 8, 2023
3c95f86
Work through doc strings in VectorFiber.jl
kellertuer Oct 9, 2023
9251d29
simplify fiber hierarchy
mateuszbaran Oct 9, 2023
6ce02b2
add tests, remove VT
mateuszbaran Oct 9, 2023
1d4d2fa
restructure + some tests
mateuszbaran Oct 10, 2023
c3a6b12
update NEWS
mateuszbaran Oct 10, 2023
22aaf3a
tests for Sasaki retraction
mateuszbaran Oct 10, 2023
0899b38
Update src/retractions.jl
mateuszbaran Oct 10, 2023
183f1dd
Work on the documentation and add also 0.14.12 to News (mea culpa).
kellertuer Oct 10, 2023
151e152
Fix documentation.
kellertuer Oct 11, 2023
76f0b69
Add Cotangentspace to exports.
kellertuer Oct 11, 2023
886e2d1
improve docstring of Fiber
mateuszbaran Oct 11, 2023
f52e6bc
Work on test coverage.
kellertuer Oct 11, 2023
0caa323
Merge branch 'kellertuer/VectorBundle' of github.com:JuliaManifolds/M…
kellertuer Oct 11, 2023
75409ce
Unify notation.
kellertuer Oct 12, 2023
b474372
add one further test; only include the manifolds definitions and not …
kellertuer Oct 13, 2023
4222c96
update PowerManifold to optionally static
mateuszbaran Oct 14, 2023
4761bfc
More tests
mateuszbaran Oct 14, 2023
c2073ec
Introduce × and nicer show methods for ProductRetraction, InverseProd…
kellertuer Oct 15, 2023
3a04a1d
Introduce retract for non-product retractions on the ProductManifold.
kellertuer Oct 15, 2023
4d01dca
Documentation, News and a few fixes.
kellertuer Oct 15, 2023
d88cc85
add tests for the new cross and show.
kellertuer Oct 15, 2023
8a3f9b3
Test coverage ++.
kellertuer Oct 15, 2023
490dc7c
Fix docs.
kellertuer Oct 15, 2023
ce0c58c
code coverage ++ (2).
kellertuer Oct 15, 2023
f0d18b9
fix VTd
mateuszbaran Oct 15, 2023
a2c7aec
test coverage ++ (3).
kellertuer Oct 16, 2023
ef36dc7
Merge branch 'kellertuer/VectorBundle' of github.com:JuliaManifolds/M…
kellertuer Oct 16, 2023
fb37b01
fix docstring
mateuszbaran Oct 16, 2023
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
12 changes: 11 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,28 @@ version = "0.14.12"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"

[weakdeps]
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"

[extensions]
ManifoldsBaseRecursiveArrayToolsExt = "RecursiveArrayTools"

[compat]
DoubleFloats = ">= 0.9.2"
RecursiveArrayTools = "2"
Requires = "1"
julia = "1.0"

[extras]
DoubleFloats = "497a8b3b-efae-58df-a0af-a86822472b78"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "DoubleFloats", "ForwardDiff", "OrdinaryDiffEq", "ReverseDiff", "StaticArrays"]
test = ["Test", "DoubleFloats", "ForwardDiff", "OrdinaryDiffEq", "ReverseDiff", "StaticArrays", "RecursiveArrayTools"]
4 changes: 3 additions & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[deps]
CondaPkg = "992eb4ea-22a4-4c89-a5bb-47a3300528ab"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
ManifoldsBase = "3362f125-f0bb-47a3-aa74-596ffd7ef2fb"

[compat]
CondaPkg = "0.2"
Documenter = "0.27"
Documenter = "1"
DocumenterCitations = "1.2"
ManifoldsBase = "0.14"
8 changes: 7 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ if "--quarto" ∈ ARGS
end

using Documenter: DocMeta, HTML, MathJax3, deploydocs, makedocs
using DocumenterCitations
using ManifoldsBase

makedocs(
# (e) ...finally! make docs
bib = CitationBibliography(joinpath(@__DIR__, "src", "references.bib"); style = :alpha)
makedocs(;
# for development, we disable prettyurls
format = HTML(;
mathengine = MathJax3(),
prettyurls = get(ENV, "CI", nothing) == "true",
Expand All @@ -55,6 +59,8 @@ makedocs(
"Manifolds" => "manifolds.md",
"Decorating/Extending a Manifold" => "decorator.md",
"Bases for tangent spaces" => "bases.md",
"References" => "references.md",
],
plugins = [bib],
)
deploydocs(repo = "github.com/JuliaManifolds/ManifoldsBase.jl.git", push_preview = true)
19 changes: 19 additions & 0 deletions docs/src/assets/citations.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* Taken from https://juliadocs.org/DocumenterCitations.jl/v1.2/styling/ */

.citation dl {
display: grid;
grid-template-columns: max-content auto; }
.citation dt {
grid-column-start: 1; }
.citation dd {
grid-column-start: 2;
margin-bottom: 0.75em; }
.citation ul {
padding: 0 0 2.25em 0;
margin: 0;
list-style: none;}
.citation ul li {
text-indent: -2.25em;
margin: 0.33em 0.5em 0.5em 2.25em;}
.citation ol li {
padding-left:0.75em;}
10 changes: 10 additions & 0 deletions docs/src/manifolds.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ Pages = ["src/PowerManifold.jl"]
Order = [:macro, :type, :function]
```

## VectorBundles and TangentSpaces

```@autodocs
Modules = [ManifoldsBase]
Pages = ["VectorBundle.jl"]
Order = [:macro, :type, :function]
Public=true
Private=false
```

## `ValidationManifold`

[`ValidationManifold`](@ref) is a simple decorator using the [`AbstractDecoratorManifold`](@ref) that “decorates” a manifold with tests that all involved points and vectors are valid for the wrapped manifold.
Expand Down
87 changes: 87 additions & 0 deletions docs/src/references.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# ManifoldBase.jl
#
# Literature used within the Documentation of ManifoldsBase.jl
# ========================================================
#
# citekeys should be of the form AllAuthors:Year, unless there is really many authors.
#
# ----------------------------------------------------------------------------------------
@book{AbsilMahonySepulchre:2008,
AUTHOR = {Absil, P.-A. and Mahony, R. and Sepulchre, R.},
DOI = {10.1515/9781400830244},
NOTE = {available online at [press.princeton.edu/chapters/absil/](http://press.princeton.edu/chapters/absil/)},
PUBLISHER = {Princeton University Press},
TITLE = {Optimization Algorithms on Matrix Manifolds},
YEAR = {2008},
}

@article{EhlersPiraniSchild:1972,
DOI = {10.1007/s10714-012-1353-4},
YEAR = {1972},
PUBLISHER = {Springer Science and Business Media {LLC}},
VOLUME = {44},
NUMBER = {6},
PAGES = {1587--1609},
AUTHOR = {J\"{u}rgen Ehlers and Felix A. E. Pirani and Alfred Schild},
TITLE = {Republication of: The geometry of free fall and light propagation},
JOURNAL = {General Relativity and Gravitation}
}

@article{LorenziPennec:2013,
DOI = {10.1007/s10851-013-0470-3},
EPRINT = {00870489},
EPRINTTYPE = {HAL},
YEAR = {2013},
VOLUME = {50},
NUMBER = {1-2},
PAGES = {5--17},
AUTHOR = {Marco Lorenzi and Xavier Pennec},
TITLE = {Efficient Parallel Transport of Deformations in Time Series of Images: From Schild's to Pole Ladder},
JOURNAL = {Journal of Mathematical Imaging and Vision}
}
@book{Lee:2019,
AUTHOR = {John M. Lee},
DOI = {10.1007/978-3-319-91755-9},
ISBN = {978-3-319-91755-9},
PUBLISHER = {Springer Cham},
TITLE = {Introduction to Riemannian Manifolds},
YEAR = {2019}
}
@inproceedings{MuralidharanFletcher:2012,
DOI = {10.1109/cvpr.2012.6247780},
YEAR = 2012,
AUTHOR = {P. Muralidharan and P. T. Fletcher},
TITLE = {Sasaki metrics for analysis of longitudinal data on manifolds},
BOOKTITLE = {2012 {IEEE} Conference on Computer Vision and Pattern Recognition}
}
@article{Pennec:2018,
AUTHOR ={Xavier Pennec},
EPRINT = {1805.11436},
EPRINTTYPE = {arXiv},
Journal = {arXiv Preprint},
TITLE = {Parallel Transport with Pole Ladder: a Third Order Scheme in Affine Connection Spaces which is Exact in Affine Symmetric Spaces.},
YEAR = {2018},
URL = {https://arxiv.org/abs/1805.11436},
}
@article{Sasaki:1958,
DOI = {10.2748/tmj/1178244668},
YEAR = {1958},
VOLUME = {10},
NUMBER = {3},
AUTHOR = {Shigeo Sasaki},
TITLE = {On the differential geometry of tangent bundles of Riemannian manifolds},
JOURNAL = {Tohoku Math. J.}
}
@article{SatoIwai:2013,
AUTHOR = {Hiroyuki Sato and Toshihiro Iwai},
ARCHIVEPREFIX = {arXiv},
DOI = {10.1080/02331934.2013.836650},
EPRINT = {1302.0125},
JOURNAL = {Optimization},
NUMBER = {4},
PAGES = {1011--1031},
PUBLISHER = {Informa {UK} Limited},
TITLE = {A new, globally convergent Riemannian conjugate gradient method},
VOLUME = {64},
YEAR = {2013}
}
4 changes: 4 additions & 0 deletions docs/src/references.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Literature

```@bibliography
```
7 changes: 6 additions & 1 deletion docs/src/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ Throughout the documentation of `ManifoldsBase.jl` we might use the [Euclidean S
AbstractManifold
```

which should store information about the manifold, for example parameters inherent to the manifold.
which should store information about the manifold, for example parameters inherent to the manifold. The parameters are stored in two possible ways, as a type parameter to dispatch on or as a field. For these the following internal functions exist

```@docs
ManifoldsBase.wrap_type_parameter
ManifoldsBase.TypeParameter
```

## Points on a manifold

Expand Down
2 changes: 1 addition & 1 deletion docs/src/vector_transports.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A _vector transport_ is a way to transport a vector between two tangent spaces.
Let ``p,q ∈ \mathcal M`` be given, ``c`` the curve along which we want to transport (cf. [parallel transport](@ref subsec-parallel-transport), for example a geodesic or curve given by a retraction.
We can specify the geodesic or curve a retraction realises for example by a direction ``d``.

More precisely using [^AbsilMahonySepulchre2008], Def. 8.1.1, a vector transport
More precisely using [AbsilMahonySepulchre:2008](@cite), Def. 8.1.1, a vector transport
``T_{p,d}: T_p\mathcal M \to T_q\mathcal M``, ``p∈ \mathcal M``, ``Y∈ T_p\mathcal M`` is a smooth mapping
associated to a retraction ``\operatorname{retr}_p(Y) = q`` such that

Expand Down
118 changes: 118 additions & 0 deletions ext/FiberBundleRecursiveArrayToolsExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@

@inline function allocate_result(M::FiberBundle, f::TF) where {TF}
return ArrayPartition(allocate_result(M.manifold, f), allocate_result(M.fiber, f))
end

function get_vector(M::FiberBundle, p, X, B::AbstractBasis)
n = manifold_dimension(M.manifold)
xp1 = submanifold_component(p, Val(1))
return ArrayPartition(
get_vector(M.manifold, xp1, X[1:n], B),
get_vector(M.fiber, xp1, X[(n + 1):end], B),
)
end
function get_vector(
M::FiberBundle,
p,
X,
B::CachedBasis{𝔽,<:AbstractBasis{𝔽},<:FiberBundleBasisData},
) where {𝔽}
n = manifold_dimension(M.manifold)
xp1 = submanifold_component(p, Val(1))
return ArrayPartition(
get_vector(M.manifold, xp1, X[1:n], B.data.base_basis),
get_vector(M.fiber, xp1, X[(n + 1):end], B.data.fiber_basis),
)
end

function get_vectors(
M::FiberBundle,
p::ArrayPartition,
B::CachedBasis{𝔽,<:AbstractBasis{𝔽},<:FiberBundleBasisData},
) where {𝔽}
xp1 = submanifold_component(p, Val(1))
zero_m = zero_vector(M.manifold, xp1)
zero_f = zero_vector(M.fiber, xp1)
vs = typeof(ArrayPartition(zero_m, zero_f))[]
for bv in get_vectors(M.manifold, xp1, B.data.base_basis)
push!(vs, ArrayPartition(bv, zero_f))
end
for bv in get_vectors(M.fiber, xp1, B.data.fiber_basis)
push!(vs, ArrayPartition(zero_m, bv))
end
return vs
end

"""
getindex(p::ArrayPartition, M::FiberBundle, s::Symbol)
p[M::FiberBundle, s]

Access the element(s) at index `s` of a point `p` on a [`FiberBundle`](@ref) `M` by
using the symbols `:point` and `:vector` or `:fiber` for the base and vector or fiber
component, respectively.
"""
@inline function Base.getindex(p::ArrayPartition, M::FiberBundle, s::Symbol)
(s === :point) && return p.x[1]
(s === :vector || s === :fiber) && return p.x[2]
return throw(DomainError(s, "unknown component $s on $M."))
end

"""
setindex!(p::ArrayPartition, val, M::FiberBundle, s::Symbol)
p[M::VectorBundle, s] = val

Set the element(s) at index `s` of a point `p` on a [`FiberBundle`](@ref) `M` to `val` by
using the symbols `:point` and `:fiber` or `:vector` for the base and fiber or vector
component, respectively.

!!! note

The *content* of element of `p` is replaced, not the element itself.
"""
@inline function Base.setindex!(x::ArrayPartition, val, M::FiberBundle, s::Symbol)
if s === :point
return copyto!(x.x[1], val)
elseif s === :vector || s === :fiber
return copyto!(x.x[2], val)
else
throw(DomainError(s, "unknown component $s on $M."))
end
end

@inline function Base.view(x::ArrayPartition, M::FiberBundle, s::Symbol)
(s === :point) && return x.x[1]
(s === :vector || s === :fiber) && return x.x[2]
throw(DomainError(s, "unknown component $s on $M."))
end

function _vector_transport_direction(
M::VectorBundle,
p,
X,
d,
m::FiberBundleProductVectorTransport,
)
px, pVx = submanifold_components(M.manifold, p)
VXM, VXF = submanifold_components(M.manifold, X)
dx, dVx = submanifold_components(M.manifold, d)
return ArrayPartition(
vector_transport_direction(M.manifold, px, VXM, dx, m.method_point),
vector_transport_direction(M.fiber, px, VXF, dx, m.method_fiber),
)
end

function _vector_transport_to(
M::VectorBundle,
p,
X,
q,
m::FiberBundleProductVectorTransport,
)
px, pVx = submanifold_components(M.manifold, p)
VXM, VXF = submanifold_components(M.manifold, X)
qx, qVx = submanifold_components(M.manifold, q)
return ArrayPartition(
vector_transport_to(M.manifold, px, VXM, qx, m.method_point),
vector_transport_to(M.manifold, px, VXF, qx, m.method_fiber),
)
end
Loading
Loading