Add virtual_particles structure as comments
This commit is contained in:
@@ -69,9 +69,50 @@ struct FeynmanDiagram{N,E,U,T,M,FM} <: AbstractTreeLevelFeynmanDiagram where {N,
|
||||
end
|
||||
end
|
||||
|
||||
function virtual_particles(diagram::FeynmanDiagram{N,E,U,T,M,FM}) where {N,E,U,T,M,FM}
|
||||
# representation of a virtual particle and the return type of the virtual_particles function
|
||||
struct VirtualParticle{PROC<:QEDbase.AbstractProcessDefinition,PT<:QEDbase.AbstractParticleType,I,O}
|
||||
proc::PROC
|
||||
species::PT
|
||||
in_particle_contributions::NTuple{I,Bool}
|
||||
out_particle_contributions::NTuple{O,Bool}
|
||||
end
|
||||
|
||||
return NTuple{N,Tuple{QEDbase.AbstractParticleType,BitArray,BitArray}}()
|
||||
import Base: +
|
||||
|
||||
# "addition" of the bool tuples
|
||||
# realistically, there should never be "colliding" 1s. if there are there is probably an error and this should be asserted
|
||||
function +(a::Tuple{NTuple{I,Bool},NTuple{O,Bool}}, b::Tuple{NTuple{I,Bool},NTuple{O,Bool}}) where {I,O}
|
||||
return (ntuple(i -> a[1][i] || b[1][i], I), ntuple(i -> a[2][i] || b[2][i], O))
|
||||
end
|
||||
|
||||
function virtual_particles(proc::QEDbase.AbstractProcessDefinition, diagram::FeynmanDiagram{N,E,U,T,M,FM}) where {N,E,U,T,M,FM}
|
||||
I = number_incoming_particles(proc)
|
||||
O = number_outgoing_particles(proc)
|
||||
|
||||
# map of all known particles' momentum composition
|
||||
known_particles = Dict{Int64,Tuple{NTuple{I,Bool},NTuple{O,Bool}}}()
|
||||
|
||||
|
||||
# 1: insert all the external ones (won't be returned), they all have exactly one 1 in their composition
|
||||
# TODO
|
||||
|
||||
|
||||
# 2: Loop:
|
||||
# while there are incomplete fermion lines:
|
||||
# take a fermion line where there is max=1 particle ∉ known_particles
|
||||
# walk the fermion line, assign each virtual particle the momentum composition of the previous (or initial fermion if start) "+" the connected particle
|
||||
# when/if the unknown particle is encountered, start walking from the other side
|
||||
# when they meet at the unknown particle, assign the unknown particle Photon and left side - right side momentum contribution
|
||||
# TODO
|
||||
|
||||
# 3: minimalize the contributions, i.e., if the number of contributing particles > half of all particles, invert both vectors
|
||||
# if it's exactly half of all particles, think of some consistent way to break the symmetry, e.g. swap if the first particle is not contributing
|
||||
# TODO
|
||||
|
||||
# 4: convert the known_particles Dict to an NTuple and remove the external particles (those with only 1 contributing momentum)
|
||||
# TODO
|
||||
|
||||
return NTuple{?,VirtualParticle}()
|
||||
end
|
||||
|
||||
function vertices(diagram::FeynmanDiagram{N,E,U,T,M,FM}) where {N,E,U,T,M,FM}
|
||||
|
@@ -30,10 +30,10 @@ function process end
|
||||
Interface function that must be implemented for an instance of [`AbstractTreeLevelFeynmanDiagram`](@ref).
|
||||
|
||||
Return an `NTuple` with N elements, where N is the number of virtual particles in this diagram. For tree-level Feynman diagrams, \$N = k - 3\$, where \$k\$ is the number of external particles.
|
||||
The elements of the `NTuple` are themselves `Tuple`s, containing for each virtual particle its `QEDbase.AbstractParticleType` and a `BitArray` (`Vector{Boolean}`), indicating
|
||||
with a `1` that an incoming external particle's momentum contributes to the virtual particle's momentum, and a `0` otherwise. The second BitArray does the same for the outgoing external
|
||||
The elements of the `NTuple` are themselves `Tuple`s, containing for each virtual particle its `QEDbase.AbstractParticleType` and an `NTuple{, Bool}` indicating
|
||||
with a `1` that an incoming external particle's momentum contributes to the virtual particle's momentum, and a `0` otherwise. The second `NTuple{, Bool}` does the same for the outgoing external
|
||||
particles, which contribute their momentum negatively.
|
||||
From this definition follows that a particles' `BitArray`s are equivalent to the inverse `BitArray`s, i.e., `BitArray`s where every bit is negated.
|
||||
From this definition follows that a particles' `Boolean NTuple`ss are equivalent to their inverse, i.e., `BitArray`s where every bit is negated.
|
||||
|
||||
Example: Consider the Compton scattering process \$e^- + \\gamma \\to e^- + \\gamma\$ with the diagram where the incoming electron interacts with the incoming photon first.
|
||||
For this diagram there is exactly one virtual particle, which is an electron. This electron's momentum can be represented as the sum of the two incoming particles' momenta, or
|
||||
|
Reference in New Issue
Block a user