Skip to content

Commit

Permalink
Remove gamma() function
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonReinhard committed Jun 6, 2024
1 parent 398b6f1 commit 52b8069
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/QEDbase.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module QEDbase

import Base: *
import StaticArrays: similar_type

export minkowski_dot, mdot, register_LorentzVectorLike
Expand Down
4 changes: 0 additions & 4 deletions src/interfaces/gamma_matrices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/interfaces/lorentz.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
11 changes: 7 additions & 4 deletions test/interfaces/model.jl
Original file line number Diff line number Diff line change
@@ -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
1 change: 0 additions & 1 deletion test/test_implementation/test_model.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

struct TestModel <: AbstractModelDefinition end
QEDbase.fundamental_interaction_type(::TestModel) = :test_interaction

Expand Down

0 comments on commit 52b8069

Please sign in to comment.