FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Improve `Diagonal` constructors with `similar_diagonal` by lkdvos · Pull Request #330 · QuantumKitHub/TensorKit.jl · GitHub

Improve Diagonal constructors with similar_diagonal - #330

Merged
lkdvos merged 9 commits into
mainfrom
ld-diag
Dec 17, 2025
Merged

lkdvos merged 9 commits into
mainfrom
ld-diag

Conversation

lkdvos commented Dec 16, 2025

Copy link
Copy Markdown
Member

This PR adds the (unexported for now?) similar_diagonal function which acts like similar but instead returns a DiagonalTensorMap.
The main point is to facilitate GPU support by correctly taking into account the storage types of the provided input tensor.

codecov Bot commented Dec 16, 2025 •
edited
Loading

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.00000% with 9 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/tensors/abstracttensor.jl 56.25% 7 Missing ⚠️
src/factorizations/matrixalgebrakit.jl 77.77% 2 Missing ⚠️
Files with missing lines Coverage Δ
src/factorizations/diagonal.jl 64.10% <100.00%> (ø)
src/factorizations/factorizations.jl 94.11% <ø> (ø)
src/factorizations/truncation.jl 87.93% <100.00%> (ø)
src/tensors/diagonal.jl 92.17% <100.00%> (+0.04%) ⬆️
src/tensors/sectorvector.jl 43.54% <100.00%> (+3.89%) ⬆️
src/factorizations/matrixalgebrakit.jl 92.07% <77.77%> (-0.86%) ⬇️
src/tensors/abstracttensor.jl 57.01% <56.25%> (-0.06%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

lkdvos requested a review from kshyatt December 16, 2025 12:24
Comment thread src/factorizations/diagonal.jl Outdated
V_dom = fuse(domain(t))
U = similar(t, codomain(t) ← V_cod)
S = DiagonalTensorMap{real(scalartype(t))}(undef, V_cod ← V_dom)
S = similar_diagonal(t, real(scalartype(t)), V_cod ← V_dom)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

🎉 🎉 🎉

kshyatt previously approved these changes Dec 16, 2025

kshyatt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

OK, I think this will really simplify things for the GPU support. Thanks very much for doing this!

Comment thread src/tensors/abstracttensor.jl Outdated
Comment thread src/tensors/abstracttensor.jl Outdated
lkdvos and others added 3 commits December 16, 2025 17:35
Comment thread src/tensors/abstracttensor.jl Outdated
Jutho previously approved these changes Dec 16, 2025
lkdvos and others added 2 commits December 16, 2025 20:14
Co-authored-by: Jutho <Jutho@users.noreply.github.com>
lkdvos merged commit 152ea71 into main Dec 17, 2025
29 of 30 checks passed
lkdvos deleted the ld-diag branch December 17, 2025 03:21
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL