Skip to content

Commit

Permalink
a bit of fiber bundle cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszbaran committed Oct 22, 2023
1 parent a86aa3f commit d98622a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 25 deletions.
24 changes: 13 additions & 11 deletions src/manifolds/FiberBundle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Vector transport type on [`FiberBundle`](@ref).
# Fields
* `method_point` – vector transport method of the point part
* `method_fiber` – vector transport method of the fiber part.
* `method_horizonal` – vector transport method of the horizontal part (related to manifold M)
* `method_vertical` – vector transport method of the vertical part (related to fibers).
The vector transport is derived as a product manifold-style vector transport.
The considered product manifold is the product between the manifold ``\mathcal M``
Expand All @@ -20,8 +20,8 @@ and the topological vector space isometric to the fiber.
FiberBundleProductVectorTransport(
M::AbstractManifold=DefaultManifold();
vector_transport_method_point::AbstractVectorTransportMethod = default_vector_transport_method(M),
vector_transport_method_fiber::AbstractVectorTransportMethod = default_vector_transport_method(M),
vector_transport_method_horizontal::AbstractVectorTransportMethod = default_vector_transport_method(M),
vector_transport_method_vertical::AbstractVectorTransportMethod = default_vector_transport_method(M),
)
Construct the `FiberBundleProductVectorTransport` using the [`default_vector_transport_method`](@ref),
Expand All @@ -32,21 +32,23 @@ struct FiberBundleProductVectorTransport{
TMP<:AbstractVectorTransportMethod,
TMV<:AbstractVectorTransportMethod,
} <: AbstractVectorTransportMethod
method_point::TMP
method_fiber::TMV
method_horizontal::TMP
method_vertical::TMV
end
function FiberBundleProductVectorTransport(
M::AbstractManifold=ManifoldsBase.DefaultManifold();
vector_transport_method_point::AbstractVectorTransportMethod=default_vector_transport_method(
M::AbstractManifold=ManifoldsBase.DefaultManifold(),
fiber::FiberType=ManifoldsBase.TangentSpaceType();
vector_transport_method_horizontal::AbstractVectorTransportMethod=default_vector_transport_method(
M,
),
vector_transport_method_fiber::AbstractVectorTransportMethod=default_vector_transport_method(
vector_transport_method_vertical::AbstractVectorTransportMethod=fiber_bundle_transport(
M,
fiber,
),
)
return FiberBundleProductVectorTransport(
vector_transport_method_point,
vector_transport_method_fiber,
vector_transport_method_horizontal,
vector_transport_method_vertical,
)
end

Expand Down
29 changes: 15 additions & 14 deletions src/manifolds/VectorBundle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@ Deprecated: an alias for `FiberBundleProductVectorTransport`.
const VectorBundleVectorTransport = FiberBundleProductVectorTransport

"""
fiber_bundle_transport(fiber::FiberType, M::AbstractManifold)
fiber_bundle_transport(M::AbstractManifold, fiber::FiberType)
Determine the vector tranport used for [`exp`](@ref exp(::FiberBundle, ::Any...)) and
Determine the vector transport used for [`exp`](@ref exp(::FiberBundle, ::Any...)) and
[`log`](@ref log(::FiberBundle, ::Any...)) maps on a vector bundle with fiber type
`fiber` and manifold `M`.
"""
fiber_bundle_transport(::VectorSpaceType, ::AbstractManifold) = ParallelTransport()
fiber_bundle_transport(M::AbstractManifold, ::FiberType) =
default_vector_transport_method(M)

"""
VectorBundle{𝔽,TVS,TM,VTV} = = FiberBundle{𝔽,VectorSpaceFiberType{TVS},TM,TVT}
VectorBundle{𝔽,TVS,TM,VTV} = FiberBundle{𝔽,TVS,TM,TVT} where {TVS<:VectorSpaceType}
Alias for [`FiberBundle`](@ref) when fiber type is a `TVS` of type
[`VectorSpaceType`]https://juliamanifolds.github.io/ManifoldsBase.jl/stable/bases/#ManifoldsBase.VectorSpaceType).
Expand Down Expand Up @@ -65,7 +66,7 @@ function CotangentBundle(M::AbstractManifold, vtm::FiberBundleProductVectorTrans
end

function bundle_transport_to!(B::TangentBundle, Y, p, X, q)
return vector_transport_to!(B.manifold, Y, p, X, q, B.vector_transport.method_fiber)
return vector_transport_to!(B.manifold, Y, p, X, q, B.vector_transport.method_vertical)
end

function bundle_transport_tangent_direction!(
Expand Down Expand Up @@ -277,7 +278,7 @@ function retract_product!(B::VectorBundle, q, p, X, t::Number)
xp,
Xp + VXF,
VXM,
B.vector_transport.method_point,
B.vector_transport.method_horizontal,
)
copyto!(B.manifold, xq, xqt)
return q
Expand Down Expand Up @@ -339,8 +340,8 @@ function _vector_transport_direction!(
px, pVx = submanifold_components(M.manifold, p)
VXM, VXF = submanifold_components(M.manifold, X)
dx, dVx = submanifold_components(M.manifold, d)
vector_transport_direction!(M.manifold, VYM, px, VXM, dx, m.method_point),
vector_transport_direction!(M.manifold, VYF, px, VXF, dx, m.method_fiber),
vector_transport_direction!(M.manifold, VYM, px, VXM, dx, m.method_horizontal),
vector_transport_direction!(M.manifold, VYF, px, VXF, dx, m.method_vertical),
return Y
end

Expand Down Expand Up @@ -377,8 +378,8 @@ function vector_transport_to!(
VXM, VXF = submanifold_components(M.manifold, X)
VYM, VYF = submanifold_components(M.manifold, Y)
qx, qVx = submanifold_components(M.manifold, q)
vector_transport_to!(M.manifold, VYM, px, VXM, qx, m.method_point)
bundle_transport_tangent_to!(M, VYF, px, pVx, VXF, qx, m.method_fiber)
vector_transport_to!(M.manifold, VYM, px, VXM, qx, m.method_horizontal)
bundle_transport_tangent_to!(M, VYF, px, pVx, VXF, qx, m.method_vertical)
return Y
end

Expand All @@ -393,8 +394,8 @@ function _vector_transport_direction(
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),
bundle_transport_tangent_direction(M, px, pVx, VXF, dx, m.method_fiber),
vector_transport_direction(M.manifold, px, VXM, dx, m.method_horizontal),
bundle_transport_tangent_direction(M, px, pVx, VXF, dx, m.method_vertical),
)
end

Expand All @@ -409,8 +410,8 @@ function _vector_transport_to(
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),
bundle_transport_tangent_to(M, px, pVx, VXF, qx, m.method_fiber),
vector_transport_to(M.manifold, px, VXM, qx, m.method_horizontal),
bundle_transport_tangent_to(M, px, pVx, VXF, qx, m.method_vertical),
)
end

Expand Down

0 comments on commit d98622a

Please sign in to comment.