Skip to content

feat: backend agnostic numerical conversion#200

Merged
oameye merged 8 commits into
mainfrom
backend-agnostic-numerical-conversion
Jul 20, 2026
Merged

feat: backend agnostic numerical conversion#200
oameye merged 8 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: 9ca58bd Previous: 3b4b786 Ratio
Accumulation/Many-mode H/foldl M=16 11907 ns 10639 ns 1.12
Accumulation/Many-mode H/foldl M=24 26990 ns 24345 ns 1.11
Accumulation/Many-mode H/foldl M=8 2955.625 ns 2727.3333333333335 ns 1.08
Accumulation/Many-mode H/sum M=16 1902.888888888889 ns 1704.1 ns 1.12
Accumulation/Many-mode H/sum M=24 2629.4444444444443 ns 2265.222222222222 ns 1.16
Accumulation/Many-mode H/sum M=8 762.5825242718447 ns 708.1363636363636 ns 1.08
Accumulation/Same-site/foldl 6489.6 ns 6313.6 ns 1.03
Accumulation/Same-site/sum 2212.222222222222 ns 2259.777777777778 ns 0.98
Commutator/Nested JC/depth=1 1779.6 ns 1683.2 ns 1.06
Commutator/Nested JC/depth=2 17666 ns 18324 ns 0.96
Commutator/Nested JC/depth=3 64074 ns 67676 ns 0.95
Commutator/Nested JC/depth=4 161359 ns 170367 ns 0.95
Commutator/Nested JC/depth=5 354515 ns 376862 ns 0.94
Commutator/Schrieffer-Wolff/[S, V] 184033 ns 205001 ns 0.90
Commutator/Schrieffer-Wolff/[S, [S, H0]] 337269 ns 383264 ns 0.88
Indexing/Diagonal collapse/[H_Dicke, S_j] 43995 ns 42960 ns 1.02
Indexing/Diagonal collapse/[H_JC, σ_j] 57936 ns 62306 ns 0.93
Indexing/Simplify/double-sum spin-spin 14442 ns 16832 ns 0.86
Indexing/Simplify/indexed JC H 1275.8 ns 1177.2 ns 1.08
Indexing/Sum construction/double Σ_ij(J_ij*S_i*S_j) 8052 ns 8696.333333333334 ns 0.93
Indexing/Sum construction/single Σ_i(σ_i*σ_j) 9985 ns 11411 ns 0.88
Normal Order/Fock (c*c')^n/n=2 673.0059171597633 ns 613.4715909090909 ns 1.10
Normal Order/Fock (c*c')^n/n=3 950.4 ns 882.5813953488372 ns 1.08
Normal Order/Fock (c*c')^n/n=4 1274.9 ns 1172.1 ns 1.09
Normal Order/Fock (c*c')^n/n=5 1707.6 ns 1570.9 ns 1.09
Normal Order/Ground state/3-level rewrite 862.6363636363636 ns 823.7402597402597 ns 1.05
Normal Order/Multi-mode/2-mode 6-op chain 1059.5 ns 962.7 ns 1.10
Simplify/Jaynes-Cummings/H 1173.7 ns 1091 ns 1.08
Simplify/Jaynes-Cummings/H² 2705.1111111111113 ns 2466.8888888888887 ns 1.10
Simplify/Two cavities/H 1226.8 ns 1139.1 ns 1.08
Simplify/Two cavities/H² 5089.166666666667 ns 4554.285714285715 ns 1.12
Simplify/Λ-system/H 1492.2 ns 1384.6 ns 1.08
Simplify/Λ-system/H² 2568.222222222222 ns 2375.5555555555557 ns 1.08

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 95.51971% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.10%. Comparing base (3b4b786) to head (9ca58bd).

Files with missing lines Patch % Lines
ext/SecondQuantizedAlgebraQuantumToolboxExt.jl 86.15% 18 Missing ⚠️
ext/SecondQuantizedAlgebraQuantumOpticsBaseExt.jl 96.00% 3 Missing ⚠️
src/numeric/api.jl 93.61% 3 Missing ⚠️
src/numeric/backend.jl 94.73% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #200      +/-   ##
==========================================
+ Coverage   94.57%   95.10%   +0.52%     
==========================================
  Files          27       33       +6     
  Lines        3024     3185     +161     
==========================================
+ Hits         2860     3029     +169     
+ Misses        164      156       -8     

☔ 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.

@oameye
oameye merged commit 5a37827 into main Jul 20, 2026
13 checks passed
@oameye
oameye deleted the backend-agnostic-numerical-conversion branch July 20, 2026 17:59
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