Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Uwe Hernandez Acosta committed Jun 19, 2024
1 parent da639a5 commit dc75423
Showing 1 changed file with 20 additions and 34 deletions.
54 changes: 20 additions & 34 deletions test/particles/states.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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

0 comments on commit dc75423

Please sign in to comment.