Add outputinds/inputinds and outputaxes/inputaxes accessors - #233
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
mtfishman
force-pushed
the
mf/output-input-inds
branch
from
July 28, 2026 00:40
9ff7bad to
2c2c7c5
Compare
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.
outputinds and inputinds accessorsoutputinds/inputinds and outputaxes/inputaxes accessors
mtfishman
force-pushed
the
mf/output-input-inds
branch
from
July 28, 2026 01:01
2c2c7c5 to
3b45ab6
Compare
mtfishman
enabled auto-merge (squash)
July 28, 2026 01:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
outputinds/inputindsandoutputaxes/inputaxes, theIndex-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). Theindsforms return aVectorand theaxesforms aTuple, mirroring howindsandaxesrelate for a tensor. TheTupleforms feed directly into constructors likeid,randn, andprojectthat take a(codomain, domain)pair of index tuples. The input accessors return the non-dual domain, matching the convention of TensorKit'sdomain: the conjugate of the input legs as they appear fused ininds, which carry the dual, soa * randn(inputaxes(a))contracts andid(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.