Skip to content

Conversation

@lkdvos
Copy link
Member

@lkdvos lkdvos commented Nov 5, 2025

This removes one of the TODOs by bringing the contract! interface more in line with the TensorOperations functionality, which allows us to now use the backend and allocator functionality a bit more fully.

Additionally, I slightly reworked the logic of surrounding twist to avoid some more allocations in some edge cases where we didn't have to permute A, but we did have to twist it.

This is a partial reimplementation of some of the logic in #203 but I kept this PR way more minimal and less opinionated, to already get this merged and then simplify actually looking at the multithreading afterwards.

One other thing I noticed is that our memcost checking could use some improvements still: we will never simplify the following case for example, which actually could be implemented as a simple mul! call.

pA = ((3, 2, 1), (4,))
pB = ((1,), (2,))
pAB = ((3, 2, 1), (4,))

This however is somewhat related to the planar reorderings that we are doing anyways, so it might actually pay off to at some point (in a separate PR!) have a look at this.

@lkdvos lkdvos requested a review from Jutho November 5, 2025 18:56
@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/tensors/tensoroperations.jl 97.84% <100.00%> (+0.75%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lkdvos lkdvos force-pushed the ld-tensoroperations branch from 9c55363 to a2a6913 Compare November 5, 2025 20:17
@lkdvos lkdvos enabled auto-merge (squash) November 5, 2025 23:57
Jutho
Jutho previously approved these changes Nov 15, 2025
Copy link
Member

@Jutho Jutho left a comment

Choose a reason for hiding this comment

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

Very nice; I think there is one typo/mistake, but otherwise this is indeed a great and long overdue change. Tanks for tackling this.

@lkdvos lkdvos force-pushed the ld-tensoroperations branch from 6c54aae to bb4b7ef Compare November 15, 2025 12:33
@lkdvos lkdvos disabled auto-merge November 15, 2025 13:34
@lkdvos lkdvos merged commit 38f8798 into main Nov 15, 2025
30 checks passed
@lkdvos lkdvos deleted the ld-tensoroperations branch November 15, 2025 13:35
Jutho referenced this pull request Dec 9, 2025
* initial basic design SectorVector

* some additional functionality

* relax `foreachblock` signature

* replace `SectorDict` with `SectorVector` for eig/svdvals

* export `svd_vals`

* clean up SectorVector design

* small fix

* add finitedifferences support

* update changelog

* some simplifications and extensions

* some further fixes

* some more fixes

* update dates

---------

Co-authored-by: Jutho Haegeman <jutho.haegeman@ugent.be>
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