Skip to content

Commit

Permalink
Add interfaces from QEDprocesses.jl (#68)
Browse files Browse the repository at this point in the history
Co-authored-by: Uwe Hernandez Acosta <[email protected]>
  • Loading branch information
AntonReinhard and szabo137 authored Jun 24, 2024
1 parent 4b22825 commit 42adfb2
Show file tree
Hide file tree
Showing 50 changed files with 1,306 additions and 2,373 deletions.
Empty file removed .formatting/.gitkeep
Empty file.
File renamed without changes.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

[compat]
ArgCheck = "2.3.0"
ConstructionBase = "1.3.0"
DocStringExtensions = "0.8.5, 0.9"
PhysicalConstants = "0.2.1"
SimpleTraits = "0.9.4"
Expand All @@ -25,7 +24,8 @@ julia = "1.6"

[extras]
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["SafeTestsets","Test"]
test = ["SafeTestsets", "Test", "Suppressor"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ To install the locally downloaded package on Windows, change to the parent direc
One can define a static four momentum component wise:

```julia
julia> using QEDbase
julia> using QEDbase; using QEDcore

juila> mass = rand()*10

Expand All @@ -73,7 +73,7 @@ julia> @assert isapprox(getPlus(mom), 0.5*(E+pz))
julia> @assert isapprox(getPerp(mom), px^2 + py^2)
```

and a lot more (see [here](www.docs-to-the-lorentz-interface-getter.jl) for a complete list). There is also a mutable version of a four vector in `QEDbase.jl`, where the Lorentz-vector interface provides setters to different properties as well (see [here](www.docs-to-the-lorentz-interface-setter.jl) for details).
and a lot more (see [here](www.docs-to-the-lorentz-interface-getter.jl) for a complete list). There is also a mutable version of a four vector in `QEDcore.jl`, where the Lorentz-vector interface provides setters to different properties as well (see [here](www.docs-to-the-lorentz-interface-setter.jl) for details).

## Testing

Expand Down
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244"
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
QEDbase = "10e22c08-3ccb-4172-bfcf-7d7aa3d04d93"
QEDcore = "35dc0263-cb5f-4c33-a114-1d7f54ab753e"
3 changes: 3 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ using QEDbase

#DocMeta.setdocmeta!(QEDbase, :DocTestSetup, :(using QEDbase); recursive=true)

# TODO: remove before release
Pkg.add(; url="https://github.com/QEDjl-project/QEDcore.jl", rev="dev")

using DocumenterCitations

bib = CitationBibliography(joinpath(@__DIR__, "Bibliography.bib"))
Expand Down
4 changes: 4 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ CurrentModule = QEDbase
# QEDbase

Documentation for [QEDbase](https://gitlab.hzdr.de/QEDjl/QEDbase.jl). This library provides (more or less) simple implementations of Lorentz vectors, Dirac spinors and Dirac matrices. These are usually used in order to do calculations in particle physics, e.g. they are part of the set of Feynman rules for a given quantum field theory (see [Peskin:1995ev](@cite)).

```@autodocs
Modules = [QEDbase]
```
46 changes: 1 addition & 45 deletions docs/src/library/api.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,3 @@
# QEDbase

```@autodocs
Modules = [QEDbase]
Pages = ["QEDbase.jl"]
Order = [:module]
```

# Lorentz Vector Interface

```@autodocs
Modules = [QEDbase]
Pages = ["lorentz_interface.jl"]
Order = [:type,:function]
```

# Lorentz Vectors

```@autodocs
Modules = [QEDbase]
Pages = ["lorentz_vector.jl"]
Order = [:type,:function]
```

# Four Momentum

```@autodocs
Modules = [QEDbase]
Pages = ["four_momentum.jl"]
Order = [:type,:function]
```

# Dirac Tensors

```@autodocs
Modules = [QEDbase]
Pages = ["dirac_tensors.jl"]
Order = [:type,:function]
```

# Particles

```@autodocs
Modules = [QEDbase]
Pages = ["particles/particle_direction.jl", "particles/particle_spin_pol.jl", "particles/particle_spinors.jl", "particles/particle_states.jl", "particles/particle_types.jl", "interfaces/particle_interface.jl"]
Order = [:type,:function]
```
:warning: Under construction
104 changes: 69 additions & 35 deletions src/QEDbase.jl
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
module QEDbase

using SimpleTraits
using ArgCheck
using ConstructionBase

import Base: *
import StaticArrays: similar_type

export minkowski_dot, mdot, register_LorentzVectorLike
export getT, getX, getY, getZ
export getMagnitude2, getMag2, getMagnitude, getMag
Expand All @@ -28,32 +21,22 @@ export setTransverseMomentum!, setPerp!, setPt!
export setTransverseMass!, setMt!
export setRapidity!

export AbstractLorentzVector, SLorentzVector, MLorentzVector, dot
export AbstractFourMomentum, SFourMomentum, MFourMomentum
export AbstractLorentzVector, dot
export AbstractFourMomentum
export isonshell, assert_onshell

export BiSpinor, AdjointBiSpinor, DiracMatrix, mul
export AbstractDiracVector, AbstractDiracMatrix
export mul

export gamma, GAMMA, AbstractGammaRepresentation, DiracGammaRepresentation, slashed

export BASE_PARTICLE_SPINOR, BASE_ANTIPARTICLE_SPINOR
export IncomingFermionSpinor,
OutgoingFermionSpinor, IncomingAntiFermionSpinor, OutgoingAntiFermionSpinor
export SpinorU, SpinorUbar, SpinorV, SpinorVbar
export @valid_spinor_input
export AbstractGammaRepresentation

# particle interface
export AbstractParticle
export AbstractParticle, AbstractParticleType
export is_fermion, is_boson, is_particle, is_anti_particle
export base_state
export mass, charge
export base_state, propagator

# particle types
export AbstractParticleType
export FermionLike, Fermion, AntiFermion, MajoranaFermion
export BosonLike, Boson, AntiBoson, MajoranaBoson
export Electron, Positron, Photon
# directions
export ParticleDirection, Incoming, Outgoing
export is_incoming, is_outgoing

Expand All @@ -65,22 +48,73 @@ export AbstractDefiniteSpin, AbstractIndefiniteSpin
export SpinUp, SpinDown, AllSpin
export multiplicity

# probabilities
export differential_probability, unsafe_differential_probability
export total_probability

# differential cross section
export differential_cross_section, unsafe_differential_cross_section
export total_cross_section

# Abstract model interface
export AbstractModelDefinition, fundamental_interaction_type

# Abstract process interface
export AbstractProcessDefinition, incoming_particles, outgoing_particles
export number_incoming_particles, number_outgoing_particles
export particles, number_particles

# Abstract setup interface
export AbstractComputationSetup, compute
export AbstractProcessSetup, scattering_process, physical_model

# Abstract phase space definition interface
export AbstractCoordinateSystem, AbstractFrameOfReference, AbstractPhasespaceDefinition

# Abstract phase space point interface
export AbstractParticleStateful, AbstractPhaseSpacePoint
export particle_direction, particle_species, momentum
export process, model, phase_space_definition, momenta
export AbstractInPhaseSpacePoint, AbstractOutPhaseSpacePoint

# errors
export InvalidInputError, RegistryError, OnshellError, SpinorConstructionError

using StaticArrays
using LinearAlgebra
using DocStringExtensions

include("dirac_tensors.jl")
include("lorentz_interface.jl")
include("lorentz_vector.jl")
include("gamma_matrices.jl")
using SimpleTraits
using ArgCheck
using ConstructionBase

include("errors.jl")
include("utils.jl")

include("interfaces/dirac_tensors.jl")
include("interfaces/gamma_matrices.jl")

include("interfaces/lorentz_vectors/types.jl")
include("interfaces/lorentz_vectors/registry.jl")
include("interfaces/lorentz_vectors/arithmetic.jl")
include("interfaces/lorentz_vectors/dirac_interaction.jl")
include("interfaces/lorentz_vectors/fields.jl")
include("interfaces/lorentz_vectors/utility.jl")

include("interfaces/four_momentum.jl")
include("interfaces/model.jl")

include("interfaces/particle.jl")

include("particles/direction.jl")
include("particles/spin_pol.jl")

include("four_momentum.jl") # maybe go to a kinematics module!!
include("interfaces/phase_space.jl")
include("interfaces/process.jl")
include("interfaces/particle_stateful.jl")
include("interfaces/phase_space_point.jl")
include("interfaces/setup.jl")

include("interfaces/particle_interface.jl")
include("particles/particle_types.jl")
include("particles/particle_direction.jl")
include("particles/particle_spin_pol.jl")
include("particles/particle_spinors.jl")
include("particles/particle_states.jl")
include("total_cross_section.jl")

end #QEDbase
Loading

0 comments on commit 42adfb2

Please sign in to comment.