Models
QEDFeynman.QEDFeynman
— ModuleQEDFeynman
A module containing QED and ABC model functionality for scattering processes in particle physics.
Interface and General
The interface that has to be implemented for a model to be usable is defined in src/interface.jl
.
QEDFeynman.AbstractPhysicsModel
— TypeAbstractPhysicsModel
Base type for a model, e.g. ABC-Model or QED. This is used to dispatch many functions.
QEDFeynman.AbstractProcessDescription
— TypeAbstractProcessDescription <: AbstractProblemInstance
Base type for particle scattering process descriptions. An object of this type of a corresponding AbstractPhysicsModel
should uniquely identify a scattering process in that model.
See also: parse_process
QEDFeynman.AbstractProcessInput
— TypeAbstractProcessInput
Base type for process inputs. An object of this type contains the input values (e.g. momenta) of the particles in a process.
See also: gen_process_input
QEDFeynman.ParticleValue
— TypeParticleValue{ParticleType <: AbstractParticleStateful}
A struct describing a particle during a calculation of a Feynman Diagram, together with the value that's being calculated. AbstractParticleStateful
is the type from the QEDbase package.
sizeof(ParticleValue())
= 48 Byte
QEDFeynman.ParticleValueSP
— TypeTBW
particle value + spin/pol info, only used on the external legs (u tasks)
QEDFeynman.gen_process_input
— Functiongen_process_input(::AbstractProcessDescription)
Interface function that must be implemented for every specific AbstractProcessDescription
. Returns a randomly generated and valid corresponding ProcessInput
.
QEDFeynman.get_particle
— Functionget_particle(::AbstractProcessInput, t::Type, n::Int)
Interface function that must be implemented for every subtype of AbstractProcessInput
. Returns the n
th particle of type t
.
QEDFeynman.interaction_result
— Functioninteraction_result(t1::AbstractParticleStateful, t2::AbstractParticleStateful)
Interface function that must be implemented for AbstractParticleStateful
s for all pairs of particle_species that can occur in the model. It should return the result particle (stateful) type when the two given particles interact.
QEDFeynman.model
— Functionmodel(::AbstractProcessDescription)
model(::AbstractProcessInput)
Return the model of this process description or input.
QEDFeynman.parse_process
— Functionparse_process(::AbstractString, ::AbstractPhysicsModel)
Interface function that must be implemented for every subtype of AbstractPhysicsModel
. Returns a ProcessDescription
object.
QEDFeynman.part_from_x
— Methodpart_from_x(type::Type, index::Int, x::AbstractProcessInput)
Return the ParticleValue
of the given type of particle with the given index
from the given process input.
Function is wrapped into a FunctionCall
in gen_input_assignment_code
.
QEDFeynman.type_index_from_name
— Functiontype_from_name(model::AbstractModel, name::String)
For a name of a particle in the given AbstractModel
, return the particle's Type
and index as a tuple. The input string can be expetced to be of the form "<name><index>".
QEDFeynman.types
— Functiontypes(::AbstractPhysicsModel)
Interface function that must be implemented for every subtype of AbstractPhysicsModel
, returning a Vector
of the available particle types in the model.
QEDFeynman.propagated_particle
— Methodpropagated_particle(p::AbstractParticleStateful)
Returns the same particle but with inversed particle_direction.
ABC-Model
Types
QEDFeynman.ABCModel
— TypeABCModel <: AbstractPhysicsModel
Singleton definition for identification of the ABC-Model.
QEDFeynman.ABCParticle
— TypeABCParticle
Base type for all particles in the ABCModel
.
QEDFeynman.ComputeTaskABC_P
— TypeComputeTaskABC_P <: AbstractComputeTask
P task with no children.
QEDFeynman.ComputeTaskABC_S1
— TypeComputeTaskABC_S1 <: AbstractComputeTask
S task with a single child.
QEDFeynman.ComputeTaskABC_S2
— TypeComputeTaskABC_S2 <: AbstractComputeTask
S task with two children.
QEDFeynman.ComputeTaskABC_Sum
— TypeComputeTaskABC_Sum <: AbstractComputeTask
Task that sums all its inputs, n children.
QEDFeynman.ComputeTaskABC_U
— TypeComputeTaskABC_U <: AbstractComputeTask
u task with a single child.
QEDFeynman.ComputeTaskABC_V
— TypeComputeTaskABC_V <: AbstractComputeTask
v task with two children.
QEDFeynman.ParticleA
— TypeParticleA <: ABCParticle
An 'A' particle in the ABC Model.
QEDFeynman.ParticleB
— TypeParticleB <: ABCParticle
A 'B' particle in the ABC Model.
QEDFeynman.ParticleC
— TypeParticleC <: ABCParticle
A 'C' particle in the ABC Model.
QEDFeynman.PerturbativeABC
— TypePerturbativeABC <: AbstractModel
The model being used for the ABC model.
QEDFeynman.ABC_TASKS
— ConstantABC_TASKS
Constant vector of all tasks of the ABC-Model.
QEDFeynman.GenericABCProcess
— TypeGenericABCProcess <: AbstractProcessDefinition
Particle
QEDFeynman.ABC_conserve_momentum
— MethodABC_conserve_momentum(p1::ABCParticle, p2::ABCParticle)
Calculate and return a new particle from two given interacting ones at a vertex.
Takes 4 effective FLOP.
QEDFeynman.ABC_inner_edge
— MethodABC_inner_edge(p::AbstractParticleStateful{Dir, ABCParticle})
Return the factor of the inner edge with the given (virtual) particle.
Takes 10 effective FLOP. (3 here + 7 in square(p))
QEDFeynman.ABC_outer_edge
— MethodABC_outer_edge(p::AbstractParticleStateful{Dir, ABCParticle})
Return the factor of the outer edge with the given (real) particle.
Takes 0 effective FLOP.
QEDFeynman.ABC_vertex
— MethodABC_vertex()
Return the factor of a vertex.
Takes 0 effective FLOP since it's constant.
QEDFeynman.interaction_result
— Methodinteraction_result(
p1::AbstractParticleStateful{<:ParticleDirection, <:ABCParticle},
p2::AbstractParticleStateful{<:ParticleDirection, <:ABCParticle},
)
For 2 given (non-equal) particle types, return the third of ABC.
QEDFeynman.square
— Methodsquare(p::AbstractParticleStateful{Dir, ABCParticle})
Return the square of the particle's momentum as a Float
value.
Takes 7 effective FLOP.
QEDFeynman.types
— Methodtypes(::ABCModel)
Return a Vector of the possible types of particle in the ABCModel
.
QEDbase.mass
— Methodmass(t::Type{T}) where {T <: ABCParticle}
Return the mass (at rest) of the given particle type.
Parse
QEDFeynman.parse_dag
— Functionparse_dag(filename::String, proc::GenericABCProcess; verbose::Bool = false)
Read an ABC-model process from the given file. If verbose
is set to true, print some progress information to stdout.
Returns a valid DAG
.
QEDFeynman.parse_edges
— Methodparse_edges(input::AbstractString)
Parse the given string into a vector of strings containing each edge. Currently unused since the entire graph can be read from just the node names.
QEDFeynman.parse_nodes
— Methodparse_nodes(input::AbstractString)
Parse the given string into a vector of strings containing each node.
QEDFeynman.parse_process
— Methodparse_process(string::AbstractString, model::ABCModel)
Parse a string representation of a process, such as "AB->ABBB" into the corresponding GenericABCProcess
.
Properties
ComputableDAGs.children
— Methodchildren(::ComputeTaskABC_P)
Return the number of children of a ComputeTaskABC_P (always 1).
ComputableDAGs.children
— Methodchildren(::ComputeTaskABC_S1)
Return the number of children of a ComputeTaskABC_S1 (always 1).
ComputableDAGs.children
— Methodchildren(::ComputeTaskABC_S2)
Return the number of children of a ComputeTaskABC_S2 (always 2).
ComputableDAGs.children
— Methodchildren(::ComputeTaskABC_Sum)
Return the number of children of a ComputeTaskABC_Sum.
ComputableDAGs.children
— Methodchildren(::ComputeTaskABC_U)
Return the number of children of a ComputeTaskABC_U (always 1).
ComputableDAGs.children
— Methodchildren(::ComputeTaskABC_V)
Return the number of children of a ComputeTaskABC_V (always 2).
ComputableDAGs.compute_effort
— Methodcompute_effort(t::ComputeTaskABC_P)
Return the compute effort of a P task.
ComputableDAGs.compute_effort
— Methodcompute_effort(t::ComputeTaskABC_S1)
Return the compute effort of an S1 task.
ComputableDAGs.compute_effort
— Methodcompute_effort(t::ComputeTaskABC_S2)
Return the compute effort of an S2 task.
ComputableDAGs.compute_effort
— Methodcompute_effort(t::ComputeTaskABC_Sum)
Return the compute effort of a Sum task.
Note: This is a constant compute effort, even though sum scales with the number of its inputs. Since there is only ever a single sum node in a graph generated from the ABC-Model, this doesn't matter.
ComputableDAGs.compute_effort
— Methodcompute_effort(t::ComputeTaskABC_U)
Return the compute effort of a U task.
ComputableDAGs.compute_effort
— Methodcompute_effort(t::ComputeTaskABC_V)
Return the compute effort of a V task.
Create
QEDFeynman.gen_process_input
— Methodgen_process_input(proc::GenericABCProcess)
Return a ProcessInput of randomly generated ABCParticle
s from a GenericABCProcess
. The process description can be created manually or parsed from a string using parse_process
.
Note: This uses RAMBO to create a valid process with conservation of momentum and energy.
Compute
ComputableDAGs.compute
— Methodcompute(::ComputeTaskABC_Sum, data...)
compute(::ComputeTaskABC_Sum, data::AbstractArray)
Compute a sum over the vector. Use an algorithm that accounts for accumulated errors in long sums with potentially large differences in magnitude of the summands.
Linearly many FLOP with growing data.
ComputableDAGs.compute
— Methodcompute(::ComputeTaskABC_V, data1::ParticleValue, data2::ParticleValue)
Compute a vertex. Preserve momentum and particle types (AB->C etc.) to create resulting particle, multiply values together and times a vertex factor.
6 FLOP.
ComputableDAGs.compute
— Methodcompute(::ComputeTaskABC_P, data::ParticleValue)
Return the particle and value as is.
0 FLOP.
ComputableDAGs.compute
— Methodcompute(::ComputeTaskABC_S1, data::ParticleValue)
Compute inner edge (1 input particle, 1 output particle).
11 FLOP.
ComputableDAGs.compute
— Methodcompute(::ComputeTaskABC_S2, data1::ParticleValue, data2::ParticleValue)
Compute a final inner edge (2 input particles, no output particle).
For valid inputs, both input particles should have the same momenta at this point.
12 FLOP.
ComputableDAGs.compute
— Methodcompute(::ComputeTaskABC_U, data::ParticleValue)
Compute an outer edge. Return the particle value with the same particle and the value multiplied by an ABCouteredge factor.
1 FLOP.
QEDFeynman.show
— Methodshow(io::IO, particle::ABCParticle)
Pretty print an ABCParticle
(no newlines).
QED-Model
Feynman Diagrams
Core.String
— MethodString(p::FeynmanParticle)
Return a string representation of the FeynmanParticle
in a format that is readable by type_index_from_name
.
QEDFeynman.FeynmanDiagram
— TypeFeynmanDiagram
Representation of a feynman diagram. It consists of its initial input/output particles, and a vector of sets of FeynmanVertex
s. The vertices are to be applied level by level. A FeynmanVertex
will always be at the lowest level possible, i.e. the lowest level at which all input particles for it exist. The FeynmanTie
represents the final inner edge of the diagram.
QEDFeynman.FeynmanDiagram
— MethodFeynmanDiagram(pd::ScatteringProcess)
Create an initial FeynmanDiagram
with only its initial particles set and no vertices or ties.
Use gen_diagrams
to generate all possible diagrams from this one.
QEDFeynman.FeynmanParticle
— TypeFeynmanParticle
Representation of a particle for use in FeynmanDiagram
s. Consist of the ParticleStateful
type and an id.
QEDFeynman.FeynmanTie
— TypeFeynmanTie
Representation of a "tie" in a FeynmanDiagram
. A tie ties two virtual particles in a diagram together and thus represent an inner line of the diagram. Not all inner lines are FeynmanTie
s, in fact, a connected diagram only ever has exactly one tie.
QEDFeynman.FeynmanVertex
— TypeFeynmanVertex
Representation of a vertex in a FeynmanDiagram
. Stores two input FeynmanParticle
s and one output.
QEDFeynman.add_tie!
— Methodadd_tie!(fd::FeynmanDiagram, tie::FeynmanTie)
Add the given tie to the diagram, always at the last level.
QEDFeynman.add_tie
— Methodadd_tie(fd::FeynmanDiagram, tie::FeynmanTie)
Add the given tie to the diagram, at the earliest level possible. Return the new diagram without muting the given one.
QEDFeynman.add_vertex!
— Methodadd_vertex!(fd::FeynmanDiagram, vertex::FeynmanVertex)
Add the given vertex to the diagram, at the earliest level possible.
QEDFeynman.add_vertex
— Methodadd_vertex(fd::FeynmanDiagram, vertex::FeynmanVertex)
Add the given vertex to the diagram, at the earliest level possible. Return the new diagram without muting the given one.
QEDFeynman.apply_tie!
— Methodapply_tie!(particles::Vector{FeynmanParticle}, tie::FeynmanTie)
Apply a FeynmanTie
to the given vector of FeynmanParticle
s.
QEDFeynman.apply_vertex!
— Methodapply_vertex!(particles::Vector{FeynmanParticle}, vertex::FeynmanVertex)
Apply a FeynmanVertex
to the given vector of FeynmanParticle
s.
QEDFeynman.can_apply_tie
— Methodcan_apply_tie(particles::Vector{FeynmanParticle}, tie::FeynmanTie)
Return true if the given FeynmanTie
can be applied to the given particles, i.e. both input particles of the tie are in the vector.
QEDFeynman.can_apply_vertex
— Methodcan_apply_vertex(particles::Vector{FeynmanParticle}, vertex::FeynmanVertex)
Return true if the given FeynmanVertex
can be applied to the given particles, i.e. both input particles of the vertex are in the vector and the output particle is not.
QEDFeynman.can_tie
— Methodcan_tie(p1::Type, p2::Type)
For two given QEDParticle
types, return whether they can be tied together.
They can be tied iff one is the propagation_result
of the other, or if both are photons, in which case their direction does not matter.
QEDFeynman.gen_compton_diagram_from_order
— Methodgen_compton_diagram_from_order(order::Vector{Int}, inFerm, outFerm, n::Int, m::Int)
Helper function for gen_compton_diagrams
. Generates a single diagram for the given order and n input and m output photons.
QEDFeynman.gen_compton_diagram_from_order_one_side
— Methodgen_compton_diagram_from_order_one_side(order::Vector{Int}, inFerm, outFerm, n::Int, m::Int)
Helper function for gen_compton_diagrams
. Generates a single diagram for the given order and n input and m output photons.
QEDFeynman.gen_compton_diagrams
— Methodgen_compton_diagrams(n::Int, m::Int)
Special case diagram generation for Compton processes, i.e., processes of the form k^ne->k^me
QEDFeynman.gen_compton_diagrams_one_side
— Methodgen_compton_diagrams_one_side(n::Int, m::Int)
Special case diagram generation for Compton processes, i.e., processes of the form k^ne->k^me, but generating from one end, yielding larger diagrams
QEDFeynman.gen_diagrams
— Methodgen_diagrams(fd::FeynmanDiagram)
From a given feynman diagram in its initial state, e.g. when created through the FeynmanDiagram
(pd::ProcessDescription)
constructor, generate and return all possible FeynmanDiagram
s that describe that process.
QEDFeynman.get_particles
— Functionget_particles(fd::FeynmanDiagram, level::Int)
Return a vector of the particles after applying the vertices and tie of the diagram up to the given level. If no level is given, apply all. The tie comes last and is its own "level".
QEDFeynman.id_for_type
— Methodid_for_type(d::FeynmanDiagram, t::Type{<:ParticleStateful})
Return the highest id of any particle of the given type in the diagram + 1.
QEDFeynman.is_compton
— Methodis_compton(fd::FeynmanDiagram)
Returns true iff the given feynman diagram is an (empty) diagram of a compton process like ke->k^ne
QEDFeynman.isvalid
— Methodisvalid(fd::FeynmanDiagram)
Return whether the given diagram is valid. A diagram is valid iff the following are true:
- After applying all vertices and the tie, there are no more particles left
- The diagram is connected
QEDFeynman.possible_tie
— Methodpossible_tie(fd::FeynmanDiagram)
Return a possible tie or missing
for the diagram at its current state.
QEDFeynman.possible_vertices
— Methodpossible_vertices(fd::FeynmanDiagram)
Return a vector of all possible vertices that can be applied to the diagram at its current state.
Types
QEDFeynman.ComputeTaskQED_P
— TypeComputeTaskQED_P <: AbstractComputeTask
P task with no children.
QEDFeynman.ComputeTaskQED_S1
— TypeComputeTaskQED_S1 <: AbstractComputeTask
S task with a single child.
QEDFeynman.ComputeTaskQED_S2
— TypeComputeTaskQED_S2 <: AbstractComputeTask
S task with two children.
QEDFeynman.ComputeTaskQED_Sum
— TypeComputeTaskQED_Sum <: AbstractComputeTask
Task that sums all its inputs, n children.
QEDFeynman.ComputeTaskQED_U
— TypeComputeTaskQED_U <: AbstractComputeTask
u task with a single child.
QEDFeynman.ComputeTaskQED_V
— TypeComputeTaskQED_V <: AbstractComputeTask
v task with two children.
QEDFeynman.QEDModel
— TypeQEDModel <: AbstractPhysicsModel
Singleton definition for identification of the QED-Model.
QEDFeynman.QED_TASKS
— ConstantQED_TASKS
Constant vector of all tasks of the QED-Model.
Particle
QEDFeynman.QED_conserve_momentum
— MethodQED_conserve_momentum(p1::ParticleStateful, p2::ParticleStateful)
Calculate and return a new particle from two given interacting ones at a vertex.
QEDFeynman.QED_vertex
— MethodQED_vertex()
Return the factor of a vertex in a QED feynman diagram.
QEDFeynman.caninteract
— Methodcaninteract(T1::Type{<:ParticleStateful}, T2::Type{<:ParticleStateful})
For two given ParticleStateful
types, return whether they can interact at a vertex. This is equivalent to !issame(T1, T2)
.
See also: issame
and interaction_result
QEDFeynman.issame
— Methodissame(T1::Type{<:ParticleStateful}, T2::Type{<:ParticleStateful})
For two given ParticleStateful
types, return whether they are equivalent for the purpose of a Feynman Diagram. That means e.g. an Incoming
AntiFermion
is the same as an Outgoing
Fermion
. This is equivalent to !caninteract(T1, T2)
.
See also: caninteract
and interaction_result
QEDFeynman.model
— Methodmodel(::AbstractProcessDescription)
Return the model of this process description.
QEDFeynman.types
— Methodtypes(::QEDModel)
Return a Vector of the possible types of particle in the QEDModel
.
Parse
QEDFeynman.parse_process
— Functionparse_process(string::AbstractString, model::QEDModel)
Parse a string representation of a process, such as "ke->ke" into the corresponding QEDProcessDescription
.
Properties
ComputableDAGs.children
— Methodchildren(::ComputeTaskQED_P)
Return the number of children of a ComputeTaskQED_P (always 1).
ComputableDAGs.children
— Methodchildren(::ComputeTaskQED_S1)
Return the number of children of a ComputeTaskQED_S1 (always 1).
ComputableDAGs.children
— Methodchildren(::ComputeTaskQED_S2)
Return the number of children of a ComputeTaskQED_S2 (always 2).
ComputableDAGs.children
— Methodchildren(::ComputeTaskQED_Sum)
Return the number of children of a ComputeTaskQED_Sum.
ComputableDAGs.children
— Methodchildren(::ComputeTaskQED_U)
Return the number of children of a ComputeTaskQED_U (always 1).
ComputableDAGs.children
— Methodchildren(::ComputeTaskQED_V)
Return the number of children of a ComputeTaskQED_V (always 2).
ComputableDAGs.compute_effort
— Methodcompute_effort(t::ComputeTaskQED_P)
Return the compute effort of a P task.
ComputableDAGs.compute_effort
— Methodcompute_effort(t::ComputeTaskQED_S1)
Return the compute effort of an S1 task.
ComputableDAGs.compute_effort
— Methodcompute_effort(t::ComputeTaskQED_S2)
Return the compute effort of an S2 task.
ComputableDAGs.compute_effort
— Methodcompute_effort(t::ComputeTaskQED_Sum)
Return the compute effort of a Sum task.
Note: This is a constant compute effort, even though sum scales with the number of its inputs. Since there is only ever a single sum node in a graph generated from the QED-Model, this doesn't matter.
ComputableDAGs.compute_effort
— Methodcompute_effort(t::ComputeTaskQED_U)
Return the compute effort of a U task.
ComputableDAGs.compute_effort
— Methodcompute_effort(t::ComputeTaskQED_V)
Return the compute effort of a V task.
Create
QEDFeynman.gen_graph
— Methodgen_graph(process_description::ScatteringProcess)
For a given QEDprocesses.ScatteringProcess
, return the DAG
that computes it.
QEDFeynman.gen_process_input
— Methodgen_process_input(processDescription::ScatteringProcess)
Return a PhaseSpacePoint
of randomly generated particles from a QEDprocesses.ScatteringProcess
. The process description can be created manually or parsed from a string using parse_process
.
Note: This uses RAMBO to create a valid process with conservation of momentum and energy.
Compute
ComputableDAGs.compute
— Methodcompute(::ComputeTaskQED_Sum, data...)
compute(::ComputeTaskQED_Sum, data::AbstractArray)
Compute a sum over the vector. Use an algorithm that accounts for accumulated errors in long sums with potentially large differences in magnitude of the summands.
Linearly many FLOP with growing data.
ComputableDAGs.compute
— Methodcompute(::ComputeTaskQED_S2, data1::ParticleValue, data2::ParticleValue)
Compute a final inner edge (2 input particles, no output particle).
For valid inputs, both input particles should have the same momenta at this point.
12 FLOP.
ComputableDAGs.compute
— Methodcompute(::ComputeTaskQED_U, data::ParticleValueSP)
Compute an outer edge. Return the particle value with the same particle and the value multiplied by an outer_edge factor.
ComputableDAGs.compute
— Methodcompute(::ComputeTaskQED_V, data1::ParticleValue, data2::ParticleValue)
Compute a vertex. Preserve momentum and particle types (e + gamma->p etc.) to create resulting particle, multiply values together and times a vertex factor.
ComputableDAGs.compute
— Methodcompute(::ComputeTaskQED_S1, data::ParticleValue)
Compute inner edge (1 input particle, 1 output particle).
QEDFeynman.show
— Methodshow(io::IO, particle::FeynmanDiagram)
Pretty print a FeynmanDiagram
(with newlines).
QEDFeynman.show
— Methodshow(io::IO, particle::FeynmanParticle)
Pretty print a FeynmanParticle
(no newlines).
QEDFeynman.show
— Methodshow(io::IO, particle::FeynmanTie)
Pretty print a FeynmanTie
(no newlines).
QEDFeynman.show
— Methodshow(io::IO, particle::FeynmanVertex)
Pretty print a FeynmanVertex
(no newlines).