Skip to content

R-only QR and LQ decompositions - #316

Merged
kshyatt merged 11 commits into
mainfrom
r-only-qr
Oct 30, 2026
Merged

kshyatt merged 11 commits into
mainfrom
r-only-qr

Conversation

@Yue-Zhengyuan

Copy link
Copy Markdown
Member

This PR allows an empty Q output in left_orth! and right_orth! to skip constructing the orthogonal basis, enabling R/L-only computation, using preallocated R/L outputs:

_, R = left_orth!(A, (similar(A, 0, 0), R))
L, _ = right_orth!(A, (L, similar(A, 0, 0)))

There are some renaming of internal helper functions for consistency:

Previous name New name
_diagonal_qr! _qr_diagonal!
_diagonal_qr_null! _qr_null_diagonal!
lq_diagonal! _lq_diagonal!
lq_null_diagonal! _lq_null_diagonal!

Closes #109. I expect this to eventually offer much boost in PEPSKit simple update for gates beyond nearest neighbor ones.

Comment thread src/common/gauge.jl Outdated
@Yue-Zhengyuan Yue-Zhengyuan mentioned this pull request Oct 29, 2026
Comment thread src/implementations/lq.jl Outdated
Comment thread src/implementations/qr.jl Outdated
Comment thread src/interface/lq.jl
Comment thread src/pushforwards/lq.jl
Comment thread test/decompositions/orth_factors.jl Outdated
Comment thread src/interface/orthnull.jl Outdated
Comment thread src/interface/orthnull.jl Outdated
Comment thread test/testsuite/decompositions/orth_factors.jl Outdated
@Yue-Zhengyuan
Yue-Zhengyuan requested a review from lkdvos October 29, 2026 22:23
@Yue-Zhengyuan

Copy link
Copy Markdown
Member Author

There seem to be very few changes needed in TensorKit except extra tests. I'll make a PR there soon.

@lkdvos

lkdvos commented Oct 29, 2026

Copy link
Copy Markdown
Member

Note that you first need another patch release here for that to be picked up

@lkdvos
lkdvos enabled auto-merge (squash) October 29, 2026 23:38
@kshyatt

kshyatt commented Oct 30, 2026

Copy link
Copy Markdown
Member

ROCm test queue is super backed up again, I might just force-merge this

@kshyatt
kshyatt disabled auto-merge October 30, 2026 08:00
@kshyatt
kshyatt merged commit 4b8c22e into main Oct 30, 2026
19 of 20 checks passed
@kshyatt
kshyatt deleted the r-only-qr branch October 30, 2026 08:00
@codecov

codecov Bot commented Oct 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
ext/MatrixAlgebraKitGenericLinearAlgebraExt.jl 97.95% <100.00%> (+3.72%) ⬆️
src/common/gauge.jl 98.30% <100.00%> (+0.05%) ⬆️
src/implementations/lq.jl 98.28% <100.00%> (-0.05%) ⬇️
src/implementations/qr.jl 97.76% <100.00%> (+0.01%) ⬆️
src/interface/lq.jl 62.50% <ø> (ø)
src/interface/orthnull.jl 64.10% <ø> (ø)
src/interface/qr.jl 62.50% <ø> (ø)
src/pullbacks/lq.jl 99.00% <100.00%> (+0.01%) ⬆️
src/pullbacks/qr.jl 99.00% <100.00%> (+0.01%) ⬆️
src/pushforwards/lq.jl 100.00% <100.00%> (ø)
... and 1 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

[Feature Request] left_orth and right_orth without calculating Q

3 participants