Skip to content

Commit adf7189

Browse files
authored
rename of package (#7)
1 parent 1bccbcd commit adf7189

File tree

7 files changed

+92
-92
lines changed

7 files changed

+92
-92
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# FourMomentumBase.jl
1+
# LorentzVectorBase.jl
22
[WIP] Base interfaces for four-momenta in high-energy physics.
33

4-
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://szabo137.github.io/FourMomentumBase.jl/stable/)
5-
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://szabo137.github.io/FourMomentumBase.jl/dev/)
6-
[![Build Status](https://github.com/szabo137/FourMomentumBase.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/szabo137/FourMomentumBase.jl/actions/workflows/CI.yml?query=branch%3Amain)
4+
[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://szabo137.github.io/LorentzVectorBase.jl/stable/)
5+
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://szabo137.github.io/LorentzVectorBase.jl/dev/)
6+
[![Build Status](https://github.com/szabo137/LorentzVectorBase.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/szabo137/LorentzVectorBase.jl/actions/workflows/CI.yml?query=branch%3Amain)

docs/Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3-
FourMomentumBase = "592a752d-6533-4762-a71b-738712ea30ec"
3+
LorentzVectorBase = "592a752d-6533-4762-a71b-738712ea30ec"

docs/make.jl

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
using FourMomentumBase
1+
using LorentzVectorBase
22
using Documenter
33

44
DocMeta.setdocmeta!(
5-
FourMomentumBase, :DocTestSetup, :(using FourMomentumBase); recursive=true
5+
LorentzVectorBase, :DocTestSetup, :(using LorentzVectorBase); recursive=true
66
)
77

88
makedocs(;
9-
modules=[FourMomentumBase],
9+
modules=[LorentzVectorBase],
1010
authors="Uwe Hernandez Acosta <[email protected]",
11-
sitename="FourMomentumBase.jl",
11+
sitename="LorentzVectorBase.jl",
1212
format=Documenter.HTML(;
13-
canonical="https://szabo137.github.io/FourMomentumBase.jl",
13+
canonical="https://szabo137.github.io/LorentzVectorBase.jl",
1414
edit_link="main",
1515
assets=String[],
1616
),
1717
pages=["Home" => "index.md"],
1818
)
1919

20-
deploydocs(; repo="github.com/szabo137/FourMomentumBase.jl", devbranch="main")
20+
deploydocs(; repo="github.com/szabo137/LorentzVectorBase.jl", devbranch="main")

docs/src/index.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
```@meta
2-
CurrentModule = FourMomentumBase
2+
CurrentModule = LorentzVectorBase
33
```
44

5-
# FourMomentumBase
5+
# LorentzVectorBase
66

7-
Documentation for [FourMomentumBase](https://github.com/szabo137/FourMomentumBase.jl).
7+
Documentation for [LorentzVectorBase](https://github.com/szabo137/LorentzVectorBase.jl).
88

99
```@index
1010
```
1111

1212
```@autodocs
13-
Modules = [FourMomentumBase]
13+
Modules = [LorentzVectorBase]
1414
```

test/interface.jl

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
using FourMomentumBase
1+
using LorentzVectorBase
22

3-
struct TestCoordinteSystem <: FourMomentumBase.AbstractCoordinateSystem end
4-
FourMomentumBase.coordinate_names(::TestCoordinteSystem) = (:a, :b, :c, :d)
3+
struct TestCoordinteSystem <: LorentzVectorBase.AbstractCoordinateSystem end
4+
LorentzVectorBase.coordinate_names(::TestCoordinteSystem) = (:a, :b, :c, :d)
55

6-
for (fun_idx, fun) in enumerate(FourMomentumBase.FOURMOMENTUM_GETTER_FUNCTIONS)
6+
for (fun_idx, fun) in enumerate(LorentzVectorBase.FOURMOMENTUM_GETTER_FUNCTIONS)
77
eval(
88
quote
9-
($FourMomentumBase.$fun)(::$TestCoordinteSystem, mom) = $fun_idx
9+
($LorentzVectorBase.$fun)(::$TestCoordinteSystem, mom) = $fun_idx
1010
end,
1111
)
1212
end
1313

1414
struct TestMomentum end
1515

16-
FourMomentumBase.coordinate_system(::TestMomentum) = TestCoordinteSystem()
16+
LorentzVectorBase.coordinate_system(::TestMomentum) = TestCoordinteSystem()
1717

1818
@testset "Accessor functions" begin
1919
mom = TestMomentum()
2020
@testset "$fun" for (i, fun) in
21-
enumerate(FourMomentumBase.FOURMOMENTUM_GETTER_FUNCTIONS)
21+
enumerate(LorentzVectorBase.FOURMOMENTUM_GETTER_FUNCTIONS)
2222
@test eval(
2323
quote
24-
$FourMomentumBase.$fun
24+
$LorentzVectorBase.$fun
2525
end,
2626
)(mom) == i
2727
end
@@ -30,15 +30,15 @@ end
3030
@testset "Aliasses" begin
3131
mom = TestMomentum()
3232
@testset "$alias, $fun" for (alias, fun) in
33-
FourMomentumBase.FOURMOMENTUM_GETTER_ALIASSES
33+
LorentzVectorBase.FOURMOMENTUM_GETTER_ALIASSES
3434
alias_result = eval(
3535
quote
36-
$FourMomentumBase.$alias
36+
$LorentzVectorBase.$alias
3737
end,
3838
)(mom)
3939
groundtruth = eval(
4040
quote
41-
$FourMomentumBase.$fun
41+
$LorentzVectorBase.$fun
4242
end,
4343
)(mom)
4444
@test alias_result == groundtruth

test/runtests.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using FourMomentumBase
1+
using LorentzVectorBase
22
using Test
33
using SafeTestsets
44

test/xyze.jl

+65-65
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
using Random
3-
using FourMomentumBase
3+
using LorentzVectorBase
44

55
const ATOL = 1e-15
66
const RNG = MersenneTwister(137137)
@@ -12,11 +12,11 @@ struct CustomMom
1212
z
1313
end
1414

15-
FourMomentumBase.coordinate_system(::CustomMom) = FourMomentumBase.EXYZ()
16-
FourMomentumBase.px(mom::CustomMom) = mom.x
17-
FourMomentumBase.py(mom::CustomMom) = mom.y
18-
FourMomentumBase.pz(mom::CustomMom) = mom.z
19-
FourMomentumBase.energy(mom::CustomMom) = mom.e
15+
LorentzVectorBase.coordinate_system(::CustomMom) = LorentzVectorBase.EXYZ()
16+
LorentzVectorBase.px(mom::CustomMom) = mom.x
17+
LorentzVectorBase.py(mom::CustomMom) = mom.y
18+
LorentzVectorBase.pz(mom::CustomMom) = mom.z
19+
LorentzVectorBase.energy(mom::CustomMom) = mom.e
2020

2121
x, y, z = rand(RNG, 3)
2222
m = rand(RNG)
@@ -26,114 +26,114 @@ mom_zero = CustomMom(0.0, 0.0, 0.0, 0.0)
2626
mom_offshell = CustomMom(0.0, 0.0, 0.0, m)
2727

2828
@testset "spatial_magnitude consistence" for mom in [mom_onshell, mom_offshell, mom_zero]
29-
@test FourMomentumBase.spatial_magnitude2(mom) == FourMomentumBase.mag2(mom)
30-
@test FourMomentumBase.spatial_magnitude(mom) == FourMomentumBase.mag(mom)
31-
@test isapprox(FourMomentumBase.spatial_magnitude(mom), sqrt(FourMomentumBase.spatial_magnitude2(mom)))
29+
@test LorentzVectorBase.spatial_magnitude2(mom) == LorentzVectorBase.mag2(mom)
30+
@test LorentzVectorBase.spatial_magnitude(mom) == LorentzVectorBase.mag(mom)
31+
@test isapprox(LorentzVectorBase.spatial_magnitude(mom), sqrt(LorentzVectorBase.spatial_magnitude2(mom)))
3232
end
3333

3434
@testset "spatial_magnitude values" begin
35-
@test isapprox(FourMomentumBase.spatial_magnitude2(mom_onshell), x^2 + y^2 + z^2)
36-
@test isapprox(FourMomentumBase.spatial_magnitude(mom_onshell), sqrt(x^2 + y^2 + z^2))
35+
@test isapprox(LorentzVectorBase.spatial_magnitude2(mom_onshell), x^2 + y^2 + z^2)
36+
@test isapprox(LorentzVectorBase.spatial_magnitude(mom_onshell), sqrt(x^2 + y^2 + z^2))
3737
end
3838

3939
@testset "mass consistence" for mom_on in [mom_onshell, mom_zero]
40-
@test FourMomentumBase.invariant_mass2(mom_on) == FourMomentumBase.mass2(mom_on)
41-
@test FourMomentumBase.invariant_mass(mom_on) == FourMomentumBase.mass(mom_on)
40+
@test LorentzVectorBase.invariant_mass2(mom_on) == LorentzVectorBase.mass2(mom_on)
41+
@test LorentzVectorBase.invariant_mass(mom_on) == LorentzVectorBase.mass(mom_on)
4242
@test isapprox(
43-
FourMomentumBase.invariant_mass(mom_on),
44-
sqrt(FourMomentumBase.invariant_mass2(mom_on)),
43+
LorentzVectorBase.invariant_mass(mom_on),
44+
sqrt(LorentzVectorBase.invariant_mass2(mom_on)),
4545
)
4646
end
4747

4848
@testset "mass value" begin
49-
@test isapprox(FourMomentumBase.invariant_mass2(mom_onshell), E^2 - (x^2 + y^2 + z^2))
49+
@test isapprox(LorentzVectorBase.invariant_mass2(mom_onshell), E^2 - (x^2 + y^2 + z^2))
5050
@test isapprox(
51-
FourMomentumBase.invariant_mass(mom_onshell), sqrt(E^2 - (x^2 + y^2 + z^2))
51+
LorentzVectorBase.invariant_mass(mom_onshell), sqrt(E^2 - (x^2 + y^2 + z^2))
5252
)
5353

54-
@test isapprox(FourMomentumBase.invariant_mass(mom_onshell), m)
55-
@test isapprox(FourMomentumBase.invariant_mass(mom_offshell), -m)
56-
@test isapprox(FourMomentumBase.invariant_mass(mom_zero), 0.0)
54+
@test isapprox(LorentzVectorBase.invariant_mass(mom_onshell), m)
55+
@test isapprox(LorentzVectorBase.invariant_mass(mom_offshell), -m)
56+
@test isapprox(LorentzVectorBase.invariant_mass(mom_zero), 0.0)
5757
end
5858

5959
@testset "momentum components" begin
60-
@test FourMomentumBase.energy(mom_onshell) == E
61-
@test FourMomentumBase.px(mom_onshell) == x
62-
@test FourMomentumBase.py(mom_onshell) == y
63-
@test FourMomentumBase.pz(mom_onshell) == z
60+
@test LorentzVectorBase.energy(mom_onshell) == E
61+
@test LorentzVectorBase.px(mom_onshell) == x
62+
@test LorentzVectorBase.py(mom_onshell) == y
63+
@test LorentzVectorBase.pz(mom_onshell) == z
6464

65-
@test isapprox(FourMomentumBase.boost_beta(mom_onshell), sqrt(x^2 + y^2 + z^2) / E)
65+
@test isapprox(LorentzVectorBase.boost_beta(mom_onshell), sqrt(x^2 + y^2 + z^2) / E)
6666
@test isapprox(
67-
FourMomentumBase.boost_gamma(mom_onshell),
68-
1 / sqrt(1.0 - FourMomentumBase.boost_beta(mom_onshell)^2),
67+
LorentzVectorBase.boost_gamma(mom_onshell),
68+
1 / sqrt(1.0 - LorentzVectorBase.boost_beta(mom_onshell)^2),
6969
)
7070

71-
@test FourMomentumBase.energy(mom_zero) == 0.0
72-
@test FourMomentumBase.px(mom_zero) == 0.0
73-
@test FourMomentumBase.py(mom_zero) == 0.0
74-
@test FourMomentumBase.pz(mom_zero) == 0.0
71+
@test LorentzVectorBase.energy(mom_zero) == 0.0
72+
@test LorentzVectorBase.px(mom_zero) == 0.0
73+
@test LorentzVectorBase.py(mom_zero) == 0.0
74+
@test LorentzVectorBase.pz(mom_zero) == 0.0
7575

76-
@test isapprox(FourMomentumBase.boost_beta(mom_zero), 0.0)
77-
@test isapprox(FourMomentumBase.boost_gamma(mom_zero), 1.0)
76+
@test isapprox(LorentzVectorBase.boost_beta(mom_zero), 0.0)
77+
@test isapprox(LorentzVectorBase.boost_gamma(mom_zero), 1.0)
7878
end
7979

8080
@testset "transverse coordinates" for mom_on in [mom_onshell, mom_zero]
81-
@test FourMomentumBase.transverse_momentum2(mom_on) == FourMomentumBase.pt2(mom_on)
82-
@test FourMomentumBase.transverse_momentum2(mom_on) == FourMomentumBase.perp2(mom_on)
83-
@test FourMomentumBase.transverse_momentum(mom_on) == FourMomentumBase.pt(mom_on)
84-
@test FourMomentumBase.transverse_momentum(mom_on) == FourMomentumBase.perp(mom_on)
81+
@test LorentzVectorBase.transverse_momentum2(mom_on) == LorentzVectorBase.pt2(mom_on)
82+
@test LorentzVectorBase.transverse_momentum2(mom_on) == LorentzVectorBase.perp2(mom_on)
83+
@test LorentzVectorBase.transverse_momentum(mom_on) == LorentzVectorBase.pt(mom_on)
84+
@test LorentzVectorBase.transverse_momentum(mom_on) == LorentzVectorBase.perp(mom_on)
8585

8686
@test isapprox(
87-
FourMomentumBase.transverse_momentum(mom_on),
88-
sqrt(FourMomentumBase.transverse_momentum2(mom_on)),
87+
LorentzVectorBase.transverse_momentum(mom_on),
88+
sqrt(LorentzVectorBase.transverse_momentum2(mom_on)),
8989
)
9090

91-
@test FourMomentumBase.transverse_mass2(mom_on) == FourMomentumBase.mt2(mom_on)
92-
@test FourMomentumBase.transverse_mass(mom_on) == FourMomentumBase.mt(mom_on)
91+
@test LorentzVectorBase.transverse_mass2(mom_on) == LorentzVectorBase.mt2(mom_on)
92+
@test LorentzVectorBase.transverse_mass(mom_on) == LorentzVectorBase.mt(mom_on)
9393
end
9494

9595
@testset "transverse coordiantes value" begin
96-
@test isapprox(FourMomentumBase.transverse_momentum2(mom_onshell), x^2 + y^2)
97-
@test isapprox(FourMomentumBase.transverse_momentum(mom_onshell), sqrt(x^2 + y^2))
98-
@test isapprox(FourMomentumBase.transverse_mass2(mom_onshell), E^2 - z^2)
99-
@test isapprox(FourMomentumBase.transverse_mass(mom_onshell), sqrt(E^2 - z^2))
100-
@test isapprox(FourMomentumBase.transverse_mass(mom_offshell), -m)
101-
102-
@test isapprox(FourMomentumBase.rapidity(mom_onshell), 0.5 * log((E + z) / (E - z)))
103-
104-
@test isapprox(FourMomentumBase.transverse_momentum2(mom_zero), 0.0)
105-
@test isapprox(FourMomentumBase.transverse_momentum(mom_zero), 0.0)
106-
@test isapprox(FourMomentumBase.transverse_mass2(mom_zero), 0.0)
107-
@test isapprox(FourMomentumBase.transverse_mass(mom_zero), 0.0)
96+
@test isapprox(LorentzVectorBase.transverse_momentum2(mom_onshell), x^2 + y^2)
97+
@test isapprox(LorentzVectorBase.transverse_momentum(mom_onshell), sqrt(x^2 + y^2))
98+
@test isapprox(LorentzVectorBase.transverse_mass2(mom_onshell), E^2 - z^2)
99+
@test isapprox(LorentzVectorBase.transverse_mass(mom_onshell), sqrt(E^2 - z^2))
100+
@test isapprox(LorentzVectorBase.transverse_mass(mom_offshell), -m)
101+
102+
@test isapprox(LorentzVectorBase.rapidity(mom_onshell), 0.5 * log((E + z) / (E - z)))
103+
104+
@test isapprox(LorentzVectorBase.transverse_momentum2(mom_zero), 0.0)
105+
@test isapprox(LorentzVectorBase.transverse_momentum(mom_zero), 0.0)
106+
@test isapprox(LorentzVectorBase.transverse_mass2(mom_zero), 0.0)
107+
@test isapprox(LorentzVectorBase.transverse_mass(mom_zero), 0.0)
108108
end
109109

110110
@testset "spherical coordiantes consistence" for mom_on in [mom_onshell, mom_zero]
111111
@test isapprox(
112-
FourMomentumBase.cos_theta(mom_on), cos(FourMomentumBase.polar_angle(mom_on))
112+
LorentzVectorBase.cos_theta(mom_on), cos(LorentzVectorBase.polar_angle(mom_on))
113113
)
114114
@test isapprox(
115-
FourMomentumBase.cos_phi(mom_on), cos(FourMomentumBase.azimuthal_angle(mom_on))
115+
LorentzVectorBase.cos_phi(mom_on), cos(LorentzVectorBase.azimuthal_angle(mom_on))
116116
)
117117
@test isapprox(
118-
FourMomentumBase.sin_phi(mom_on), sin(FourMomentumBase.azimuthal_angle(mom_on))
118+
LorentzVectorBase.sin_phi(mom_on), sin(LorentzVectorBase.azimuthal_angle(mom_on))
119119
)
120120
end
121121

122122
@testset "spherical coordiantes values" begin
123123
@test isapprox(
124-
FourMomentumBase.polar_angle(mom_onshell),
125-
atan(FourMomentumBase.transverse_momentum(mom_onshell), z),
124+
LorentzVectorBase.polar_angle(mom_onshell),
125+
atan(LorentzVectorBase.transverse_momentum(mom_onshell), z),
126126
)
127-
@test isapprox(FourMomentumBase.polar_angle(mom_zero), 0.0)
127+
@test isapprox(LorentzVectorBase.polar_angle(mom_zero), 0.0)
128128

129-
@test isapprox(FourMomentumBase.azimuthal_angle(mom_onshell), atan(y, x))
130-
@test isapprox(FourMomentumBase.azimuthal_angle(mom_zero), 0.0)
129+
@test isapprox(LorentzVectorBase.azimuthal_angle(mom_onshell), atan(y, x))
130+
@test isapprox(LorentzVectorBase.azimuthal_angle(mom_zero), 0.0)
131131
end
132132

133133
@testset "light-cone coordiantes" begin
134-
@test isapprox(FourMomentumBase.plus_component(mom_onshell), 0.5 * (E + z))
135-
@test isapprox(FourMomentumBase.minus_component(mom_onshell), 0.5 * (E - z))
134+
@test isapprox(LorentzVectorBase.plus_component(mom_onshell), 0.5 * (E + z))
135+
@test isapprox(LorentzVectorBase.minus_component(mom_onshell), 0.5 * (E - z))
136136

137-
@test isapprox(FourMomentumBase.plus_component(mom_zero), 0.0)
138-
@test isapprox(FourMomentumBase.minus_component(mom_zero), 0.0)
137+
@test isapprox(LorentzVectorBase.plus_component(mom_zero), 0.0)
138+
@test isapprox(LorentzVectorBase.minus_component(mom_zero), 0.0)
139139
end

0 commit comments

Comments
 (0)