Skip to content

Delegate named flux constructors to the GradedArrays backend - #232

Merged
mtfishman merged 1 commit into
mainfrom
mf/flux-delegate-gradedarrays
Jul 27, 2026
Merged

Delegate named flux constructors to the GradedArrays backend#232
mtfishman merged 1 commit into
mainfrom
mf/flux-delegate-gradedarrays

Conversation

@mtfishman

@mtfishman mtfishman commented Jul 27, 2026

Copy link
Copy Markdown
Member

Summary

Reworks the named flux-canceling constructors (rand/randn/zeros/ones/fill with a leading sector) in the GradedArrays extension to delegate to the GradedArrays flux constructors on the unnamed axes and then reattach names, rather than minting the auxiliary Index and routing through the split constructor. The flux convention (append a multiplicity-1 leg carrying the charge to the dualized domain) now lives in one place, the GradedArrays backend, and the extension only strips names, calls the backend, and names the result, matching how the other named constructors are layered.

Two fixes fall out of the rework. The empty-codomain form f(flux, (), domain) is now supported alongside the existing nonempty-codomain forms, since it delegates to the corresponding GradedArrays flux method (added in ITensor/GradedArrays.jl#224). And the auxiliary leg's name type is now derived from the physical legs rather than hardcoded to IndexName, so the constructors work for any NamedUnitRange name type. The flux-only form (no codomain and no domain) is deliberately left to the backend, since a named method with no axis argument would be type piracy.

Builds on ITensor/GradedArrays.jl#224 for the bare-TensorKitSectors.Sector flux and the empty-codomain flux methods.

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.60976% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.66%. Comparing base (c9144f8) to head (ca43914).

Files with missing lines Patch % Lines
ext/ITensorBaseGradedArraysExt.jl 75.60% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #232      +/-   ##
==========================================
- Coverage   78.15%   77.66%   -0.49%     
==========================================
  Files          30       30              
  Lines        1744     1782      +38     
==========================================
+ Hits         1363     1384      +21     
- Misses        381      398      +17     
Flag Coverage Δ
docs 26.37% <0.00%> (-0.59%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@mtfishman
mtfishman force-pushed the mf/flux-delegate-gradedarrays branch 2 times, most recently from 7b6b3fb to 497efc2 Compare July 27, 2026 21:00
Rework the named flux-canceling constructors in the GradedArrays extension
to delegate to the GradedArrays flux constructors on the unnamed axes and
reattach names, rather than minting the auxiliary Index and routing through
the split constructor. The flux convention now lives only in the backend.

Adds the empty-codomain form f(flux, (), domain), and derives the auxiliary
leg's name type from the physical legs instead of hardcoding IndexName.

Builds on ITensor/GradedArrays.jl#224.
@mtfishman
mtfishman force-pushed the mf/flux-delegate-gradedarrays branch from 497efc2 to ca43914 Compare July 27, 2026 21:07
@mtfishman mtfishman changed the title [WIP] Delegate named flux constructors to the GradedArrays backend Delegate named flux constructors to the GradedArrays backend Jul 27, 2026
@mtfishman
mtfishman marked this pull request as ready for review July 27, 2026 21:08
@mtfishman
mtfishman enabled auto-merge (squash) July 27, 2026 21:08
@mtfishman
mtfishman merged commit edf6f95 into main Jul 27, 2026
23 of 28 checks passed
@mtfishman
mtfishman deleted the mf/flux-delegate-gradedarrays branch July 27, 2026 21:30
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.

1 participant