Skip to content

Commit

Permalink
Adapt Tutorial to ManifoldsBase 1.0 (#222)
Browse files Browse the repository at this point in the history
* fix tutorial
  • Loading branch information
kellertuer authored Feb 5, 2025
1 parent a3e8f42 commit 0debf3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* `parallel_transport_along(M, p, X, c)`, `vector_transport_along(M, p, X, c, m)` as well as
their mutating variants are removed from the API for now.
It was never specified how to actually specify a curve `c` and the method was only
implemented for `Euclidean` in `Manifolds.jl` anyways.
implemented for `Euclidean` in `Manifolds.jl`, where it is the identity.

## [0.15.24] 17/01/2025

Expand Down
5 changes: 2 additions & 3 deletions tutorials/implement-a-manifold.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,8 @@ Here, we really have to take into account, that the interface is ``[designed wit
While the actual function we would call in the end is `retract(M, p, X, ProjectionRetraction())` (or its `!` variant), we actually have to implement `retract_project!(M, q, p, X, t)` for technical details, that are a bit beyond this introductory tutorial. In short this split avoids ambiguity errors for decorators of the manifolds. We define

```{julia}
import ManifoldsBase: retract_project_fused!
function retract_project_fused!(M::ScaledSphere, q, p, X, t::Number)
q .= (p + t*X) .* (M.radius/norm(p + t*X))
function ManifoldsBase.retract_project!(M::ScaledSphere, q, p, X)
q .= (p + X) .* (M.radius/norm(p + X))
return q
end
```
Expand Down

7 comments on commit 0debf3e

@kellertuer
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register

Release notes:

Changed

  • to avoid logical ambiguities to the forthcoming LieGroups.jl,
    the “fusing” variant exp(M, p, X, t) has been moved to its own name exp_fused(M, p, X, t)
    and similarly exp!(M, q, p, X, t) has been moved to its own name exp_fused!(M, q, p, X, t).
    Note that the new exp_fused! method is not exported and by default falls back to calling exp! with t*X.
    Actions to take
    • if you just implemented an own exp(M, p, X) or exp!(M, q, p, X) everything works as before.
    • if you implemented a fused variant exp!(M, q, p, X, t) you have to adapt two things
      1. move that implementation to ManifoldsBase.exp_fused!(M, q, p, X, t)
      2. Implement the default exp!(M, q, p, X) = ManifoldBase.exp_fused!(M, q, p, one(eltype(p)), X),
        or an own specific implementation for the non-fused variant.
  • Similar to exp, the “fusing” variant retract(M, p, X, t, m) has been moved to
    its own name retract_fused(M, p, X, t, m) and similarly retract!(M, q, p, X, t, m)
    has been moved to its own name retract_fused!(M, q, p, X, t, m).
    Note that the new retract_fused! method is not exported and by default falls back to calling retract! with t*X.
    Actions to take
    • if you just implemented an own retract(M, p, X, m) or retract!(M, q, p, X, m) everything works as before.
    • if you implemented a fused variant retract!(M, q, p, X, t) you have to adapt two things
      1. move that implementation to ManifoldsBase.retract_fused!(M, q, p, X, t, m)
      2. Implement the default retract!(M, q, p, X, m) = ManifoldBase.retract_fused!(M, q, p, one(eltype(p)), X), or an own specific implementation for the non-fused variant.
  • the TVector type has been renamed to AbstractTangentVector
  • the CoTVector type has been renamed to AbstractCotangentVector

Removed

  • parallel_transport_along(M, p, X, c), vector_transport_along(M, p, X, c, m) as well as
    their mutating variants are removed from the API for now.
    It was never specified how to actually specify a curve c and the method was only
    implemented for Euclidean in Manifolds.jl, where it is the identity.

@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/124360

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 v1.0.0 -m "<description of version>" 0debf3e4f1c335efcc62900ce277711b0fbae5cc
git push origin v1.0.0

@kellertuer
Copy link
Member Author

@kellertuer kellertuer commented on 0debf3e Feb 5, 2025

Choose a reason for hiding this comment

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

@JuliaRegistrator register

Release notes:

Changed

We implemented the following breaking changes.

  • to avoid logical ambiguities to the forthcoming LieGroups.jl,
    the “fusing” variant exp(M, p, X, t) has been moved to its own name exp_fused(M, p, X, t)
    and similarly exp!(M, q, p, X, t) has been moved to its own name exp_fused!(M, q, p, X, t).
    Note that the new exp_fused! method is not exported and by default falls back to calling exp! with t*X.
    Actions to take
    • if you just implemented an own exp(M, p, X) or exp!(M, q, p, X) everything works as before.
    • if you implemented a fused variant exp!(M, q, p, X, t) you have to adapt two things
      1. move that implementation to ManifoldsBase.exp_fused!(M, q, p, X, t)
      2. Implement the default exp!(M, q, p, X) = ManifoldBase.exp_fused!(M, q, p, one(eltype(p)), X),
        or an own specific implementation for the non-fused variant.
  • Similar to exp, the “fusing” variant retract(M, p, X, t, m) has been moved to
    its own name retract_fused(M, p, X, t, m) and similarly retract!(M, q, p, X, t, m)
    has been moved to its own name retract_fused!(M, q, p, X, t, m).
    Note that the new retract_fused! method is not exported and by default falls back to calling retract! with t*X.
    Actions to take
    • if you just implemented an own retract(M, p, X, m) or retract!(M, q, p, X, m) everything works as before.
    • if you implemented a fused variant retract!(M, q, p, X, t) you have to adapt two things
      1. move that implementation to ManifoldsBase.retract_fused!(M, q, p, X, t, m)
      2. Implement the default retract!(M, q, p, X, m) = ManifoldBase.retract_fused!(M, q, p, one(eltype(p)), X), or an own specific implementation for the non-fused variant.
  • the TVector type has been renamed to AbstractTangentVector
  • the CoTVector type has been renamed to AbstractCotangentVector

Removed

  • parallel_transport_along(M, p, X, c), vector_transport_along(M, p, X, c, m) as well as
    their mutating variants are removed from the API for now.
    It was never specified how to actually specify a curve c and the method was only
    implemented for Euclidean in Manifolds.jl, where it is the identity.

@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 updated: JuliaRegistries/General/124360

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 v1.0.0 -m "<description of version>" 0debf3e4f1c335efcc62900ce277711b0fbae5cc
git push origin v1.0.0

@kellertuer
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register

Release notes:

Changed

We implemented the following breaking changes.

  • to avoid logical ambiguities to the forthcoming LieGroups.jl,
    the “fusing” variant exp(M, p, X, t) has been moved to its own name exp_fused(M, p, X, t)
    and similarly exp!(M, q, p, X, t) has been moved to its own name exp_fused!(M, q, p, X, t).
    Note that the new exp_fused! method is not exported and by default falls back to calling exp! with t*X.
    Actions to take
    • if you just implemented an own exp(M, p, X) or exp!(M, q, p, X) everything works as before.
    • if you implemented a fused variant exp!(M, q, p, X, t) you have to adapt two things
      1. move that implementation to ManifoldsBase.exp_fused!(M, q, p, X, t)
      2. Implement the default exp!(M, q, p, X) = ManifoldBase.exp_fused!(M, q, p, one(eltype(p)), X),
        or an own specific implementation for the non-fused variant.
  • Similar to exp, the “fusing” variant retract(M, p, X, t, m) has been moved to
    its own name retract_fused(M, p, X, t, m) and similarly retract!(M, q, p, X, t, m)
    has been moved to its own name retract_fused!(M, q, p, X, t, m).
    Note that the new retract_fused! method is not exported and by default falls back to calling retract! with t*X.
    Actions to take
    • if you just implemented an own retract(M, p, X, m) or retract!(M, q, p, X, m) everything works as before.
    • if you implemented a fused variant retract!(M, q, p, X, t) you have to adapt two things
      1. move that implementation to ManifoldsBase.retract_fused!(M, q, p, X, t, m)
      2. Implement the default retract!(M, q, p, X, m) = ManifoldBase.retract_fused!(M, q, p, one(eltype(p)), X), or an own specific implementation for the non-fused variant.
  • the TVector type has been renamed to AbstractTangentVector
  • the CoTVector type has been renamed to AbstractCotangentVector

Removed

  • parallel_transport_along(M, p, X, c), vector_transport_along(M, p, X, c, m) as well as
    their mutating variants are removed from the API for now.
    It was never specified how to actually specify a curve c and the method was only
    implemented for Euclidean in Manifolds.jl, where it is the identity.

@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 updated: JuliaRegistries/General/124360

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 v1.0.0 -m "<description of version>" 0debf3e4f1c335efcc62900ce277711b0fbae5cc
git push origin v1.0.0

@kellertuer
Copy link
Member Author

Choose a reason for hiding this comment

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

(the first one did not contain any of the necessary magic words, the second contained a typo. – We'll see how many of these we need then)

Please sign in to comment.