Skip to content

Add benchmark suite#233

Merged
lkdvos merged 14 commits intomasterfrom
benchmarks
Apr 18, 2025
Merged

Add benchmark suite#233
lkdvos merged 14 commits intomasterfrom
benchmarks

Conversation

@lkdvos
Copy link
Member

@lkdvos lkdvos commented Mar 21, 2025

This sets up a benchmark/benchmarks.jl script to have a dedicated SUITE to run our benchmarks, similar to BaseBenchmarks.jl.

The goal is to start adding more coverage so we can better assess the actual performance improvements and/or regressions between versions.

(This is not meant as being illustrative for the performance of this package, for which I am creating separate scripts to generate proper figures etc)

@codecov
Copy link

codecov bot commented Mar 21, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.65%. Comparing base (8e3af86) to head (32f5128).
Report is 7 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #233      +/-   ##
==========================================
+ Coverage   82.64%   82.65%   +0.01%     
==========================================
  Files          43       43              
  Lines        5559     5593      +34     
==========================================
+ Hits         4594     4623      +29     
- Misses        965      970       +5     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

return U1Space((s => d for (s, d) in zip(sectors, dims))...)
end
function generate_space(::Type{SU2Irrep}, D::Int, sigma::Real=0.5)
poisson_pdf(x) = ceil(Int, D * exp(-sigma) * sigma^x / factorial(x))
Copy link
Member

Choose a reason for hiding this comment

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

Strictly speaking, this is not correctly normalised. If we assume that SU2Irrep(j) is indeed generated with dimension poisson_pdf(2*j) = D * exp(-sigma) * sigma^(2j) / factorial(2j), then the total dimension is, with n=2j

$$\sum_{n=0}^{+\infty} D * (n+1) * exp(-\sigma) * \sigma^n / n! \neq D$$

due to the extra factor $$n+1=2j+1$$, which comes from the dimension of the irrep.

Maybe poisson_pdf(x) = ceil(Int, D * exp(-sigma) * sigma^x / factorial(x) / (x+1))

which happens to be

Maybe poisson_pdf(x) = ceil(Int, D * exp(-sigma) * sigma^x / factorial(x+1))

as alternative

Copy link
Member

Choose a reason for hiding this comment

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

Also, for large sigma, the poisson distribution is peaked away from zero, so I do not know if that is really the distribution we want, versus just a half gaussian, but I guess those details don't really matter (but we probably do not want to change them afterwards).

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm definitely happy to switch that, although I think the peak is reasonable too: I like poisson for SU(2) since in the Heisenberg virtual spaces often there are more values of spin 1 than spin 0.

Probably it doesn't matter too much for the actual representativeness of the benchmarks though

lkdvos and others added 2 commits April 18, 2025 11:59
Co-authored-by: Jutho <Jutho@users.noreply.github.com>
@lkdvos lkdvos merged commit acfa273 into master Apr 18, 2025
10 of 11 checks passed
@lkdvos lkdvos deleted the benchmarks branch April 18, 2025 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants