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

Small typos #218

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Changes from all commits
Commits
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
18 changes: 9 additions & 9 deletions tutorials/implement-a-manifold.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ M = ScaledSphere(2,1.5)
While the interface provides a lot of possible functions to define for your manifold, you only need to define those that are necessary for your implementation.
If you are using other packages depending on `ManifoldsBase.jl` you will often just get a “Method not defined” and sometimes an ambiguity error indicating that a function is missing that is required for a certain task.

We can first start with a technical function which internally ist often used. Any of our points or tangent vectors is represented as a $(d+1)$-dimensional vector. This is internally often used when allocating memory, see [`representation_size`](@ref).
We can first start with a technical function which internally is often used. Any of our points or tangent vectors are represented as a $(d+1)$-dimensional vector. This is internally often used when allocating memory, see [`representation_size`](@ref).
It returns a tuple representing the size of arrays for valid points.
We define

Expand Down Expand Up @@ -132,7 +132,7 @@ T_p\mathbb S_r^d :=
```

to verify either `p` or `X` one uses [`is_point`](@ref)`(M,p)`
and [`is_vector`](@ref)`(M, p, X)` respectively. Since both involve some automatic options and possibililities, for example whether to throw an error or just return false, both mention that the actual functions to implement are [`check_point`](@ref) and [`check_vector`](@ref), which both do not throw but _return_ an error if something is wrong.
and [`is_vector`](@ref)`(M, p, X)` respectively. Since both involve some automatic options and possibilities, for example whether to throw an error or just return false, both mention that the actual functions to implement are [`check_point`](@ref) and [`check_vector`](@ref), which both do not throw but _return_ an error if something is wrong.

In principle we would have to check two properties, namely that the size of `p` is of correct size `M.dimension+1` and that its norm is `M.radius`. Luckily, by defining [`representation_size`](@ref) the first check is automatically done already – actually for both points and vectors.
We define
Expand Down Expand Up @@ -172,7 +172,7 @@ function check_vector(M::ScaledSphere, p, X; kwargs...)
end
```

and again, the high level interface can be used to display warning for vectors not fulfilling the criterion, but we can also
and again, the high level interface can be used to display warnings for vectors not fulfilling the criterion, but we can also
activate a check for the point using the last positional argument

```{julia}
Expand All @@ -188,7 +188,7 @@ is_vector(M, [1.5, 0.0, 0.0], [0.0, 1.0, 0.0], true; error=:warn) # returns true
For the final group of functions, we want to implement the [`exp`](@ref)onential map and a [`retract`](@ref)ion. Both are ways to “move around” on the manifold, that is, given a point $p$ and a
tangent vector indicating a “walking direction”, the two functions we define will return a new point $q$ on the manifold.

For functions that compute a new point or tangent vector, `ManifoldsBase.jl` always provides two varinats: One that allocates new memory and one, that allows to provide the memory, the result should be returned in to spare memory allocations.
For functions that compute a new point or tangent vector, `ManifoldsBase.jl` always provides two variants: One that allocates new memory, and one that allows to provide the memory the result should be returned in to spare memory allocations.

Let's first take a look at what the exponential map is defined like. We follow the shortest curves, that is great arcs, on the sphere. Formally we have

Expand All @@ -198,9 +198,9 @@ Let's first take a look at what the exponential map is defined like. We follow t
\sin\Bigl(\frac{1}{r}\lVert X \rVert\Bigr)\frac{X}{\lVert X \rVert}.
````

In fact, from the two functions above, [`exp`](@ref)`(M, p, X)` and [`exp!`](@ref)`(M, q, p, X)`, that works in place of `q`, we only have to implement the second.
The first one, `exp` by default falls back to allocating memory and calling the secnod. Sp `exp` should only be defined, if there is a special reason for.
Furthermore, we usually do not verify/check inputs to spare time. If a user feels insecure, they could for example use the [`ValidationManifold`](@ref) wrapper which adds explicitly checks of inputs and outputs.
In fact, from the two functions above, [`exp`](@ref)`(M, p, X)`, and [`exp!`](@ref)`(M, q, p, X)` that works in place of `q`, we only have to implement the second.
The first one, `exp` by default falls back to allocating memory and calling the second. So `exp` should only be defined, if there is a special reason for.
Furthermore, we usually do not verify/check inputs to spare time. If a user feels insecure, they could for example use the [`ValidationManifold`](@ref) wrapper which adds explicit checks of inputs and outputs.

We define

Expand All @@ -218,7 +218,7 @@ function exp!(M::ScaledSphere, q, p, X)
end
```

and we can directly test our function starting in the north pole and “waling down” to the equator
and we can directly test our function starting in the north pole and “walking down” to the equator

```{julia}
q = exp(M, [0.0, 0.0, 1.5], [0.75π, 0.0, 0.0])
Expand Down Expand Up @@ -292,4 +292,4 @@ This notebook was rendered with the following environment

```{julia}
Pkg.status()
```
```
Loading