-
Notifications
You must be signed in to change notification settings - Fork 5
bug(itensorlike): linsolve() broken — missing IndexMapping to treetn solver #351
Copy link
Copy link
Open
Description
Summary
tensor4all_itensorlike::linsolve() is non-functional. All calls fail with index structure mismatch errors.
Root Cause
The high-level linsolve() wrapper calls treetn's square_linsolve() without passing IndexMapping objects. The treetn solver requires these mappings to know how MPO input/output indices correspond to MPS site indices. Without them, the MPO's output indices remain after contraction as new indices that don't match the MPS site indices.
Error Examples
- Identity operator solve:
"Index count mismatch: self has 3 indices, other has 4" - Shifted identity:
"index structure mismatch between operator output (hx) and input (x)"
Workaround
Use the treetn-level API directly with SquareLinsolveUpdater::with_index_mappings().
Suggested Fix
Either:
- Accept
IndexMappinginLinsolveOptionsand pass it through, or - Auto-infer the mapping from shared DynIndex IDs between MPO and MPS
Also add integration tests for linsolve at the itensorlike level (currently none exist).
Found by
Automated feature test (test-feature-20260327-itensorlike)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels