Lorentz Vector
Interface registry
QEDbase.register_LorentzVectorLike — Function
register_LorentzVectorLike(T)
Function to register a custom type as a LorentzVectorLike.
Ensure the passed custom type has implemented at least the function getT, getX, getY, getZ and enables getter functions of the lorentz vector library for the given type. If additionally the functions setT!, setX!, setY!, setZ! are implemened for the passed custom type, also the setter functions of the Lorentz vector interface are enabled.
Built-in Lorentz vector types
QEDbase.AbstractLorentzVector — Type
abstract type AbstractLorentzVector{T} <: StaticArraysCore.FieldVector{4, T}Abstract type to model generic Lorentz vectors, i.e. elements of a minkowski-like space, where the component space is arbitray.
QEDbase.AbstractFourMomentum — Type
AbstractFourMomentum{T_ELEM} where {T_ELEM<:Real}Abstract base type for four-momentas, representing one energy and three spacial components.
Also see: QEDcore.SFourMomentum
Accessor functions
QEDbase.minkowski_dot — Function
minkowski_dot(v1,v2)Return the Minkowski dot product of two LorentzVectorLike.
QEDbase.mdot — Function
Function alias for minkowski_dot.
QEDbase.getT — Function
getT(lv)Return the 0-component of a given LorentzVectorLike.
QEDbase.getX — Function
getX(lv)Return the 1-component of a given LorentzVectorLike.
QEDbase.getY — Function
getY(lv)Return the 2-component of a given LorentzVectorLike.
QEDbase.getZ — Function
getZ(lv)Return the 3-component of a given LorentzVectorLike.
QEDbase.getMagnitude2 — Function
getMagnitude2(lv)Return the square of the magnitude of a given LorentzVectorLike, i.e. the sum of the squared spatial components.
QEDbase.getMag2 — Function
Functiom alias for getMagnitude2.
QEDbase.getMagnitude — Function
getMagnitude(lv)Return the magnitude of a given LorentzVectorLike, i.e. the euklidian norm spatial components.
QEDbase.getMag — Function
Functiom alias for getMagnitude.
QEDbase.getInvariantMass2 — Function
getInvariantMass2(lv)Return the squared invariant mass of a given LorentzVectorLike, i.e. the minkowski dot with itself.
QEDbase.getMass2 — Function
Function alias for getInvariantMass2
QEDbase.getInvariantMass — Function
getInvariantMass(lv)Return the the invariant mass of a given LorentzVectorLike, i.e. the square root of the minkowski dot with itself.
QEDbase.getMass — Function
Function alias for getInvariantMass.
QEDbase.getE — Function
getE(lv)Return the energy component of a given LorentzVectorLike, i.e. its 0-component.
QEDbase.getEnergy — Function
Function alias for getE.
QEDbase.getPx — Function
getPx(lv)Return the $p_x$ component of a given LorentzVectorLike, i.e. its 1-component.
QEDbase.getPy — Function
getPy(lv)Return the $p_y$ component of a given LorentzVectorLike, i.e. its 2-component.
QEDbase.getPz — Function
getPz(lv)Return the $p_z$ component of a given LorentzVectorLike, i.e. its 3-component.
QEDbase.getBeta — Function
getBeta(lv)Return magnitude of the beta vector for a given LorentzVectorLike, i.e. the magnitude of the LorentzVectorLike divided by its 0-component.
QEDbase.getGamma — Function
getGamma(lv)Return the relativistic gamma factor for a given LorentzVectorLike, i.e. the inverse square root of one minus the beta vector squared.
QEDbase.getTransverseMomentum2 — Function
getTransverseMomentum2(lv)Return the squared transverse momentum for a given LorentzVectorLike, i.e. the sum of its squared 1- and 2-component.
QEDbase.getPt2 — Function
Function alias for getTransverseMomentum2.
QEDbase.getPerp2 — Function
Function alias for getTransverseMomentum2.
QEDbase.getTransverseMomentum — Function
getTransverseMomentum(lv)Return the transverse momentum for a given LorentzVectorLike, i.e. the magnitude of its transverse components.
QEDbase.getPt — Function
Function alias for getTransverseMomentum.
QEDbase.getPerp — Function
Function alias for getTransverseMomentum.
QEDbase.getTransverseMass2 — Function
getTransverseMass2(lv)Return the squared transverse mass for a given LorentzVectorLike, i.e. the difference of its squared 0- and 3-component.
QEDbase.getMt2 — Function
Function alias for getTransverseMass2
QEDbase.getTransverseMass — Function
getTransverseMass(lv)Return the transverse momentum for a given LorentzVectorLike, i.e. the square root of its squared transverse mass.
QEDbase.getMt — Function
Function alias for getTransverseMass
QEDbase.getRapidity — Function
getRapidity(lv)Return the rapidity for a given LorentzVectorLike.
QEDbase.getRho2 — Function
Function alias for getMagnitude2
QEDbase.getRho — Function
Function alias for getMagnitude
QEDbase.getTheta — Function
getTheta(lv)Return the theta angle for a given LorentzVectorLike, i.e. the polar angle of its spatial components in spherical coordinates.
If (E,px,py,pz) is a LorentzVectorLike with magnitude rho, this is equivalent to arccos(pz/rho), which is also equivalent to arctan(sqrt(px^2+py^2)/pz).
The spherical coordinates are defined w.r.t. to the 3-axis.
QEDbase.getCosTheta — Function
getCosTheta(lv)Return the cosine of the theta angle for a given LorentzVectorLike.
This is an equivalent but faster version of cos(getTheta(lv)); see getTheta.
QEDbase.getPhi — Function
getPhi(lv)Return the phi angle for a given LorentzVectorLike, i.e. the azimuthal angle of its spatial components in spherical coordinates.
The spherical coordinates are defined w.r.t. to the 3-axis.
QEDbase.getCosPhi — Function
getCosPhi(lv)Return the cosine of the phi angle for a given LorentzVectorLike.
This is an equivalent but faster version of cos(getPhi(lv)); see getPhi.
QEDbase.getSinPhi — Function
getSinPhi(lv)Return the sine of the phi angle for a given LorentzVectorLike.
This is an equivalent but faster version of sin(getPhi(lv)); see getPhi.
QEDbase.getPlus — Function
getPlus(lv)Return the plus component for a given LorentzVectorLike in light-cone coordinates.
The light-cone coordinates are defined w.r.t. to the 3-axis.
The definition p^+ := (E + p_z)/2 differs from the usual definition of light-cone coordinates in general relativity.
QEDbase.getMinus — Function
getMinus(lv)Return the minus component for a given LorentzVectorLike in light-cone coordinates.
The light-cone coordinates are defined w.r.t. to the 3-axis.
The definition p^- := (E - p_z)/2 differs from the usual definition of light-cone coordinates in general relativity.
Setter functions
QEDbase.setE! — Function
setE!(lv,value)Sets the energy component of a given LorentzVectorLike to a given value.
The value set with setE! is then returned by getE.
QEDbase.setEnergy! — Function
Function alias for setE!.
QEDbase.setPx! — Function
setPx!(lv,value)Sets the 1-component of a given LorentzVectorLike to a given value.
The value set with setPx! is then returned by getPx.
QEDbase.setPy! — Function
setPy!(lv,value)Sets the 2-component of a given LorentzVectorLike to a given value.
The value set with setPy! is then returned by getPy.
QEDbase.setPz! — Function
setPz!(lv,value)Sets the 3-component of a given LorentzVectorLike to a given value.
The value set with setPz! is then returned by getPz.
QEDbase.setTheta! — Function
setTheta!(lv,value)Sets the theta angle of a LorentzVectorLike to a given value.
The value set with setTheta! is then returned by getTheta. Since the theta angle is computed on the call of getTheta, the setter setTheta! changes several components of the given LorentzVectorLike.
QEDbase.setCosTheta! — Function
setCosTheta!(lv,value)Sets the cosine of the theta angle of a LorentzVectorLike to a given value.
The value set with setCosTheta! is then returned by getCosTheta. Since the cosine of the theta angle is computed on the call of getCosTheta, the setter setCosTheta! changes several components of the given LorentzVectorLike.
QEDbase.setRho! — Function
setRho!(lv,value)Sets the magnitude of a LorentzVectorLike to a given value.
The value set with setRho! is then returned by getRho. Since the magnitude is computed on the call of getRho, the setter setRho! changes several components of the given LorentzVectorLike.
QEDbase.setPhi! — Function
setPhi!(lv,value)Sets the phi angle of a LorentzVectorLike to a given value.
The value set with setPhi! is then returned by getPhi. Since the phi angle is computed on the call of getPhi, the setter setPhi! changes several components of the given LorentzVectorLike.
QEDbase.setPlus! — Function
setPlus!(lv,value)Sets the plus component of a LorentzVectorLike to a given value.
The value set with setPlus! is then returned by getPlus. Since the plus component is computed on the call of getPlus, the setter setPlus! changes several components of the given LorentzVectorLike.
QEDbase.setMinus! — Function
setMinus!(lv,value)Sets the minus component of a LorentzVectorLike to a given value.
The value set with setMinus! is then returned by getMinus. Since the minus component is computed on the call of getMinus, the setter setMinus! changes several components of the given LorentzVectorLike.
QEDbase.setTransverseMomentum! — Function
setTransverseMomentum!(lv,value)Sets the transverse momentum of a LorentzVectorLike to a given value.
The value set with setTransverseMomentum! is then returned by getTransverseMomentum. Since the transverse momentum is computed on the call of getTransverseMomentum, the setter setTransverseMomentum! changes several components of the given LorentzVectorLike.
QEDbase.setPerp! — Function
Function alias for setTransverseMomentum!.
QEDbase.setPt! — Function
Function alias for setTransverseMomentum!.
QEDbase.setTransverseMass! — Function
setTransverseMass!(lv,value)Sets the transverse mass of a LorentzVectorLike to a given value.
The value set with setTransverseMass! is then returned by getTransverseMass. Since the transverse mass is computed on the call of getTransverseMass, the setter setTransverseMass! changes several components of the given LorentzVectorLike.
QEDbase.setMt! — Function
Function alias for setTransverseMass!.
QEDbase.setRapidity! — Function
setRapidity!(lv,value)Sets the rapidity of a LorentzVectorLike to a given value.
The value set with setRapidity! is then returned by getRapidity. Since the rapidity is computed on the call of setRapidity, the setter setRapidity! changes several components of the given LorentzVectorLike.
Utilities
QEDbase.isonshell — Function
isonshell(mom, mass)
On-shell check of a given four-momentum mom w.r.t. a given mass mass.
For AbstractFourMomentum, the element type defaults to Float64, limiting the precision of comparisons between elements. The current implementation has been tested within the boundaries for energy scales E with 1e-9 <= E <= 1e5. In those bounds, the mass error, which is correctly detected as off-shell, is 1e-4 times the mean value of the components, but has at most the value 0.01, e.g. at the high energy end. The energy scales correspond to 0.5 meV for the lower bound and 50 GeV for the upper bound.
QEDbase.assert_onshell — Function
assert_onshell(mom, mass)
Assertion if a FourMomentum mom is on-shell w.r.t a given mass mass.
The precision of this functions is explained in isonshell.
QEDbase.AbstractCoordinateTransformation — Type
AbstractCoordinateTransformationAbstract base type for coordinate transformations supposed to be acting on four-momenta. Every subtype of trafo::AbstractCoordinateTransformation should implement the following interface functions:
QEDbase._transform(trafo,p): transformspBase.inv(trafo): returns the inverted transform
Example
Implementing the interface by defining the interface functions:
julia> using QEDbase
julia> struct TestTrafo{T} <: AbstractCoordinateTransformation
a::T
end
julia> QEDbase._transform(trafo::TestTrafo,p) = trafo.a*p
julia> Base.inv(trafo::TestTrafo) = TestTrafo(inv(trafo.a))
The TestTrafo can then be used to transform four-momenta:
julia> trafo = TestTrafo(2.0)
TestTrafo{Float64}(2.0)
julia> p = SFourMomentum(4,3,2,1)
4-element SFourMomentum{Float64} with indices SOneTo(4):
4.0
3.0
2.0
1.0
julia> trafo(p) # multiply every component with 2.0
4-element SFourMomentum{Float64} with indices SOneTo(4):
8.0
6.0
4.0
2.0
julia> inv(trafo)(p) # divide every component by 2.0
4-element SFourMomentum{Float64} with indices SOneTo(4):
2.0
1.5
1.0
0.5