Skip to content

Commit

Permalink
Bugfix & cleanup exports
Browse files Browse the repository at this point in the history
  • Loading branch information
dcerkoney committed Oct 29, 2023
1 parent 050b8a2 commit a6fb72a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/FeynmanDiagram.jl
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ export optimize!, optimize, merge_all_chains!, merge_all_linear_combinations!, r
include("TaylorSeries/TaylorSeries.jl")
using .Taylor
export Taylor
export TaylorSeries, set_variables, taylor_factorial, getcoeff


include("backend/compiler.jl")
Expand Down
10 changes: 5 additions & 5 deletions src/backend/static.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ function to_static(::Type{ComputationalGraphs.Prod}, subgraphs::Vector{Graph{F,W
end
end

function _to_static(::Type{ComputationalGraphs.Power{N}}, subgraphs::Vector{Graph{F,W}}, subgraph_factors::Vector{F}) where {N,F,W}
function to_static(::Type{ComputationalGraphs.Power{N}}, subgraphs::Vector{Graph{F,W}}, subgraph_factors::Vector{F}) where {N,F,W}
factor_str = subgraph_factors[1] == 1 ? "" : " * $(subgraph_factors[1])"
return "((g$(subgraphs[1].id))^$N$factor_str)"
end

function _to_static(::Type{ComputationalGraphs.Sum}, subgraphs::Vector{FeynmanGraph{F,W}}, subgraph_factors::Vector{F}) where {F,W}
function to_static(::Type{ComputationalGraphs.Sum}, subgraphs::Vector{FeynmanGraph{F,W}}, subgraph_factors::Vector{F}) where {F,W}
if length(subgraphs) == 1
factor_str = subgraph_factors[1] == 1 ? "" : " * $(subgraph_factors[1])"
return "(g$(subgraphs[1].id)$factor_str)"
Expand All @@ -56,7 +56,7 @@ function to_static(::Type{ComputationalGraphs.Prod}, subgraphs::Vector{FeynmanGr
end
end

function _to_static(::Type{ComputationalGraphs.Power{N}}, subgraphs::Vector{FeynmanGraph{F,W}}, subgraph_factors::Vector{F}) where {N,F,W}
function to_static(::Type{ComputationalGraphs.Power{N}}, subgraphs::Vector{FeynmanGraph{F,W}}, subgraph_factors::Vector{F}) where {N,F,W}
factor_str = subgraph_factors[1] == 1 ? "" : " * $(subgraph_factors[1])"
return "((g$(subgraphs[1].id))^$N$factor_str)"
end
Expand Down Expand Up @@ -91,7 +91,7 @@ function to_julia_str(graphs::AbstractVector{<:AbstractGraph}; root::AbstractVec
else
g_id in inds_visitednode && continue
factor_str = factor(g) == 1 ? "" : " * $(factor(g))"
body *= " $target = $(_to_static(operator(g), subgraphs(g), subgraph_factors(g)))$factor_str\n "
body *= " $target = $(to_static(operator(g), subgraphs(g), subgraph_factors(g)))$factor_str\n "
push!(inds_visitednode, g_id)
end
if isroot
Expand Down Expand Up @@ -139,7 +139,7 @@ function to_julia_str(graphs::AbstractVector{<:AbstractGraph}, leafMap::Dict{Int
else
g_id in inds_visitednode && continue
factor_str = factor(g) == 1 ? "" : " * $(factor(g))"
body *= " $target = $(_to_static(operator(g), subgraphs(g), subgraph_factors(g)))$factor_str\n "
body *= " $target = $(to_static(operator(g), subgraphs(g), subgraph_factors(g)))$factor_str\n "
push!(inds_visitednode, g_id)
end
if isroot
Expand Down

0 comments on commit a6fb72a

Please sign in to comment.