Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Uwe Hernandez Acosta committed Sep 1, 2024
1 parent 4c54cdb commit ffd060e
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 17 deletions.
1 change: 0 additions & 1 deletion src/lorentz_boost/axis_boost.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# - add convenient constructors: Boost(:rest_frame,::AbstractFourMomentum)
# - add convenient constructors: Boost(::RestFrame,::AbstractFourMomentum)


"""
TBW
"""
Expand Down
6 changes: 3 additions & 3 deletions src/lorentz_boost/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ end
@inline function (trafo::AbstractCoordinateTransformation)(
psp::PSP
) where {PSP<:AbstractPhaseSpacePoint}
in_moms = momenta(psp,Incoming())
out_moms = momenta(psp,Outgoing())
in_moms = momenta(psp, Incoming())
out_moms = momenta(psp, Outgoing())
in_moms_prime = _transform.(trafo, in_moms)
out_moms_prime = _transform.(trafo, out_moms)

proc = process(psp)
mod = model(psp)
ps_def = phase_space_definition(psp)
return PhaseSpacePoint(proc,mod,ps_def,in_moms_prime,out_moms_prime)
return PhaseSpacePoint(proc, mod, ps_def, in_moms_prime, out_moms_prime)
end

#######
Expand Down
36 changes: 23 additions & 13 deletions test/lorentz_transform/lorentz_transform.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ const RNG = MersenneTwister(12345)
const ATOL = 1e-15

const test_mom = rand(RNG, SFourMomentum)
const test_psf = ParticleStateful(Incoming(),rand(RNG,TestImplementation.PARTICLE_SET),test_mom)
const test_psf = ParticleStateful(
Incoming(), rand(RNG, TestImplementation.PARTICLE_SET), test_mom
)
const test_mass_square = test_mom * test_mom

const TESTMODEL = TestImplementation.TestModel()
Expand All @@ -32,7 +34,9 @@ const TESTPSDEF = TestImplementation.TestPhasespaceDef()
test_mom_prime = boost(test_mom)
test_psf_prime = boost(test_psf)
@test isapprox(test_mom_prime * test_mom_prime, test_mass_square)
@test isapprox(momentum(test_psf_prime)* momentum(test_psf_prime), test_mass_square)
@test isapprox(
momentum(test_psf_prime) * momentum(test_psf_prime), test_mass_square
)
end

@testset "inversion" begin
Expand All @@ -44,28 +48,34 @@ const TESTPSDEF = TestImplementation.TestPhasespaceDef()
end

@testset "phase space point" begin

test_param = _rand(RNG, boost_type)
boost = Boost(test_param)
@testset "($N_INCOMING,$N_OUTGOING)" for (N_INCOMING, N_OUTGOING) in Iterators.product(
test_param = _rand(RNG, boost_type)
boost = Boost(test_param)
@testset "($N_INCOMING,$N_OUTGOING)" for (N_INCOMING, N_OUTGOING) in
Iterators.product(
(1, rand(RNG, 2:8)), (1, rand(RNG, 2:8))
)
INCOMING_PARTICLES = Tuple(rand(RNG, TestImplementation.PARTICLE_SET, N_INCOMING))
OUTGOING_PARTICLES = Tuple(rand(RNG, TestImplementation.PARTICLE_SET, N_OUTGOING))
INCOMING_PARTICLES = Tuple(
rand(RNG, TestImplementation.PARTICLE_SET, N_INCOMING)
)
OUTGOING_PARTICLES = Tuple(
rand(RNG, TestImplementation.PARTICLE_SET, N_OUTGOING)
)

TESTPROC = TestImplementation.TestProcess(INCOMING_PARTICLES, OUTGOING_PARTICLES)
TESTPROC = TestImplementation.TestProcess(
INCOMING_PARTICLES, OUTGOING_PARTICLES
)
IN_PS = TestImplementation._rand_momenta(RNG, N_INCOMING)
OUT_PS = TestImplementation._rand_momenta(RNG, N_OUTGOING)
PSP = PhaseSpacePoint(TESTPROC, TESTMODEL, TESTPSDEF, IN_PS, OUT_PS)

PSP_prime = boost(PSP)
@test isapprox(
[getMass2.(momenta(PSP,Incoming()))...],
[getMass2.(momenta(PSP_prime,Incoming()))...]
[getMass2.(momenta(PSP, Incoming()))...],
[getMass2.(momenta(PSP_prime, Incoming()))...],
)
@test isapprox(
[getMass2.(momenta(PSP,Outgoing()))...],
[getMass2.(momenta(PSP_prime,Outgoing()))...]
[getMass2.(momenta(PSP, Outgoing()))...],
[getMass2.(momenta(PSP_prime, Outgoing()))...],
)
end
end
Expand Down

0 comments on commit ffd060e

Please sign in to comment.