Skip to content

Commit

Permalink
Algebra (#15)
Browse files Browse the repository at this point in the history
Add in the interface description the LorentzVectorBase abstract type and option to subtype it in order to benefit from default overriding implementation of +, -, and \cdot.
  • Loading branch information
grasph authored Oct 2, 2024
1 parent 8b2f2d2 commit 89d5f22
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docs/src/10-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,16 @@ The methods that returns the coordinates of the prefered system (returned by `co
| `LorentzVectorBase.spatial_magnitude2(::MyType{MyLorentzVector})` | mass to the square |
| Any of the above method i.e, a method of option Y when methods of option X are provided ||

=======
## LorentzVectorBase

The type can *optionnally* be a subtype of the LorentzVectorBase.LorentzVectorBase to benefit from default implementations of lorentz vector algebra.

# Basic functions provided for subtypes of LorentzVectorBase

- Base.+(::LorentzVectorBase, ::LorentzVectorBase)
- Base.-(::LorentzVectorBase, ::LorentzVectorBase)
- LinearAlgebra.dot(::LorentzVectorBase, ::LorentzVectorBase)¹

---
¹x⋅y = LinearAlgebra.dot(x,y)

0 comments on commit 89d5f22

Please sign in to comment.