diff --git a/src/QEDcore.jl b/src/QEDcore.jl index 782b285..8ae8ee4 100644 --- a/src/QEDcore.jl +++ b/src/QEDcore.jl @@ -40,7 +40,7 @@ include("algebraic_objects/four_momentum.jl") include("algebraic_objects/lorentz_vector.jl") include("algebraic_objects/gamma_matrices.jl") -include("particles/spinors.jl") include("particles/particle_types.jl") +include("particles/spinors.jl") end diff --git a/src/particles/spinors.jl b/src/particles/spinors.jl index d366807..93124e7 100644 --- a/src/particles/spinors.jl +++ b/src/particles/spinors.jl @@ -43,7 +43,7 @@ function _build_particle_booster( return (slashed(mom) + mass * one(DiracMatrix)) / (sqrt(abs(mom.t) + mass)) end -struct IncomingFermionSpinor <: QEDbase.AbstractParticleSpinor +struct IncomingFermionSpinor <: AbstractParticleSpinor booster::DiracMatrix end @@ -59,7 +59,7 @@ end const SpinorU = IncomingFermionSpinor -struct OutgoingFermionSpinor <: QEDbase.AbstractParticleSpinor +struct OutgoingFermionSpinor <: AbstractParticleSpinor booster::DiracMatrix end @@ -86,7 +86,7 @@ function _build_antiparticle_booster( return (mass * one(DiracMatrix) - slashed(mom)) / (sqrt(abs(mom.t) + mass)) end -struct OutgoingAntiFermionSpinor <: QEDbase.AbstractParticleSpinor +struct OutgoingAntiFermionSpinor <: AbstractParticleSpinor booster::DiracMatrix end @@ -102,7 +102,7 @@ end const SpinorV = OutgoingAntiFermionSpinor -struct IncomingAntiFermionSpinor <: QEDbase.AbstractParticleSpinor +struct IncomingAntiFermionSpinor <: AbstractParticleSpinor booster::DiracMatrix end @@ -118,7 +118,6 @@ end const SpinorVbar = IncomingAntiFermionSpinor -# TODO: reenable when it's no longer in QEDbase -# function getindex(SP::T, idx) where {T<:QEDbase.AbstractParticleSpinor} -# return idx in (1, 2) ? SP(idx) : throw(BoundsError()) -# end +function getindex(SP::T, idx) where {T<:AbstractParticleSpinor} + return idx in (1, 2) ? SP(idx) : throw(BoundsError()) +end diff --git a/test/particles/types.jl b/test/particles/types.jl index 4766170..816a167 100644 --- a/test/particles/types.jl +++ b/test/particles/types.jl @@ -1,4 +1,5 @@ using QEDbase +using QEDcore using StaticArrays using Random