Skip to content

Add benchmark suite#4

Merged
ChristophHotter merged 4 commits into
mainfrom
benchmark
Apr 3, 2026
Merged

Add benchmark suite#4
ChristophHotter merged 4 commits into
mainfrom
benchmark

Conversation

@oameye
Copy link
Copy Markdown
Member

@oameye oameye commented Apr 3, 2026

Adds a benchmarks/ directory with BenchmarkTools.jl benchmarks covering the main features of the package:

  • SLH Algebra: symbolic cascade/concatenate/feedback, numeric SLHqo composition, and closure evaluation (the ODE hot loop)
  • Translation: static and time-dependent translate_qo, plus closure evaluation
  • Pulse Couplings: single-pulse u_to_gu/v_to_gv and multi-pulse u_eff/v_eff
  • Interaction Picture: coupling matrix A(t) evaluation, coefficient matrix M(t) solve (numerical + analytical), operator substitution
  • Correlations: two-time correlation matrix

Benchmarks use realistic system sizes from the examples. Closure evaluation benchmarks specifically target the per-timestep allocation

5-element BenchmarkTools.BenchmarkGroup:
  tags: []
  "SLH Algebra" => 3-element BenchmarkTools.BenchmarkGroup:
          tags: []
          "symbolic" => 3-element BenchmarkTools.BenchmarkGroup:
                  tags: []
                  "feedback OPO loop" => TrialEstimate(1.664 ms)
                  "concatenate + cascade" => TrialEstimate(9.722 ms)
                  "3-cavity cascade" => TrialEstimate(49.348 ms)
          "numeric (SLHqo)" => 1-element BenchmarkTools.BenchmarkGroup:
                  tags: []
                  "2-QD waveguide composition" => TrialEstimate(70.020 μs)
          "closure evaluation" => 2-element BenchmarkTools.BenchmarkGroup:
                  tags: []
                  "2-QD waveguide L(t)" => TrialEstimate(45.750 μs)
                  "2-QD waveguide H(t)" => TrialEstimate(64.030 μs)
  "Interaction Picture" => 3-element BenchmarkTools.BenchmarkGroup:
          tags: []
          "operator substitution" => 1-element BenchmarkTools.BenchmarkGroup:
                  tags: []
                  "TLS cascade" => TrialEstimate(557.508 ms)
          "coefficient matrix M" => 2-element BenchmarkTools.BenchmarkGroup:
                  tags: []
                  "numerical (ODE)" => TrialEstimate(233.490 μs)
                  "analytical (2 equal modes)" => TrialEstimate(18.300 μs)
          "coupling matrix evaluation" => 2-element BenchmarkTools.BenchmarkGroup:
                  tags: []
                  "2 modes" => TrialEstimate(449.259 ns)
                  "4 modes" => TrialEstimate(3.720 μs)
  "Pulse Couplings" => 2-element BenchmarkTools.BenchmarkGroup:
          tags: []
          "single-pulse" => 2-element BenchmarkTools.BenchmarkGroup:
                  tags: []
                  "output" => TrialEstimate(1.523 ms)
                  "input" => TrialEstimate(1.329 ms)
          "multi-pulse" => 2-element BenchmarkTools.BenchmarkGroup:
                  tags: []
                  "output 2 modes" => TrialEstimate(2.709 ms)
                  "input 2 modes" => TrialEstimate(4.688 ms)
  "Correlations" => 1-element BenchmarkTools.BenchmarkGroup:
          tags: []
          "two-time" => 1-element BenchmarkTools.BenchmarkGroup:
                  tags: []
                  "single photon cavity" => TrialEstimate(405.307 ms)
  "Translation" => 3-element BenchmarkTools.BenchmarkGroup:
          tags: []
          "static" => 1-element BenchmarkTools.BenchmarkGroup:
                  tags: []
                  "atom-cavity" => TrialEstimate(458.006 μs)
          "closure evaluation" => 2-element BenchmarkTools.BenchmarkGroup:
                  tags: []
                  "3-cavity L(t)" => TrialEstimate(14.970 μs)
                  "3-cavity H(t)" => TrialEstimate(20.010 μs)
          "time-dependent" => 2-element BenchmarkTools.BenchmarkGroup:
                  tags: []
                  "3-cavity H+L" => TrialEstimate(3.239 ms)
                  "atom-cavity" => TrialEstimate(810.541 μs)
```julia

@ChristophHotter ChristophHotter merged commit 4a5d6b2 into main Apr 3, 2026
5 checks passed
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