Skip to content

Add outputinds/inputinds and outputaxes/inputaxes accessors - #233

Merged
mtfishman merged 1 commit into
mainfrom
mf/output-input-inds
Jul 28, 2026
Merged

Add outputinds/inputinds and outputaxes/inputaxes accessors#233
mtfishman merged 1 commit into
mainfrom
mf/output-input-inds

Conversation

@mtfishman

@mtfishman mtfishman commented Jul 28, 2026

Copy link
Copy Markdown
Member

Summary

Adds outputinds/inputinds and outputaxes/inputaxes, the Index-returning accessors for an operator's codomain and domain spaces (the output space it maps onto and the input space of states it acts on). The inds forms return a Vector and the axes forms a Tuple, mirroring how inds and axes relate for a tensor. The Tuple forms feed directly into constructors like id, randn, and project that take a (codomain, domain) pair of index tuples. The input accessors return the non-dual domain, matching the convention of TensorKit's domain: the conjugate of the input legs as they appear fused in inds, which carry the dual, so a * randn(inputaxes(a)) contracts and id(eltype(a), outputaxes(a), inputaxes(a)) rebuilds an operator of the same shape. A plain tensor is a trivial operator with no pairing, so all four are empty.

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.72%. Comparing base (edf6f95) to head (3b45ab6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #233      +/-   ##
==========================================
+ Coverage   77.66%   77.72%   +0.06%     
==========================================
  Files          30       30              
  Lines        1782     1787       +5     
==========================================
+ Hits         1384     1389       +5     
  Misses        398      398              
Flag Coverage Δ
docs 26.60% <40.00%> (+0.22%) ⬆️

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/output-input-inds branch from 9ff7bad to 2c2c7c5 Compare July 28, 2026 00:40
Adds `outputinds`/`inputinds` and `outputaxes`/`inputaxes`, the `Index`-returning accessors for an operator's codomain and domain spaces (the output space it maps onto and the input space of states it acts on). The `inds` forms return a `Vector` and the `axes` forms a `Tuple`, mirroring how `inds` and `axes` relate for a tensor. The `Tuple` forms feed directly into constructors like `id`, `randn`, and `project` that take a `(codomain, domain)` pair of index tuples. The input accessors return the non-dual domain, matching the convention of TensorKit's `domain`: the conjugate of the input legs as they appear fused in `inds`, which carry the dual, so `a * randn(inputaxes(a))` contracts and `id(eltype(a), outputaxes(a), inputaxes(a))` rebuilds an operator of the same shape. A plain tensor is a trivial operator with no pairing, so all four are empty.
@mtfishman mtfishman changed the title Add outputinds and inputinds accessors Add outputinds/inputinds and outputaxes/inputaxes accessors Jul 28, 2026
@mtfishman
mtfishman force-pushed the mf/output-input-inds branch from 2c2c7c5 to 3b45ab6 Compare July 28, 2026 01:01
@mtfishman
mtfishman enabled auto-merge (squash) July 28, 2026 01:05
@mtfishman
mtfishman merged commit 13f6336 into main Jul 28, 2026
18 checks passed
@mtfishman
mtfishman deleted the mf/output-input-inds branch July 28, 2026 01:23
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