Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
fsxbhyy committed Dec 22, 2023
1 parent 12af45e commit 2a4419a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 34 deletions.
2 changes: 1 addition & 1 deletion src/FeynmanDiagram.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export evalNaive, showTree
include("utility.jl")
using .Utility
export Utility
export taylorexpansion!, flatten
export taylorexpansion!

include("frontend/frontends.jl")
using .FrontEnds
Expand Down
33 changes: 0 additions & 33 deletions src/computational_graph/transform.jl
Original file line number Diff line number Diff line change
Expand Up @@ -242,39 +242,6 @@ end
function flatten_prod(graph::AbstractGraph)
flatten_prod!(deepcopy(graph))
end
# function flatten_prod(graph::AbstractGraph)
# if isempty(graph.subgraphs)
# return deepcopy(graph)
# else
# children = []
# for sub in graph.subgraphs
# push!(children, merge_prod(sub))
# end
# newnode = Graph([]; operator=Sum())
# if graph.operator == Sum
# for (child_idx, child) in enumerate(children)
# push!(newnode.subgraphs, child)
# push!(newnode.subgraph_factors, graph.subgraph_factors[child_idx])
# end
# elseif graph.operator == Prod
# newnode.operator = Prod()
# for (child_idx, child) in enumerate(children)
# if isempty(child.subgraphs) || child.operator == Sum
# push!(newnode.subgraphs, child)
# push!(newnode.subgraph_factors, graph.subgraph_factors[child_idx])
# else
# for (grandchild_idx, grandchild) in enumerate(child.subgraphs)
# push!(newnode.subgraphs, grandchild)
# push!(newnode.subgraph_factors, graph.subgraph_factors[child_idx] * child.subgraph_factors[grandchild_idx])
# end
# end
# end
# end
# return newnode
# end
# end



"""
function flatten_chains!(g::AbstractGraph)
Expand Down

0 comments on commit 2a4419a

Please sign in to comment.