Skip to content

Allow BraidingTensor to have a custom storage type#393

Merged
kshyatt merged 10 commits intomainfrom
ksh/cubt
Apr 24, 2026
Merged

Allow BraidingTensor to have a custom storage type#393
kshyatt merged 10 commits intomainfrom
ksh/cubt

Conversation

@kshyatt
Copy link
Copy Markdown
Member

@kshyatt kshyatt commented Apr 3, 2026

This is probably the nicest way to unblock the various MPSKit changes. I found the similarmatrixtype approach the least gross looking way to achieve this, but open to other ideas.

@kshyatt kshyatt requested review from Jutho and borisdevos April 3, 2026 09:27
@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Apr 6, 2026

The only thing missing here is the parser preprocessing for @planar, where we need to extract the storagetype to hand it over to the BraidingTensor constructor.

@Jutho
Copy link
Copy Markdown
Member

Jutho commented Apr 7, 2026

I will try to review asap, but I first have to catch up on the latest status of the treetransform stuff, as I never managed to review that part of the vectorize fusiontrees PR.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 14, 2026

Codecov Report

❌ Patch coverage is 91.66667% with 7 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/tensors/braidingtensor.jl 88.00% 6 Missing ⚠️
src/planar/preprocessors.jl 95.65% 1 Missing ⚠️
Files with missing lines Coverage Δ
ext/TensorKitAdaptExt.jl 61.53% <100.00%> (+11.53%) ⬆️
ext/TensorKitCUDAExt/TensorKitCUDAExt.jl 100.00% <100.00%> (ø)
ext/TensorKitCUDAExt/cutensormap.jl 74.66% <100.00%> (+0.69%) ⬆️
src/planar/preprocessors.jl 87.52% <95.65%> (+0.44%) ⬆️
src/tensors/braidingtensor.jl 70.39% <88.00%> (+0.91%) ⬆️

... and 3 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl
@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Apr 15, 2026

Anything more need doing here or is this ready to go after #389?

@kshyatt kshyatt marked this pull request as ready for review April 15, 2026 13:09
Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread test/cuda/planar.jl Outdated
Comment thread Project.toml Outdated
Comment thread ext/TensorKitCUDAExt/cutensormap.jl
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

Your PR no longer requires formatting changes. Thank you for your contribution!

@kshyatt kshyatt force-pushed the ksh/cubt branch 2 times, most recently from f787d47 to e7361df Compare April 17, 2026 10:02
Copy link
Copy Markdown
Member

@lkdvos lkdvos left a comment

Choose a reason for hiding this comment

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

I guess the main thing missing is still the @planar changes... I will try to find some time, but I seem to be having a million things 🙃

Comment thread ext/TensorKitCUDAExt/cutensormap.jl
Comment thread ext/TensorKitCUDAExt/TensorKitCUDAExt.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Apr 17, 2026

I'll work on the preprocessor, don't worry about it! But my solution might be a bit ugly...

Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Apr 20, 2026

OK, a lot of comments resolved (hopefully!)

@kshyatt kshyatt marked this pull request as draft April 20, 2026 12:41
@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Apr 20, 2026

CUDA test fail here seems unrelated, I'm running locally to see if I can repro

@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Apr 20, 2026

Aaaaaand I can't repro locally!

Comment thread ext/TensorKitAdaptExt.jl Outdated
@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Apr 22, 2026

Sure, makes sense to me. I'm just completely wowed by this bug if it's real, it's so silly

Comment thread src/tensors/braidingtensor.jl
Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
Comment thread src/tensors/braidingtensor.jl Outdated
@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Apr 24, 2026

I've run the MPSKit tests that aren't already failing on QuantumKitHub/MPSKit.jl#416 against this branch, everything but Aqua passes. I'm running the algorithms tests in detail just to make sure as I suspect that's where any problem would surface.

@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Apr 24, 2026

Figured out one last MPSKit failure that was related -- an extension of braidingtensortype is needed at BlockTensorKit.jl, I'll make that PR once this is merged

Comment thread src/tensors/braidingtensor.jl Outdated
@Jutho
Copy link
Copy Markdown
Member

Jutho commented Apr 24, 2026

One final suggestion from my side, but this definitely looks great, so feel free to merge with or without that.

kshyatt and others added 9 commits April 24, 2026 16:14
Co-authored-by: Jutho <Jutho@users.noreply.github.com>
Co-authored-by: Lukas Devos <ldevos98@gmail.com>
Co-authored-by: Lukas Devos <ldevos98@gmail.com>
Co-authored-by: Jutho <Jutho@users.noreply.github.com>
Copy link
Copy Markdown
Member

@lkdvos lkdvos left a comment

Choose a reason for hiding this comment

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

Looks good to me too, could you already increase the version to 0.17? Since this is breaking, we will have to do that anyways, so might as well and then start adding the other breaking stuff in too (CUDA etc)

bump minor version
@kshyatt
Copy link
Copy Markdown
Member Author

kshyatt commented Apr 24, 2026

Done! They're calling it the end of Friday snipe commit of the century

@kshyatt kshyatt enabled auto-merge (squash) April 24, 2026 14:28
@kshyatt kshyatt merged commit 518cb2a into main Apr 24, 2026
61 of 62 checks passed
@kshyatt kshyatt deleted the ksh/cubt branch April 24, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants