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

Extend support for SpecialEuclidean, fiber bundles, optionally static sizes #642

Merged
merged 91 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from 68 commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
fe4f1f7
Add action of SE(n) on R^n
mateuszbaran Jul 10, 2023
6ed9547
some docs
mateuszbaran Jul 11, 2023
de9fd2c
formatting
mateuszbaran Jul 11, 2023
41b7bcf
Merge branch 'master' into mbaran/special-euclidean-revisited
mateuszbaran Jul 11, 2023
2dff357
expand tutorial
mateuszbaran Jul 12, 2023
1fa3ac7
Start describing dynamics
mateuszbaran Jul 12, 2023
c4f5df3
fiber bundles pt. 1
mateuszbaran Jul 26, 2023
950a74e
fix product manifold
mateuszbaran Jul 26, 2023
de7d281
direct sum bundle
mateuszbaran Jul 27, 2023
b4cf7ac
optionally static sizes: part 1
mateuszbaran Aug 18, 2023
54799cb
optionally static sizes: part 2
mateuszbaran Aug 18, 2023
0f0be00
Merge branch 'master' into mbaran/special-euclidean-revisited
mateuszbaran Sep 3, 2023
0f8e431
a few fixes
mateuszbaran Sep 3, 2023
f8961e7
bugfixing
mateuszbaran Sep 5, 2023
b399539
Stiefel, SPD, minor fixes
mateuszbaran Sep 6, 2023
7ee384a
remove `ProductRepr`, bugfixing, optional static reworking
mateuszbaran Sep 6, 2023
0b781ac
finish conversion to optionally static
mateuszbaran Sep 7, 2023
85549d8
updating Hyperbolic
mateuszbaran Sep 7, 2023
0ca6811
Merge branch 'master' into mbaran/special-euclidean-revisited
mateuszbaran Sep 7, 2023
83c0272
fix CI issue
mateuszbaran Sep 7, 2023
60aed68
use type parameter in a couple of places
mateuszbaran Sep 8, 2023
9472f7b
updates
mateuszbaran Sep 8, 2023
19cf391
more tests and some fixes
mateuszbaran Sep 11, 2023
2ad761c
Update NEWS.md
mateuszbaran Sep 11, 2023
8e441e5
address review regarding optionally static size
mateuszbaran Sep 12, 2023
999d0de
remove get_mn
mateuszbaran Sep 12, 2023
49fa34d
add some comments, remove old code
mateuszbaran Sep 12, 2023
52f8724
bump tolerance
mateuszbaran Sep 13, 2023
73aadae
fix test
mateuszbaran Sep 13, 2023
59d98e0
improve code coverage
mateuszbaran Sep 14, 2023
40bf7e5
Merge remote-tracking branch 'origin/mbaran/special-euclidean-revisit…
mateuszbaran Sep 14, 2023
8e8bc40
fix Orthogonal, _get_parameter for SE(N), improved NEWS
mateuszbaran Sep 14, 2023
89265a1
a few tests
mateuszbaran Sep 18, 2023
43051eb
tests
mateuszbaran Sep 18, 2023
48dd288
more tests
mateuszbaran Sep 19, 2023
ca31836
mostly docs and structure
mateuszbaran Sep 19, 2023
26cee70
Merge branch 'master' into mbaran/special-euclidean-revisited
mateuszbaran Sep 25, 2023
c90e9a3
generalize a couple of methods
mateuszbaran Sep 25, 2023
bfe4fe0
remove some less-developed parts
mateuszbaran Sep 25, 2023
3f04abd
reworking action direction and invariant metrics
mateuszbaran Sep 26, 2023
d79ed6c
Merge branch 'master' into mbaran/special-euclidean-revisited
mateuszbaran Sep 28, 2023
a326c63
adapting to moving some meta-manifolds to ManifoldsBase
mateuszbaran Oct 5, 2023
7632169
some updates
mateuszbaran Oct 10, 2023
baa79b1
Merge branch 'master' into mbaran/special-euclidean-revisited
mateuszbaran Oct 11, 2023
561b0b5
some updates
mateuszbaran Oct 11, 2023
b2dfeee
fixes
mateuszbaran Oct 11, 2023
32c8e96
fixes
mateuszbaran Oct 13, 2023
3a1e4d6
fixes
mateuszbaran Oct 14, 2023
0b99b8e
adapt power manifold
mateuszbaran Oct 14, 2023
600f46f
Adapt to recent changes in ManifoldsBase 0.15 WIP
mateuszbaran Oct 15, 2023
17b5a4a
minor improvements
mateuszbaran Oct 15, 2023
d6091f8
minor adaptation of (inverse) retractions
mateuszbaran Oct 16, 2023
0a1ecfc
adapt to exp/retract unification
mateuszbaran Oct 16, 2023
7cfde4e
Mostly update to error in is_point/is_vector changes
mateuszbaran Oct 16, 2023
f26d329
replaced a bit too eagerly
mateuszbaran Oct 16, 2023
8e97d94
fix a few more errors
mateuszbaran Oct 16, 2023
3910dcd
remove deprecations, update NEWS
mateuszbaran Oct 17, 2023
e3fd23a
Fix errors that changed in type.
kellertuer Oct 17, 2023
d39ca6e
Adapt a few more error tests.
kellertuer Oct 17, 2023
b640264
Fix a. few more errors.
kellertuer Oct 17, 2023
eb3f920
Update test/groups/general_unitary_groups.jl
kellertuer Oct 17, 2023
2629646
some fixes
mateuszbaran Oct 17, 2023
09cdd06
More fixes.
kellertuer Oct 17, 2023
4e2980e
Merge branch 'mbaran/special-euclidean-revisited' of github.com:Julia…
kellertuer Oct 17, 2023
7317d20
Fix the remaining failing tests for group
kellertuer Oct 17, 2023
3732499
===
mateuszbaran Oct 17, 2023
30c1597
Merge branch 'master' into mbaran/special-euclidean-revisited
mateuszbaran Oct 18, 2023
63f5364
Merge remote-tracking branch 'origin/mbaran/special-euclidean-revisit…
mateuszbaran Oct 18, 2023
cb78c99
formatting
mateuszbaran Oct 18, 2023
0f52313
update some docs
mateuszbaran Oct 18, 2023
6d2c04e
better docs for group actions
mateuszbaran Oct 21, 2023
96c3ed5
bump versions
mateuszbaran Oct 21, 2023
5174442
bump docs compat
mateuszbaran Oct 21, 2023
7399d05
randomly trying to fix docs?
mateuszbaran Oct 22, 2023
7acb501
f
mateuszbaran Oct 22, 2023
9da6dbf
try this
mateuszbaran Oct 22, 2023
7660641
try this, try that...
mateuszbaran Oct 22, 2023
f6162eb
fix docs
mateuszbaran Oct 22, 2023
c11f82f
fixing again
mateuszbaran Oct 22, 2023
0d38cf3
Maybe fix?
mateuszbaran Oct 22, 2023
2cc48b8
cut some redundant tests
mateuszbaran Oct 22, 2023
34396b3
cut repeated tests of ProductManifold (they exist in ManifoldsBase.jl)
mateuszbaran Oct 22, 2023
9ea0d83
a bit of testing
mateuszbaran Oct 22, 2023
a86aa3f
not sure what these are for
mateuszbaran Oct 22, 2023
d98622a
a bit of fiber bundle cleanup
mateuszbaran Oct 22, 2023
db2c0c3
improve coverage a little
mateuszbaran Oct 23, 2023
7481720
some docs
mateuszbaran Oct 23, 2023
697df39
docs improvements; split group actions to a separate page
mateuszbaran Oct 23, 2023
da0d4b3
Apply suggestions from code review
mateuszbaran Oct 23, 2023
489b2f7
add changelog to docs
mateuszbaran Oct 23, 2023
34fcb0a
fix link
mateuszbaran Oct 23, 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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
julia-version: ["1.6", "1.8", "~1.9.0-0"]
julia-version: ["1.6", "~1.9.0-0"]
os: [ubuntu-latest, macOS-latest]
group:
- 'test_manifolds'
Expand Down
107 changes: 107 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
# Changelog
kellertuer marked this conversation as resolved.
Show resolved Hide resolved

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.0] - 2023-mm-dd

### Added

- Vector bundles are generalized to fiber bundles. Old `BundleFibers` functionality was reworked to better match mathematical abstractions. Fiber bundle functionality is experimental and minor changes may happen without a breaking release, with the exception of `TangentBundle` which is considered to be stable.
- `RotationTranslationAction` is introduced.

### Changed

- Sizes of all manifolds can now be either encoded in type or stored in a field to avoid over-specialization.
The default is set to store the size in type parameter (except for `PowerManifold` and its variants), replicating the previous behavior.
For field storage, pass the `parameter=:field` keyword argument to manifold constructor.
For example statically sized `CenteredMatrices{m,n}` is now `CenteredMatrices{TypeParameter{Tuple{m,n}}}`, whereas the type of special Euclidean group with field-stored size is `CenteredMatrices{Tuple{Int,Int}}`. Similar change applies to:
- `CenteredMatrices{m,n}`,
- `CholeskySpace{N}`,
- `Elliptope{N,K}`,
- `Euclidean`,
- `FixedRankMatrices{m,n,k}`,
- `KendallsPreShapeSpace{n,k}`,
- `KendallsShapeSpace{n,k}`,
- `GeneralLinear{n}`,
- `GeneralUnitaryMultiplicationGroup{n}`,
- `GeneralizedGrassmann{n,k}`,
- `GeneralizedStiefel{n,k}`,
- `Grassmann{n,k}`,
- `Heisenberg{n}`,
- `Hyperbolic{n}`,
- `MultinomialMatrices{N,M}`,
- `MultinomialDoublyStochastic{n}`,
- `MultinomialSymmetric{n}`,
- `Orthogonal{n}`,
- `PowerManifold`,
- `PositiveArrays`,
- `PositiveMatrices`,
- `PositiveNumbers`,
- `ProbabilitySimplex{n}`,
- `SPDFixedDeterminant{n}`,
- `SpecialLinear{n}`,
- `SpecialOrthogonal{n}`,
- `SpecialUnitary{n}`,
- `SpecialEuclidean{n}`,
- `SpecialEuclideanManifold{n}`,
- `Spectrahedron{n,k}`,
- `SphereSymmetricMatrices{N}`,
- `Stiefel{n,k}`,
- `SymmetricMatrices{N}`,
- `SymmetricPositiveDefinite{n}`,
- `SymmetricPositiveSemidefiniteFixedRank{n,k}`,
- `Symplectic{n}`,
- `SymplecticStiefel{n,k}`,
- `TranslationGroup`,
- `Tucker`.

For example

```{julia}
function Base.show(io::IO, ::CenteredMatrices{m,n}) where {m,n}
return print(io, "CenteredMatrices($m, $n)")
end
```

needs to be replaced with

```{julia}
function Base.show(io::IO, ::CenteredMatrices{TypeParameter{Tuple{m,n}}}) where {m,n}
return print(io, "CenteredMatrices($m, $n)")
end
```

for statically-sized groups and

```{julia}
function Base.show(io::IO, M::CenteredMatrices{Tuple{Int,Int}})
m, n = get_parameter(M.size)
return print(io, "CenteredMatrices($m, $n; parameter=:field)")
end
```

for groups with size stored in field. Alternatively, you can use a single generic method like this:

```{julia}
function Base.show(io::IO, M::CenteredMatrices{T}) where {T}
m, n = get_parameter(M)
if T <: TypeParameter
return print(io, "CenteredMatrices($m, $n)")
else
return print(io, "CenteredMatrices($m, $n; parameter=:field)")
end
end
```

- Argument order for type aliases `RotationActionOnVector` and `RotationTranslationActionOnVector`: most often dispatched on argument is now first.
- A more consistent handling of action direction was introduced. 4-valued `ActionDirection` was split into 2-valued `ActionDirection` (either left or right action) and `GroupActionSide` (action acting from the left or right side). See [https://github.com/JuliaManifolds/Manifolds.jl/issues/637](https://github.com/JuliaManifolds/Manifolds.jl/issues/637) for a design discussion.

### Removed

- `ProductRepr` is removed; please use `ArrayPartition` instead.
- Default methods throwing "not implemented" `ErrorException` for some group-related operations. Standard `MethodError` is now thrown instead.
- `LinearAffineMetric` was deprecated in a previous release and the symbol is now removed.
Please use `AffineInvariantMetric` instead.
22 changes: 9 additions & 13 deletions benchmark/benchmarks.jl
Copy link
Member

Choose a reason for hiding this comment

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

Did you rerun the benchmark? Does it sill work?

I am still not so sure where to leave this and what to do with this.

Copy link
Member Author

Choose a reason for hiding this comment

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

I haven't run that benchmark in a very long time but I don't want to work on it more than necessary in this PR.

Copy link
Member

Choose a reason for hiding this comment

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

No, sure this was more a general remark that we should think that to do with this file or benchmarks in general.

Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function add_manifold_benchmarks()
inverse_retraction_methods=inverse_retraction_methods_rot,
)

pts_prod_mpoints = [Manifolds.ProductRepr(p[1], p[2]) for p in zip(pts_s2, pts_r2)]
pts_prod_mpoints = [ArrayPartition(p[1], p[2]) for p in zip(pts_s2, pts_r2)]
add_manifold(
m_prod,
pts_prod_mpoints,
Expand All @@ -155,14 +155,14 @@ function add_manifold_benchmarks()
TB = TangentBundle(s2)

pts_tb = [
ProductRepr(convert(T, [1.0, 0.0, 0.0]), convert(T, [0.0, -1.0, -1.0])),
ProductRepr(convert(T, [0.0, 1.0, 0.0]), convert(T, [2.0, 0.0, 1.0])),
ProductRepr(convert(T, [1.0, 0.0, 0.0]), convert(T, [0.0, 2.0, -1.0])),
ArrayPartition(convert(T, [1.0, 0.0, 0.0]), convert(T, [0.0, -1.0, -1.0])),
ArrayPartition(convert(T, [0.0, 1.0, 0.0]), convert(T, [2.0, 0.0, 1.0])),
ArrayPartition(convert(T, [1.0, 0.0, 0.0]), convert(T, [0.0, 2.0, -1.0])),
]
add_manifold(
TB,
pts_tb,
"Tangent bundle of S² using MVectors, ProductRepr";
"Tangent bundle of S² using MVectors, ArrayPartition";
test_tangent_vector_broadcasting=false,
)
end
Expand Down Expand Up @@ -203,13 +203,11 @@ function add_manifold_benchmarks()
sphere_tv_dist =
Manifolds.normal_tvector_distribution(Ms, (@MVector [1.0, 0.0, 0.0]), 1.0)
power_s1_tv_dist = Manifolds.PowerFVectorDistribution(
TangentBundleFibers(Ms1),
rand(power_s1_pt_dist),
TangentSpace(Ms1, rand(power_s1_pt_dist)),
sphere_tv_dist,
)
power_s2_tv_dist = Manifolds.PowerFVectorDistribution(
TangentBundleFibers(Ms2),
rand(power_s2_pt_dist),
TangentSpace(Ms2, rand(power_s2_pt_dist)),
sphere_tv_dist,
)

Expand All @@ -224,13 +222,11 @@ function add_manifold_benchmarks()
)
rotations_tv_dist = Manifolds.normal_tvector_distribution(Mr, MMatrix(id_rot), 1.0)
power_r1_tv_dist = Manifolds.PowerFVectorDistribution(
TangentBundleFibers(Mr1),
rand(power_r1_pt_dist),
TangentSpace(Mr1, rand(power_r1_pt_dist)),
rotations_tv_dist,
)
power_r2_tv_dist = Manifolds.PowerFVectorDistribution(
TangentBundleFibers(Mr2),
rand(power_r2_pt_dist),
TangentSpace(Mr2, rand(power_r2_pt_dist)),
rotations_tv_dist,
)

Expand Down
1 change: 1 addition & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ makedocs(;
"Unit-norm symmetric matrices" => "manifolds/spheresymmetricmatrices.md",
],
"Combined manifolds" => [
"Fiber bundle" => "manifolds/fiber_bundle.md",
"Graph manifold" => "manifolds/graph.md",
"Power manifold" => "manifolds/power.md",
"Product manifold" => "manifolds/product.md",
Expand Down
1 change: 0 additions & 1 deletion docs/src/features/utilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ The following functions are of interest for extending and using the [`ProductMan
```@docs
submanifold_component
submanifold_components
ProductRepr
```

## Specific exception types
Expand Down
17 changes: 17 additions & 0 deletions docs/src/manifolds/fiber_bundle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# [Fiber bundles](@id FiberBundleSection)

Fiber bundle $E$ is a manifold that is built on top of another manifold $\mathcal M$ (base space).
It is characterized by a continuous function $Π : E → \mathcal M$. For each point $p ∈ \mathcal M$ the preimage of $p$ by $Π$, $Π^{-1}(\{p\})$ is called a fiber $F$.
Bundle projection can be performed using function [`bundle_projection`](@ref).

`Manifolds.jl` primarily deals with the case of trivial bundles, where $E$ can be identified with a product $M \times F$.

[Vector bundles](@ref VectorBundleSection) is a special case of a fiber bundle. Other examples include unit tangent bundle. Note that in general fiber bundles don't have a canonical Riemannian structure but can at least be equipped with an [Ehresmann connection](https://en.wikipedia.org/wiki/Ehresmann_connection), providing notions of parallel transport and curvature.

## Documentation

```@autodocs
Modules = [Manifolds, ManifoldsBase]
Pages = ["manifolds/Fiber.jl", "manifolds/FiberBundle.jl"]
Order = [:constant, :type, :function]
```
13 changes: 11 additions & 2 deletions docs/src/manifolds/group.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,16 +185,17 @@ Order = [:constant, :type, :function]
Group actions represent actions of a given group on a specified manifold.
The following operations are available:

* [`action_side`](@ref): whether action acts from the [`LeftSide`](@ref) or [`RightSide`](@ref) (not to be confused with action direction).
* [`apply`](@ref): performs given action of an element of the group on an object of compatible type.
* [`apply_diff`](@ref): differential of [`apply`](@ref) with respect to the object it acts upon.
* [`direction`](@ref): tells whether a given action is [`LeftForwardAction`](@ref), [`RightForwardAction`](@ref), [`LeftBackwardAction`](@ref) or [`RightBackwardAction`](@ref).
* [`direction`](@ref): tells whether a given action is [`LeftAction`](@ref), [`RightAction`](@ref).
* [`inverse_apply`](@ref): performs given action of the inverse of an element of the group on an object of compatible type. By default inverts the element and calls [`apply`](@ref) but it may be have a faster implementation for some actions.
* [`inverse_apply_diff`](@ref): counterpart of [`apply_diff`](@ref) for [`inverse_apply`](@ref).
* [`optimal_alignment`](@ref): determine the element of a group that, when it acts upon a point, produces the element closest to another given point in the metric of the G-manifold.

Furthermore, group operation action features the following:

* [`translate`](@ref Main.Manifolds.translate): an operation that performs either left ([`LeftForwardAction`](@ref)) or right ([`RightBackwardAction`](@ref)) translation, or actions by inverses of elements ([`RightForwardAction`](@ref) and [`LeftBackwardAction`](@ref)). This is by default performed by calling [`compose`](@ref) with appropriate order of arguments. This function is separated from `compose` mostly to easily represent its differential, [`translate_diff`](@ref).
* [`translate`](@ref Main.Manifolds.translate): an operation that performs either ([`LeftAction`](@ref)) on the [`LeftSide`](@ref) or ([`RightAction`](@ref)) on the [`RightSide`](@ref) translation, or actions by inverses of elements ([`RightAction`](@ref) on the [`LeftSide`](@ref) and [`LeftAction`](@ref) on the [`RightSide`](@ref)). This is by default performed by calling [`compose`](@ref) with appropriate order of arguments. This function is separated from `compose` mostly to easily represent its differential, [`translate_diff`](@ref).
* [`translate_diff`](@ref): differential of [`translate`](@ref Main.Manifolds.translate) with respect to the point being translated.
* [`adjoint_action`](@ref): adjoint action of a given element of a Lie group on an element of its Lie algebra.
* [`lie_bracket`](@ref): Lie bracket of two vectors from a Lie algebra corresponding to a given group.
Expand Down Expand Up @@ -235,6 +236,14 @@ Pages = ["groups/translation_action.jl"]
Order = [:type, :function]
```

### Rotation-translation action (special Euclidean)

```@autodocs
Modules = [Manifolds]
Pages = ["groups/rotation_translation_action.jl"]
Order = [:type, :function]
```

## Metrics on groups

Lie groups by default typically forward all metric-related operations like exponential or logarithmic map to the underlying manifold, for example [`SpecialOrthogonal`](@ref) uses methods for [`Rotations`](@ref) (which is, incidentally, bi-invariant), or [`SpecialEuclidean`](@ref) uses product metric of the translation and rotation parts (which is not invariant under group operation).
Expand Down
4 changes: 2 additions & 2 deletions docs/src/manifolds/power.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ N = 5
GN = PowerManifold(G, NestedReplacingPowerRepresentation(), N)

q = [1.0 0.0; 0.0 1.0]
p1 = [ProductRepr(SVector{2,Float64}([i - 0.1, -i]), SMatrix{2,2,Float64}(exp(R2, q, hat(R2, q, i)))) for i in 1:N]
p2 = [ProductRepr(SVector{2,Float64}([i - 0.1, -i]), SMatrix{2,2,Float64}(exp(R2, q, hat(R2, q, -i)))) for i in 1:N]
p1 = [ArrayPartition(SVector{2,Float64}([i - 0.1, -i]), SMatrix{2,2,Float64}(exp(R2, q, hat(R2, q, i)))) for i in 1:N]
p2 = [ArrayPartition(SVector{2,Float64}([i - 0.1, -i]), SMatrix{2,2,Float64}(exp(R2, q, hat(R2, q, -i)))) for i in 1:N]

X = similar(p1);

Expand Down
2 changes: 1 addition & 1 deletion docs/src/manifolds/product.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# [Product manifold](@id ProductManifoldSection)

Product manifold $\mathcal M = \mathcal{M}_1 × \mathcal{M}_2 × … × \mathcal{M}_n$ of manifolds $\mathcal{M}_1, \mathcal{M}_2, …, \mathcal{M}_n$.
Points on the product manifold can be constructed using [`ProductRepr`](@ref) with canonical projections $Π_i : \mathcal{M} → \mathcal{M}_i$ for $i ∈ 1, 2, …, n$ provided by [`submanifold_component`](@ref).
Points on the product manifold can be constructed using `ArrayPartition` (from `RecursiveArrayTools.jl`) with canonical projections $Π_i : \mathcal{M} → \mathcal{M}_i$ for $i ∈ 1, 2, …, n$ provided by [`submanifold_component`](@ref).

```@autodocs
Modules = [Manifolds]
Expand Down
2 changes: 1 addition & 1 deletion docs/src/manifolds/sphere.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Sphere
```

For the higher-dimensional arrays, for example unit (Frobenius) norm matrices, the manifold is generated using the size of the matrix.
To create the unit sphere of $3×2$ real-valued matrices, write `ArraySphere(3,2)` and the complex case is done – as for the [`Euclidean`](@ref) case – with an keyword argument `ArraySphere(3,2; field = ℂ)`. This case also covers the classical sphere as a special case, but you specify the size of the vectors/embedding instead: The 2-sphere can here be generated `ArraySphere(3)`.
To create the unit sphere of $3×2$ real-valued matrices, write `ArraySphere(3,2)` and the complex case is done – as for the [`Euclidean`](@ref) case – with an keyword argument `ArraySphere(3,2; field=ℂ)`. This case also covers the classical sphere as a special case, but you specify the size of the vectors/embedding instead: The 2-sphere can here be generated `ArraySphere(3)`.

```@docs
ArraySphere
Expand Down
21 changes: 7 additions & 14 deletions docs/src/manifolds/vector_bundle.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
# [Vector bundles](@id VectorBundleSection)

Vector bundle $E$ is a manifold that is built on top of another manifold $\mathcal M$ (base space).
It is characterized by a continuous function $Π : E → \mathcal M$, such that for each point $p ∈ \mathcal M$ the preimage of $p$ by $Π$, $Π^{-1}(\{p\})$, has a structure of a vector space.
These vector spaces are called fibers.
Bundle projection can be performed using function [`bundle_projection`](@ref).
Vector bundle $E$ is a special case of a [fiber bundle](@ref FiberBundleSection) where each fiber is a vector space.

Tangent bundle is a simple example of a vector bundle, where each fiber is the tangent space at the specified point $x$.
Tangent bundle is a simple example of a vector bundle, where each fiber is the tangent space at the specified point $p$.
An object representing a tangent bundle can be obtained using the constructor called `TangentBundle`.

Fibers of a vector bundle are represented by the type `VectorBundleFibers`.
The important difference between functions operating on `VectorBundle` and `VectorBundleFibers` is that in the first case both a point on the underlying manifold and the vector are represented together (by a single argument) while in the second case only the vector part is present, while the point is supplied in a different argument where needed.

`VectorBundleFibers` refers to the whole set of fibers of a vector bundle.
There is also another type, [`VectorSpaceAtPoint`](@ref), that represents a specific fiber at a given point.
This distinction is made to reduce the need to repeatedly construct objects of type [`VectorSpaceAtPoint`](@ref) in certain usage scenarios.
There is also another type, [`VectorSpaceFiber`](@ref), that represents a specific fiber at a given point.
This distinction is made to reduce the need to repeatedly construct objects of type [`VectorSpaceFiber`](@ref) in certain usage scenarios.
This is also considered a manifold.

## FVector
Expand All @@ -25,7 +18,7 @@ It is used for example in musical isomorphisms (the [`flat`](@ref) and [`sharp`]

```@autodocs
Modules = [Manifolds, ManifoldsBase]
Pages = ["manifolds/VectorBundle.jl"]
Pages = ["manifolds/VectorFiber.jl", "manifolds/VectorBundle.jl"]
Order = [:constant, :type, :function]
```

Expand All @@ -37,8 +30,8 @@ The following code defines a point on the tangent bundle of the sphere $S^2$ and
using Manifolds
M = Sphere(2)
TB = TangentBundle(M)
p = ProductRepr([1.0, 0.0, 0.0], [0.0, 1.0, 3.0])
X = ProductRepr([0.0, 1.0, 0.0], [0.0, 0.0, -2.0])
p = ArrayPartition([1.0, 0.0, 0.0], [0.0, 1.0, 3.0])
X = ArrayPartition([0.0, 1.0, 0.0], [0.0, 0.0, -2.0])
```

An approximation of the exponential in the Sasaki metric using 1000 steps can be calculated as follows.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/misc/notation.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Within the documented functions, the utf8 symbols are used whenever possible, as
| ``n`` | dimension (of a manifold) | ``n_1,n_2,\ldots,m, \dim(\mathcal M)``| for the real dimension sometimes also ``\dim_{\mathbb R}(\mathcal M)``|
| ``d(\cdot,\cdot)`` | (Riemannian) distance | ``d_{\mathcal M}(\cdot,\cdot)`` | |
| ``\exp_p X`` | exponential map at ``p \in \mathcal M`` of a vector ``X \in T_p \mathcal M`` | ``\exp_p(X)`` | |
| ``F`` | a fiber | | see [`VectorBundleFibers`](@ref) |
| ``F`` | a fiber | | see [`Fiber`](@ref) |
| ``\mathbb F`` | a field, usually ``\mathbb F \in \{\mathbb R,\mathbb C, \mathbb H\}``, i.e. the real, complex, and quaternion numbers, respectively. | |field a manifold or a basis is based on |
| ``\gamma`` | a geodesic | ``\gamma_{p;q}``, ``\gamma_{p,X}`` | connecting two points ``p,q`` or starting in ``p`` with velocity ``X``. |
| ``\operatorname{grad} f(p)`` | (Riemannian) gradient of function ``f \colon \mathcal{M} \to \mathbb{R}`` at ``p \in \mathcal{M}`` | | |
Expand Down
10 changes: 6 additions & 4 deletions ext/ManifoldsRecipesBaseExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ module ManifoldsRecipesBaseExt

if isdefined(Base, :get_extension)
using Manifolds
using Manifolds: TypeParameter

using Colors: RGBA
using RecipesBase: @recipe, @series
else
# imports need to be relative for Requires.jl-based workflows:
# https://github.com/JuliaArrays/ArrayInterface.jl/pull/387
using ..Manifolds
using ..Manifolds: TypeParameter

using ..RecipesBase: @recipe, @series
using ..Colors: RGBA
Expand All @@ -24,7 +26,7 @@ SURFACE_RESOLUTION_DEFAULT = 32
# Plotting Recipe – Poincaré Ball
#
@recipe function f(
M::Hyperbolic{2},
kellertuer marked this conversation as resolved.
Show resolved Hide resolved
M::Hyperbolic{TypeParameter{Tuple{2}}},
pts::AbstractVector{P},
vecs::Union{AbstractVector{T},Nothing}=nothing;
circle_points=CIRCLE_DEFAULT_PLOT_POINTS,
Expand Down Expand Up @@ -87,7 +89,7 @@ end
# Plotting Recipe – Poincaré Half plane
#
@recipe function f(
M::Hyperbolic{2},
M::Hyperbolic{TypeParameter{Tuple{2}}},
pts::AbstractVector{P},
vecs::Union{AbstractVector{T},Nothing}=nothing;
geodesic_interpolation=-1,
Expand Down Expand Up @@ -133,7 +135,7 @@ end
# Plotting Recipe – Hyperboloid
#
@recipe function f(
M::Hyperbolic{2},
M::Hyperbolic{TypeParameter{Tuple{2}}},
pts::Union{AbstractVector{P},Nothing}=nothing,
vecs::Union{AbstractVector{T},Nothing}=nothing;
geodesic_interpolation=-1,
Expand Down Expand Up @@ -229,7 +231,7 @@ end
# Plotting Recipe – Sphere
#
@recipe function f(
M::Sphere{2,ℝ},
M::Sphere{TypeParameter{Tuple{2}},ℝ},
pts::Union{AbstractVector{P},Nothing}=nothing,
vecs::Union{AbstractVector{T},Nothing}=nothing;
geodesic_interpolation=-1,
Expand Down
Loading
Loading