Skip to content

feat: backend agnostic numerical conversion#200

Open
oameye wants to merge 7 commits into
mainfrom
backend-agnostic-numerical-conversion
Open

feat: backend agnostic numerical conversion#200
oameye wants to merge 7 commits into
mainfrom
backend-agnostic-numerical-conversion

Conversation

@oameye

@oameye oameye commented Jun 29, 2026

Copy link
Copy Markdown
Member

resolves #154

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Benchmark Results

Details
Benchmark suite Current: 62a66e0 Previous: 3b4b786 Ratio
Accumulation/Many-mode H/foldl M=16 10900 ns 10639 ns 1.02
Accumulation/Many-mode H/foldl M=24 24085 ns 24345 ns 0.99
Accumulation/Many-mode H/foldl M=8 2823.1111111111113 ns 2727.3333333333335 ns 1.04
Accumulation/Many-mode H/sum M=16 1694.2 ns 1704.1 ns 0.99
Accumulation/Many-mode H/sum M=24 2298.6666666666665 ns 2265.222222222222 ns 1.01
Accumulation/Many-mode H/sum M=8 710.3458646616541 ns 708.1363636363636 ns 1.00
Accumulation/Same-site/foldl 6163.6 ns 6313.6 ns 0.98
Accumulation/Same-site/sum 2170.777777777778 ns 2259.777777777778 ns 0.96
Commutator/Nested JC/depth=1 1681.2 ns 1683.2 ns 1.00
Commutator/Nested JC/depth=2 18765 ns 18324 ns 1.02
Commutator/Nested JC/depth=3 68207 ns 67676 ns 1.01
Commutator/Nested JC/depth=4 170137 ns 170367 ns 1.00
Commutator/Nested JC/depth=5 378346 ns 376862 ns 1.00
Commutator/Schrieffer-Wolff/[S, V] 203229 ns 205001 ns 0.99
Commutator/Schrieffer-Wolff/[S, [S, H0]] 373087 ns 383264 ns 0.97
Indexing/Diagonal collapse/[H_Dicke, S_j] 43030 ns 42960 ns 1.00
Indexing/Diagonal collapse/[H_JC, σ_j] 61625 ns 62306 ns 0.99
Indexing/Simplify/double-sum spin-spin 15830 ns 16832 ns 0.94
Indexing/Simplify/indexed JC H 1507.8 ns 1177.2 ns 1.28
Indexing/Sum construction/double Σ_ij(J_ij*S_i*S_j) 8379 ns 8696.333333333334 ns 0.96
Indexing/Sum construction/single Σ_i(σ_i*σ_j) 11913 ns 11411 ns 1.04
Normal Order/Fock (c*c')^n/n=2 602.0055248618785 ns 613.4715909090909 ns 0.98
Normal Order/Fock (c*c')^n/n=3 871.0877192982456 ns 882.5813953488372 ns 0.99
Normal Order/Fock (c*c')^n/n=4 1197.2 ns 1172.1 ns 1.02
Normal Order/Fock (c*c')^n/n=5 1582.9 ns 1570.9 ns 1.01
Normal Order/Ground state/3-level rewrite 797.8636363636364 ns 823.7402597402597 ns 0.97
Normal Order/Multi-mode/2-mode 6-op chain 977.7058823529412 ns 962.7 ns 1.02
Simplify/Jaynes-Cummings/H 1093.1 ns 1091 ns 1.00
Simplify/Jaynes-Cummings/H² 2527 ns 2466.8888888888887 ns 1.02
Simplify/Two cavities/H 1148.1 ns 1139.1 ns 1.01
Simplify/Two cavities/H² 4590.142857142857 ns 4554.285714285715 ns 1.01
Simplify/Λ-system/H 1377.5 ns 1384.6 ns 0.99
Simplify/Λ-system/H² 2356.5555555555557 ns 2375.5555555555557 ns 0.99

This comment was automatically generated by workflow using github-action-benchmark.

Bring the backend-agnostic numeric refactor up to date with main. Carry
over the op_type/sparse-default contract (#208) into the new numeric_materialize
hook (QOB sparse default; QTB keeps its solver-native lazy VecSum), port
CollectiveTransition numeric support on ManyBodyBasis (#211), and bump to 0.10.0.
@codecov

codecov Bot commented Jul 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.98208% with 28 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.94%. Comparing base (3b4b786) to head (62a66e0).

Files with missing lines Patch % Lines
ext/SecondQuantizedAlgebraQuantumToolboxExt.jl 84.61% 20 Missing ⚠️
ext/SecondQuantizedAlgebraQuantumOpticsBaseExt.jl 96.00% 3 Missing ⚠️
src/numeric/api.jl 93.61% 3 Missing ⚠️
src/numeric/backend.jl 89.47% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #200      +/-   ##
==========================================
+ Coverage   94.57%   94.94%   +0.36%     
==========================================
  Files          27       33       +6     
  Lines        3024     3185     +161     
==========================================
+ Hits         2860     3024     +164     
+ Misses        164      161       -3     

☔ View full report in Codecov by Harness.
📢 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.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Benchmark Results'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.30.

Benchmark suite Current: 823d4e5 Previous: 3b4b786 Ratio
Accumulation/Same-site/sum 3061 ns 2259.777777777778 ns 1.35

This comment was automatically generated by workflow using github-action-benchmark.

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.

Backend agnostic numeric operator conversion

1 participant