-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copied the concrete implementations of `base_state` from `QEDbase.jl` (see https://github.com/QEDjl-project/QEDbase.jl/blob/dev/src/particles/particle_states.jl) This is part of the general restructuring of `QED.jl`, see QEDjl-project/QuantumElectrodynamics.jl#35 for details.
- Loading branch information
Showing
4 changed files
with
176 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
function _booster_fermion(mom::QEDbase.AbstractFourMomentum, mass::Real) | ||
return (slashed(mom) + mass * one(DiracMatrix)) / (sqrt(abs(QEDbase.getT(mom)) + mass)) | ||
end | ||
|
||
function _booster_antifermion(mom::QEDbase.AbstractFourMomentum, mass::Real) | ||
return (mass * one(DiracMatrix) - slashed(mom)) / (sqrt(abs(QEDbase.getT(mom)) + mass)) | ||
end | ||
|
||
function base_state( | ||
particle::Fermion, | ||
::QEDbase.Incoming, | ||
mom::QEDbase.AbstractFourMomentum, | ||
spin::QEDbase.AbstractDefiniteSpin, | ||
) | ||
booster = _booster_fermion(mom, QEDbase.mass(particle)) | ||
return BiSpinor(booster[:, QEDbase._spin_index(spin)]) | ||
end | ||
|
||
function base_state( | ||
particle::Fermion, | ||
::QEDbase.Incoming, | ||
mom::QEDbase.AbstractFourMomentum, | ||
spin::QEDbase.AllSpin, | ||
) | ||
booster = _booster_fermion(mom, QEDbase.mass(particle)) | ||
return SVector(BiSpinor(booster[:, 1]), BiSpinor(booster[:, 2])) | ||
end | ||
|
||
function base_state( | ||
particle::AntiFermion, | ||
::QEDbase.Incoming, | ||
mom::QEDbase.AbstractFourMomentum, | ||
spin::QEDbase.AbstractDefiniteSpin, | ||
) | ||
booster = _booster_antifermion(mom, QEDbase.mass(particle)) | ||
return AdjointBiSpinor(BiSpinor(booster[:, QEDbase._spin_index(spin) + 2])) * GAMMA[1] | ||
end | ||
|
||
function base_state( | ||
particle::AntiFermion, | ||
::QEDbase.Incoming, | ||
mom::QEDbase.AbstractFourMomentum, | ||
spin::QEDbase.AllSpin, | ||
) | ||
booster = _booster_antifermion(mom, QEDbase.mass(particle)) | ||
return SVector( | ||
AdjointBiSpinor(BiSpinor(booster[:, 3])) * GAMMA[1], | ||
AdjointBiSpinor(BiSpinor(booster[:, 4])) * GAMMA[1], | ||
) | ||
end | ||
|
||
function base_state( | ||
particle::Fermion, | ||
::QEDbase.Outgoing, | ||
mom::QEDbase.AbstractFourMomentum, | ||
spin::QEDbase.AbstractDefiniteSpin, | ||
) | ||
booster = _booster_fermion(mom, QEDbase.mass(particle)) | ||
return AdjointBiSpinor(BiSpinor(booster[:, QEDbase._spin_index(spin)])) * GAMMA[1] | ||
end | ||
|
||
function base_state( | ||
particle::Fermion, | ||
::QEDbase.Outgoing, | ||
mom::QEDbase.AbstractFourMomentum, | ||
spin::QEDbase.AllSpin, | ||
) | ||
booster = _booster_fermion(mom, QEDbase.mass(particle)) | ||
return SVector( | ||
AdjointBiSpinor(BiSpinor(booster[:, 1])) * GAMMA[1], | ||
AdjointBiSpinor(BiSpinor(booster[:, 2])) * GAMMA[1], | ||
) | ||
end | ||
|
||
function base_state( | ||
particle::AntiFermion, | ||
::QEDbase.Outgoing, | ||
mom::QEDbase.AbstractFourMomentum, | ||
spin::QEDbase.AbstractDefiniteSpin, | ||
) | ||
booster = _booster_antifermion(mom, QEDbase.mass(particle)) | ||
return BiSpinor(booster[:, QEDbase._spin_index(spin) + 2]) | ||
end | ||
|
||
function base_state( | ||
particle::AntiFermion, | ||
::QEDbase.Outgoing, | ||
mom::QEDbase.AbstractFourMomentum, | ||
spin::QEDbase.AllSpin, | ||
) | ||
booster = _booster_antifermion(mom, QEDbase.mass(particle)) | ||
return SVector(BiSpinor(booster[:, 3]), BiSpinor(booster[:, 4])) | ||
end | ||
|
||
function _photon_state(pol::QEDbase.AllPolarization, mom::QEDbase.AbstractFourMomentum) | ||
cth = QEDbase.getCosTheta(mom) | ||
sth = sqrt(1 - cth^2) | ||
cos_phi = QEDbase.getCosPhi(mom) | ||
sin_phi = QEDbase.getSinPhi(mom) | ||
return SVector( | ||
SLorentzVector{Float64}(0.0, cth * cos_phi, cth * sin_phi, -sth), | ||
SLorentzVector{Float64}(0.0, -sin_phi, cos_phi, 0.0), | ||
) | ||
end | ||
|
||
function _photon_state(pol::QEDbase.PolarizationX, mom::QEDbase.AbstractFourMomentum) | ||
cth = QEDbase.getCosTheta(mom) | ||
sth = sqrt(1 - cth^2) | ||
cos_phi = QEDbase.getCosPhi(mom) | ||
sin_phi = QEDbase.getSinPhi(mom) | ||
return SLorentzVector{Float64}(0.0, cth * cos_phi, cth * sin_phi, -sth) | ||
end | ||
|
||
function _photon_state(pol::QEDbase.PolarizationY, mom::QEDbase.AbstractFourMomentum) | ||
cos_phi = QEDbase.getCosPhi(mom) | ||
sin_phi = QEDbase.getSinPhi(mom) | ||
return SLorentzVector{Float64}(0.0, -sin_phi, cos_phi, 0.0) | ||
end | ||
|
||
@inline function base_state( | ||
particle::Photon, | ||
::QEDbase.ParticleDirection, | ||
mom::QEDbase.AbstractFourMomentum, | ||
pol::QEDbase.AllPolarization, | ||
) | ||
return _photon_state(pol, mom) | ||
end | ||
|
||
@inline function base_state( | ||
particle::Photon, | ||
::QEDbase.ParticleDirection, | ||
mom::QEDbase.AbstractFourMomentum, | ||
pol::QEDbase.AbstractPolarization, | ||
) | ||
return _photon_state(pol, mom) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters