Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor taylor expansion #155

Merged
merged 3 commits into from
Nov 13, 2023
Merged

Refactor taylor expansion #155

merged 3 commits into from
Nov 13, 2023

Conversation

fsxbhyy
Copy link
Collaborator

@fsxbhyy fsxbhyy commented Nov 10, 2023

1.Refactor taylor exapansion api. Add support to taylor expansion of FeynmanGraph and DiagTree (no need to convert them to Graph first).
2. Default variable dependence of taylor expansion is changed. If dependence is not provided for some nodes, they are assumed to depend on no variables (meaning that their expansion only has order zero term)
3. Benchmark taylor expansion with sigmaGV FeynmanGraphs.
TODO:

  1. Need to make benchmark more generic by assigning random numbers instead of 1 to leaves.
  2. Change documentations for new api.

@fsxbhyy fsxbhyy added the enhancement New feature or request label Nov 10, 2023
@fsxbhyy fsxbhyy self-assigned this Nov 10, 2023
@codecov-commenter
Copy link

codecov-commenter commented Nov 10, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (54136fe) 63.75% compared to head (e778e58) 68.07%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@               Coverage Diff               @@
##           computgraph     #155      +/-   ##
===============================================
+ Coverage        63.75%   68.07%   +4.31%     
===============================================
  Files               64       64              
  Lines             4442     4501      +59     
===============================================
+ Hits              2832     3064     +232     
+ Misses            1610     1437     -173     
Files Coverage Δ
src/FeynmanDiagram.jl 75.00% <ø> (ø)
src/computational_graph/eval.jl 81.57% <100.00%> (+1.02%) ⬆️
src/diagram_tree/DiagTree.jl 14.28% <ø> (ø)
src/utility.jl 80.39% <95.83%> (+6.24%) ⬆️

... and 5 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

function eval!(g::FeynmanGraph{F,W}, leafmap::Dict{Int,Int}=Dict{Int,Int}(), leaf::Vector{W}=Vector{W}()) where {F,W}
result = nothing

for node in PostOrderDFS(g)
if isleaf(node)
node.weight = leaf[leafmap[node.id]]
if isempty(leafmap)
node.weight = 1.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why set empty leaf as 1.0?

@fsxbhyy fsxbhyy merged commit 0e1b073 into computgraph Nov 13, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants