Skip to content

Compare ITensors by dimension name with eager alignment#181

Merged
mtfishman merged 1 commit into
mainfrom
mf/eager-align-comparisons
Jun 22, 2026
Merged

Compare ITensors by dimension name with eager alignment#181
mtfishman merged 1 commit into
mainfrom
mf/eager-align-comparisons

Conversation

@mtfishman

@mtfishman mtfishman commented Jun 22, 2026

Copy link
Copy Markdown
Member

Summary

Compares AbstractITensors by aligning the second argument eagerly with dename rather than through a lazy permuted view. Reducing over a lazy permuted view scalar-indexes the underlying array, which graded arrays forbid, so ==, isequal, and isapprox errored on graded ITensors whose dimensions were stored in a different order. Aligning eagerly materializes the permutation first.

These methods and eachindex now compare dimension names (dimnames) rather than the full named axes (inds), so they agree on identity by name without requiring the axis objects themselves to match.

@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.75%. Comparing base (32c2f3d) to head (1ef3493).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #181   +/-   ##
=======================================
  Coverage   74.75%   74.75%           
=======================================
  Files          20       20           
  Lines        1105     1105           
=======================================
  Hits          826      826           
  Misses        279      279           
Flag Coverage Δ
docs 20.80% <28.57%> (-0.47%) ⬇️

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/eager-align-comparisons branch from 24284a5 to 1ef3493 Compare June 22, 2026 15:43
@mtfishman mtfishman changed the title [WIP] Compare ITensors by dimension name with eager alignment Compare ITensors by dimension name with eager alignment Jun 22, 2026
@mtfishman mtfishman marked this pull request as ready for review June 22, 2026 17:08
@mtfishman mtfishman enabled auto-merge (squash) June 22, 2026 17:08
@mtfishman mtfishman merged commit 2a23859 into main Jun 22, 2026
28 checks passed
@mtfishman mtfishman deleted the mf/eager-align-comparisons branch June 22, 2026 17:26
mtfishman added a commit to ITensor/ITensorNetworksNext.jl that referenced this pull request Jun 22, 2026
## Summary

Migrates ITensorNetworksNext to ITensorBase v0.6, which replaces the
named-array core with the new `AbstractITensor{DimName}` model. Tensor
network vertices hold `ITensor`s built on that model across the
contraction, belief-propagation, and operator-application layers. This
requires ITensorBase 0.6.2
(ITensor/ITensorBase.jl#181) for name-based
comparison of graded tensors and TensorAlgebra 0.9.7
(ITensor/TensorAlgebra.jl#179) for contraction
labels that keep their element type.

The lazy expression layer is renamed from `LazyNamedDimsArrays` to
`LazyITensors`, and its symbolic leaf is reworked into a
`SymbolicITensor` that builds lazy products directly and carries named
structure with no array payload. The delta-tensor generators no longer
depend on DiagonalArrays: a dense `diagonaltensor`/`delta` helper places
values on the hyperdiagonal over either plain or named axes.

Relocating the lazy and symbolic core into ITensorBase will follow in a
later PR.
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