Skip to content

Add left_orth!/left_orth, replace internal _truncate_edge#366

Merged
mtfishman merged 2 commits into
mainfrom
mf/left-orth-rename
May 12, 2026
Merged

Add left_orth!/left_orth, replace internal _truncate_edge#366
mtfishman merged 2 commits into
mainfrom
mf/left-orth-rename

Conversation

@mtfishman
Copy link
Copy Markdown
Member

@mtfishman mtfishman commented May 12, 2026

Summary

  • Promote the internal _truncate_edge(tn, edge; kwargs...) to a properly-named public pair: left_orth!(tn, edge; kwargs...) (mutating SVD-based left-orthogonalization, kwargs forwarded to ITensors.svd so cutoff / maxdim / mindim truncate in addition to gauging) and left_orth(tn, edge; kwargs...) (non-mutating wrapper). Both accept an AbstractEdge or a Pair of vertices.
  • Base.truncate(tn, edge; kwargs...) now delegates to left_orthtruncate stays as the user-facing compression verb, left_orth names the underlying gauge transformation.
  • LinearAlgebra.qr!(tn, edge) is unchanged: it remains the non-truncating verb. Callers who want truncation reach for left_orth! / truncate.

The internal _truncate_edge(tn, edge; kwargs...) did an SVD-based
left-orthogonal factorization with optional truncation. Promote it to
a properly-named public pair:

- left_orth!(tn, edge; kwargs...) — mutating SVD-based
  left-orthogonalization. Keyword args forward to ITensors.svd, so
  passing cutoff / maxdim / mindim truncates the bond in addition to
  gauging it.
- left_orth(tn, edge; kwargs...) — non-mutating wrapper.

Both accept an AbstractEdge or a Pair of vertices. Base.truncate
delegates to left_orth — truncate stays as the user-facing
compression verb. qr!(tn, edge) is unchanged: it remains the
non-truncating verb, and callers who want truncation reach for
left_orth! / truncate.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mtfishman mtfishman enabled auto-merge (squash) May 12, 2026 19:57
Add Documenter `@docs` blocks for `ITensorNetworks.left_orth` /
`left_orth!` in `itensor_networks.md` (so the cross-references in the
`truncate` docstring resolve), and list both forms in
`interface_methods.md`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

❌ Patch coverage is 50.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.39%. Comparing base (22d5d62) to head (138b054).

Files with missing lines Patch % Lines
src/abstractitensornetwork.jl 50.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #366      +/-   ##
==========================================
- Coverage   76.50%   76.39%   -0.11%     
==========================================
  Files          57       57              
  Lines        2639     2644       +5     
==========================================
+ Hits         2019     2020       +1     
- Misses        620      624       +4     
Flag Coverage Δ
docs 52.16% <50.00%> (-0.07%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 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 merged commit efcc7fa into main May 12, 2026
16 of 18 checks passed
@mtfishman mtfishman deleted the mf/left-orth-rename branch May 12, 2026 20:25
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