Skip to content

Conversation

@lkdvos
Copy link
Member

@lkdvos lkdvos commented Dec 16, 2025

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
Copy link

codecov bot commented Dec 16, 2025

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 lkdvos requested a review from kshyatt December 16, 2025 12:24
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
Member

Choose a reason for hiding this comment

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

🎉 🎉 🎉

kshyatt
kshyatt previously approved these changes Dec 16, 2025
Copy link
Member

@kshyatt kshyatt left a comment

Choose a reason for hiding this comment

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

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

lkdvos and others added 3 commits December 16, 2025 17:35
Jutho
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 lkdvos merged commit 152ea71 into main Dec 17, 2025
29 of 30 checks passed
@lkdvos lkdvos deleted the ld-diag branch December 17, 2025 03:21
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.

4 participants