Skip to content

Introduce ZeroVector - #280

Merged
kellertuer merged 9 commits into
masterfrom
kellertuer/ZeroVector
Jul 8, 2026
Merged

Introduce ZeroVector#280
kellertuer merged 9 commits into
masterfrom
kellertuer/ZeroVector

Conversation

@kellertuer

Copy link
Copy Markdown
Member

Here is a first draft to close #279 .

There are still quite a few TODOs in the zero_vector.jl file – mainly which functions to implement and which not.
For me Riemann_tensor, sectional_curvature and angle do not make much sense, but maybe one could “error more gracefully” there still.

The general modelling here is to do all these on “level 1” of our design scheme – for a few cases one could check whether level 2 makes more sense. A main challenge is probably to avoid ambiguities.

I also refactored the code a bit in places where all variables would fit on one line – since Runic allows for that while JuliaFormatter did not and put every variable on its own line.

Lets discuss also whether further methods are missing – and check whether it breaks something in Manifolds.jl or Manopt.jl.

@kellertuer kellertuer added enhancement New feature or request discussion preview docs Add this label if you want to see a PR-preview of the documentation labels Jul 3, 2026
@kellertuer

Copy link
Copy Markdown
Member Author

Documentation is also still missing, though there it is maybe enough to add the docs of the type to the vector space page.

@kellertuer

Copy link
Copy Markdown
Member Author

That is what I feared. A “straight-forward” plain approach introduces 200+ ambiguities. So we probably need something more clever than this PR.

@mateuszbaran

Copy link
Copy Markdown
Member

I fear properly adding it everywhere would require a very careful and time-consuming ambiguity hunting. I personally think ZeroVector has a fairly narrow utility and I would be fine with it not being supported by most (or even nearly all) of our functions. Solving all of these ambiguities will most likely not be worth the small gain it would give.

@kellertuer

Copy link
Copy Markdown
Member Author

That is why I stopped at that point yesterday. I am not sure which narrow utility you have in mind. Could you then continue here and minimise it again?

@mateuszbaran

Copy link
Copy Markdown
Member

So far there is exactly one example of actual utility, in Manopt.jl 😄 . To me it's more about "let's not make a separate ZeroVector type in case we notice a second example in a different package".

@kellertuer

Copy link
Copy Markdown
Member Author

That is very narrow 😄

But then lets document that carefully that it is clear that the zero vector does not (necessarily, automatically) work in “any tangent vector position”.

@kellertuer

Copy link
Copy Markdown
Member Author

I now added a careful technical note, that the type has to be considered on every manifold separately since it has to be implemented on layer 3, and kept those functions that do not cause ambiguities (+, -, *, allocate, and zero_vector with an optional allocate=true positional third argument).

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (e36b1a0) to head (9cc2a29).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #280   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           34        34           
  Lines         3802      3813   +11     
=========================================
+ Hits          3802      3813   +11     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kellertuer kellertuer added the Ready-for-Review A label for pull requests that are feature-ready label Jul 8, 2026
Comment thread src/vector_spaces.jl Outdated
Comment thread src/vector_spaces.jl Outdated
Co-authored-by: Mateusz Baran <mateuszbaran89@gmail.com>
Comment thread src/vector_spaces.jl Outdated
@mateuszbaran

Copy link
Copy Markdown
Member

OK, everything else looks fine.

@kellertuer

Copy link
Copy Markdown
Member Author

Should this also be a new version?

@mateuszbaran mateuszbaran left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we can tag a new release after merging this.

Comment thread NEWS.md Outdated
kellertuer and others added 2 commits July 8, 2026 17:48
Co-authored-by: Mateusz Baran <mateuszbaran89@gmail.com>
@kellertuer

Copy link
Copy Markdown
Member Author

Great. I set the date in the news and will merge when the tests pass – and register after merge.

@kellertuer
kellertuer merged commit c13b97e into master Jul 8, 2026
16 checks passed
@kellertuer
kellertuer deleted the kellertuer/ZeroVector branch July 8, 2026 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

discussion enhancement New feature or request preview docs Add this label if you want to see a PR-preview of the documentation Ready-for-Review A label for pull requests that are feature-ready

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move ZeroVector from Manopt.jl

2 participants