FeynmanDiagram.jl
FeynmanDiagram.jl copied to clipboard
GraphVector struct
Implement a data structure to handle vector graphs:
NOTE: All graphs in the vector should have the same number of external legs, but the labels of the external legs can be different.
- [x] Add the following struct struct GraphVector{F, W} <: AbstractVector graphs::Vector{Graphs{F, W}} end
- [x] Implement vector indexing through julia iterator API
- [x] A function to group the graphs with the same external legs with a given index. For example,
For a GraphVector, gv = GraphVector([g(1, 2), g(1, 3), g(2, 3)]). We expect the following:
- merge(gv, indices = [1, ]) = [GraphVector([g(1, 2), g(1, 3)]), GraphVector([g(2,3), ])]
- merge(gv, indices = [2, ]) = [GraphVector([g(1, 2), ]), GraphVector([g(2,3), g(1, 3)])]
- merge(gv, indices = [1, 2]) = [GraphVector([g(1, 2), ]), GraphVector([g(2,3), ]), GraphVector([g(1, 3), ])]
- [ ] construct Feynman diagram from a set of GraphVectors.
function feynman_diagram(vertices::Vector{GraphVector}, topology::Vector{Vector{Int}}; external=[], factor=one(_dtype.factor), weight=zero(_dtype.weight), name="", type=:generic)