From 745353f9ae68a74cf7067d4c2c5f2250ae0ab160 Mon Sep 17 00:00:00 2001 From: Anton Reinhard Date: Thu, 6 Jun 2024 16:36:49 +0200 Subject: [PATCH] Remove gamma() function --- src/QEDbase.jl | 1 + src/interfaces/gamma_matrices.jl | 4 ---- src/interfaces/lorentz.jl | 2 +- test/interfaces/model.jl | 11 +++++++---- test/test_implementation/test_model.jl | 1 - 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/QEDbase.jl b/src/QEDbase.jl index c12efc0..b5828aa 100644 --- a/src/QEDbase.jl +++ b/src/QEDbase.jl @@ -32,6 +32,7 @@ export AbstractDiracVector, AbstractDiracMatrix export mul export AbstractGammaRepresentation +export gamma # particle interface export AbstractParticle diff --git a/src/interfaces/gamma_matrices.jl b/src/interfaces/gamma_matrices.jl index 1505710..2bdc5e5 100644 --- a/src/interfaces/gamma_matrices.jl +++ b/src/interfaces/gamma_matrices.jl @@ -3,7 +3,3 @@ #### abstract type AbstractGammaRepresentation end - -function gamma(::Type{T})::SLorentzVector where {T<:AbstractGammaRepresentation} - return SLorentzVector(_gamma0(T), _gamma1(T), _gamma2(T), _gamma3(T)) -end diff --git a/src/interfaces/lorentz.jl b/src/interfaces/lorentz.jl index 7456a93..6495621 100644 --- a/src/interfaces/lorentz.jl +++ b/src/interfaces/lorentz.jl @@ -38,7 +38,7 @@ With this done, we can aleady register the `CustomType` as a `LorentzVectorLike` ```julia register_LorentzVectorLike(CustomType) ``` -If something goes wrong, this function call will raise an `RegistryError` indicating, what is missing. With this done, `CustomType` is ready to be used as a LorentzVectorLike +If something goes wrong, this function call will raise an `RegistryError` indicating what is missing. With this done, `CustomType` is ready to be used as a `LorentzVectorLike` ```julia L = CustomType(2.0,1.0,0.0,-1.0) diff --git a/test/interfaces/model.jl b/test/interfaces/model.jl index cdb8887..42ec606 100644 --- a/test/interfaces/model.jl +++ b/test/interfaces/model.jl @@ -1,19 +1,22 @@ using QEDbase -include("../test_implementation/TestImplementation.jl") +struct TestModel <: AbstractModelDefinition end +QEDbase.fundamental_interaction_type(::TestModel) = :test_interaction + +struct TestModel_FAIL <: AbstractModelDefinition end @testset "hard interface" begin - TESTMODEL = TestImplementation.TestModel() + TESTMODEL = TestModel() @test fundamental_interaction_type(TESTMODEL) == :test_interaction end @testset "interface fail" begin - TESTMODEL_FAIL = TestImplementation.TestModel_FAIL() + TESTMODEL_FAIL = TestModel_FAIL() @test_throws MethodError fundamental_interaction_type(TESTMODEL_FAIL) end @testset "broadcast" begin test_func(model) = model - TESTMODEL = TestImplementation.TestModel() + TESTMODEL = TestModel() @test test_func.(TESTMODEL) == TESTMODEL end diff --git a/test/test_implementation/test_model.jl b/test/test_implementation/test_model.jl index 12b961f..87f4f04 100644 --- a/test/test_implementation/test_model.jl +++ b/test/test_implementation/test_model.jl @@ -1,4 +1,3 @@ - struct TestModel <: AbstractModelDefinition end QEDbase.fundamental_interaction_type(::TestModel) = :test_interaction