Add left_orth!/left_orth, replace internal _truncate_edge#366
Merged
Conversation
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>
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 Report❌ Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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
_truncate_edge(tn, edge; kwargs...)to a properly-named public pair:left_orth!(tn, edge; kwargs...)(mutating SVD-based left-orthogonalization, kwargs forwarded toITensors.svdsocutoff/maxdim/mindimtruncate in addition to gauging) andleft_orth(tn, edge; kwargs...)(non-mutating wrapper). Both accept anAbstractEdgeor aPairof vertices.Base.truncate(tn, edge; kwargs...)now delegates toleft_orth—truncatestays as the user-facing compression verb,left_orthnames the underlying gauge transformation.LinearAlgebra.qr!(tn, edge)is unchanged: it remains the non-truncating verb. Callers who want truncation reach forleft_orth!/truncate.