From dc75423de5e101b87310c92d1d4db19c952c399a Mon Sep 17 00:00:00 2001 From: Uwe Hernandez Acosta Date: Wed, 19 Jun 2024 22:59:17 +0200 Subject: [PATCH] formatting --- test/particles/states.jl | 54 +++++++++++++++------------------------- 1 file changed, 20 insertions(+), 34 deletions(-) diff --git a/test/particles/states.jl b/test/particles/states.jl index 2736148..bf14ce1 100644 --- a/test/particles/states.jl +++ b/test/particles/states.jl @@ -56,12 +56,9 @@ test_broadcast(x::QEDbase.AbstractSpinOrPolarization) = x @test base_state(p(), d(), mom, QEDbase.SpinUp()) == groundtruth_tuple[1] @test base_state(p(), d(), mom, QEDbase.SpinDown()) == groundtruth_tuple[2] - @test QEDbase._as_svec(base_state(p(), d(), mom, QEDbase.AllSpin())) isa - SVector - @test QEDbase._as_svec(base_state(p(), d(), mom, QEDbase.SpinUp())) isa - SVector - @test QEDbase._as_svec(base_state(p(), d(), mom, QEDbase.SpinDown())) isa - SVector + @test QEDbase._as_svec(base_state(p(), d(), mom, QEDbase.AllSpin())) isa SVector + @test QEDbase._as_svec(base_state(p(), d(), mom, QEDbase.SpinUp())) isa SVector + @test QEDbase._as_svec(base_state(p(), d(), mom, QEDbase.SpinDown())) isa SVector @test QEDbase._as_svec(base_state(p(), d(), mom, QEDbase.AllSpin())) == groundtruth_tuple @@ -87,9 +84,7 @@ end #@testset "$x $y $z" for (x,y,z) in Iterators.product(X_arr,Y_arr,Z_arr) mom = SFourMomentum(_cartesian_coordinates(om, om, cth, phi)) - both_photon_states = base_state( - Photon(), D(), mom, QEDbase.AllPolarization() - ) + both_photon_states = base_state(Photon(), D(), mom, QEDbase.AllPolarization()) # property test the photon states @test isapprox((both_photon_states[1] * mom), 0.0, atol=ATOL, rtol=RTOL) @@ -109,33 +104,24 @@ end both_photon_states[1] @test base_state(Photon(), D(), mom, QEDbase.PolarizationY()) == both_photon_states[2] - @test base_state(Photon(), D(), mom, QEDbase.PolX()) == + @test base_state(Photon(), D(), mom, QEDbase.PolX()) == both_photon_states[1] + @test base_state(Photon(), D(), mom, QEDbase.PolY()) == both_photon_states[2] + + @test QEDbase._as_svec(base_state(Photon(), D(), mom, QEDbase.PolX())) isa + SVector + @test QEDbase._as_svec(base_state(Photon(), D(), mom, QEDbase.PolY())) isa + SVector + @test QEDbase._as_svec(base_state(Photon(), D(), mom, QEDbase.AllPol())) isa + SVector + + @test QEDbase._as_svec(base_state(Photon(), D(), mom, QEDbase.PolX()))[1] == + both_photon_states[1] + @test QEDbase._as_svec(base_state(Photon(), D(), mom, QEDbase.PolY()))[1] == + both_photon_states[2] + @test QEDbase._as_svec(base_state(Photon(), D(), mom, QEDbase.AllPol()))[1] == both_photon_states[1] - @test base_state(Photon(), D(), mom, QEDbase.PolY()) == + @test QEDbase._as_svec(base_state(Photon(), D(), mom, QEDbase.AllPol()))[2] == both_photon_states[2] - - @test QEDbase._as_svec( - base_state(Photon(), D(), mom, QEDbase.PolX()) - ) isa SVector - @test QEDbase._as_svec( - base_state(Photon(), D(), mom, QEDbase.PolY()) - ) isa SVector - @test QEDbase._as_svec( - base_state(Photon(), D(), mom, QEDbase.AllPol()) - ) isa SVector - - @test QEDbase._as_svec( - base_state(Photon(), D(), mom, QEDbase.PolX()) - )[1] == both_photon_states[1] - @test QEDbase._as_svec( - base_state(Photon(), D(), mom, QEDbase.PolY()) - )[1] == both_photon_states[2] - @test QEDbase._as_svec( - base_state(Photon(), D(), mom, QEDbase.AllPol()) - )[1] == both_photon_states[1] - @test QEDbase._as_svec( - base_state(Photon(), D(), mom, QEDbase.AllPol()) - )[2] == both_photon_states[2] end end end