benchmark against QuantumAlgebra - #163
Merged
Merged
Conversation
oameye
marked this pull request as ready for review
July 20, 2026 08:01
There was a problem hiding this comment.
Benchmark Results
Details
| Benchmark suite | Current: bc413da | Previous: 5a37827 | Ratio |
|---|---|---|---|
Accumulation/Many-mode H/foldl M=16 |
9551 ns |
10870 ns |
0.88 |
Accumulation/Many-mode H/foldl M=24 |
20844 ns |
24726 ns |
0.84 |
Accumulation/Many-mode H/foldl M=8 |
2299.1111111111113 ns |
2800.8888888888887 ns |
0.82 |
Accumulation/Many-mode H/sum M=16 |
1311 ns |
1683.1 ns |
0.78 |
Accumulation/Many-mode H/sum M=24 |
1810.4 ns |
2298.777777777778 ns |
0.79 |
Accumulation/Many-mode H/sum M=8 |
534.0752688172043 ns |
713.2805755395683 ns |
0.75 |
Accumulation/Same-site/foldl |
5138 ns |
6229.6 ns |
0.82 |
Accumulation/Same-site/sum |
1604.8 ns |
2101.777777777778 ns |
0.76 |
Commutator/Nested JC/depth=1 |
1214.4 ns |
1678.1 ns |
0.72 |
Commutator/Nested JC/depth=2 |
13475 ns |
18254 ns |
0.74 |
Commutator/Nested JC/depth=3 |
49280 ns |
68689 ns |
0.72 |
Commutator/Nested JC/depth=4 |
122277 ns |
170841 ns |
0.72 |
Commutator/Nested JC/depth=5 |
265554 ns |
377859 ns |
0.70 |
Commutator/Schrieffer-Wolff/[S, V] |
128500 ns |
201047 ns |
0.64 |
Commutator/Schrieffer-Wolff/[S, [S, H0]] |
237861 ns |
375935 ns |
0.63 |
Indexing/Diagonal collapse/[H_Dicke, S_j] |
30140 ns |
43342 ns |
0.70 |
Indexing/Diagonal collapse/[H_JC, σ_j] |
40410 ns |
61826 ns |
0.65 |
Indexing/Simplify/double-sum spin-spin |
10693 ns |
16030 ns |
0.67 |
Indexing/Simplify/indexed JC H |
1085 ns |
1135.1 ns |
0.96 |
Indexing/Sum construction/double Σ_ij(J_ij*S_i*S_j) |
5884.6 ns |
8596.333333333334 ns |
0.68 |
Indexing/Sum construction/single Σ_i(σ_i*σ_j) |
7137.5 ns |
11642 ns |
0.61 |
Normal Order/Fock (c*c')^n/n=2 |
486.4948979591837 ns |
602.224043715847 ns |
0.81 |
Normal Order/Fock (c*c')^n/n=3 |
726.5644171779142 ns |
869 ns |
0.84 |
Normal Order/Fock (c*c')^n/n=4 |
997.7777777777778 ns |
1154.2 ns |
0.86 |
Normal Order/Fock (c*c')^n/n=5 |
1326.1 ns |
1539.9 ns |
0.86 |
Normal Order/Ground state/3-level rewrite |
652.5204678362574 ns |
818.7183098591549 ns |
0.80 |
Normal Order/Multi-mode/2-mode 6-op chain |
817.6518518518518 ns |
957.578947368421 ns |
0.85 |
Simplify/Jaynes-Cummings/H |
845.0727272727273 ns |
1057 ns |
0.80 |
Simplify/Jaynes-Cummings/H² |
1788.3 ns |
2381.1111111111113 ns |
0.75 |
Simplify/Two cavities/H |
876.0333333333333 ns |
1083.1 ns |
0.81 |
Simplify/Two cavities/H² |
3521.25 ns |
4564.285714285715 ns |
0.77 |
Simplify/Λ-system/H |
998.6 ns |
1350.5 ns |
0.74 |
Simplify/Λ-system/H² |
1709.4 ns |
2286.5555555555557 ns |
0.75 |
This comment was automatically generated by workflow using github-action-benchmark.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Docs preview: https://qojulia.github.io/SecondQuantizedAlgebra.jl/previews/PR163/comparison/
Adds a cross-package benchmark suite and a "Comparison with other packages" docs page that pit SecondQuantizedAlgebra.jl (SQA) against four other symbolic second-quantized algebra packages, across three languages: QuantumAlgebra.jl, SymPy (
sympy.physics.quantum), OpenFermion, and sneg (Mathematica).Fairness contract
Every row times each package producing the same canonical (normal-ordered) result from the same physical input, written idiomatically in that package.
*, so the operation itself is timed. Lazy packages (QuantumAlgebra, SymPy, OpenFermion) are timed through their normalization call.a a† = 1 + a†a,a a a† = a†a a + 2a, two-level completeness). A failing check aborts that package's run. Any single trial over 3 s is reported as capped.timeit/ MathematicaRepeatedTiming). The Julia-vs-Julia column is precise.Results
Single Linux workstation, 2026-07-17: SQA 0.9.0 and QuantumAlgebra 1.6.0 on Julia 1.12.6, SymPy 1.14.0 and OpenFermion 1.8.1 on Python 3.14.6, sneg 2.0.21 on Mathematica 14.2. The SQA column is absolute time; every other cell shows that package's time with its ratio to SQA in parentheses.
n/ameans the scenario is not expressible in that package.