This commit is contained in:
Anton Reinhard
2023-09-25 18:49:44 +02:00
parent 0d8d824540
commit c88898a502
8 changed files with 266 additions and 121 deletions

View File

@ -1,3 +1,4 @@
[deps]
QEDbase = "10e22c08-3ccb-4172-bfcf-7d7aa3d04d93"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

View File

@ -2,25 +2,26 @@ import MetagraphOptimization.A
import MetagraphOptimization.B
import MetagraphOptimization.ParticleType
using QEDbase
include("../examples/profiling_utilities.jl")
@testset "Unit Tests Execution" begin
particles = Dict{ParticleType, Vector{Particle}}(
(
A => [
Particle(0.823648, 0.0, 0.0, 0.823648, A),
Particle(0.823648, -0.835061, -0.474802, 0.277915, A),
]
),
(
B => [
Particle(0.823648, 0.0, 0.0, -0.823648, B),
Particle(0.823648, 0.835061, 0.474802, -0.277915, B),
]
),
)
particles = Tuple{Vector{Particle}, Vector{Particle}}((
[
Particle(SFourMomentum(0.823648, 0.0, 0.0, 0.823648), A),
Particle(SFourMomentum(0.823648, 0.0, 0.0, -0.823648), B),
],
[
Particle(
SFourMomentum(0.823648, -0.835061, -0.474802, 0.277915),
A,
),
Particle(SFourMomentum(0.823648, 0.835061, 0.474802, -0.277915), B),
],
))
expected_result = 5.5320567694746876e-5
expected_result = 7.594784103424603e-5
@testset "AB->AB no optimization" begin
for _ in 1:10 # test in a loop because graph layout should not change the result
@ -41,7 +42,7 @@ include("../examples/profiling_utilities.jl")
end
@testset "AB->AB after random walk" begin
for _ in 1:20
for _ in 1:50
graph = parse_abc(joinpath(@__DIR__, "..", "input", "AB->AB.txt"))
random_walk!(graph, 40)