Add some todos, add issame and caninteract to module instead of test
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using MetagraphOptimization
|
||||
using QEDbase
|
||||
|
||||
import MetagraphOptimization.caninteract
|
||||
import MetagraphOptimization.issame
|
||||
import MetagraphOptimization.interaction_result
|
||||
import MetagraphOptimization.propagation_result
|
||||
import MetagraphOptimization.direction
|
||||
@@ -25,30 +27,6 @@ testparticleTypesPropagated = [
|
||||
AntiFermionStateful{Incoming},
|
||||
]
|
||||
|
||||
function caninteract(t1::Type{<:QEDParticle}, t2::Type{<:QEDParticle})
|
||||
if (t1 == t2)
|
||||
return false
|
||||
end
|
||||
if (t1 <: PhotonStateful && t2 <: PhotonStateful)
|
||||
return false
|
||||
end
|
||||
|
||||
for (p1, p2) in [(t1, t2), (t2, t1)]
|
||||
if (p1 == FermionStateful{Incoming} && p2 == AntiFermionStateful{Outgoing})
|
||||
return false
|
||||
end
|
||||
if (p1 == FermionStateful{Outgoing} && p2 == AntiFermionStateful{Incoming})
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function issame(t1::Type{<:QEDParticle}, t2::Type{<:QEDParticle})
|
||||
return !caninteract(t1, t2)
|
||||
end
|
||||
|
||||
@testset "Interaction Result" begin
|
||||
for p1 in testparticleTypes, p2 in testparticleTypes
|
||||
if !caninteract(p1, p2)
|
||||
|
Reference in New Issue
Block a user