-
Notifications
You must be signed in to change notification settings - Fork 56
Avoid copy in twist for tensors with bosonic braiding
#305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
|
This feels like a pretty big breaking change and I'm a little scared of this introducing silent and subtle bugs. In principle, for the other "indexmanipulations" we have a The fastest way forward for tousle specific case is probably to just special case it in the reverse rules, which is in line with the forward rules special case. However, I think it would be nicest in the long run to just additionally include the keyword as a breaking change, and then possibly simplify the use in the contractions, with the next 0.16 release. I don't know what you think @Jutho ? |
|
We are anyway making breaking changes, I assume this one is quite innocent, so if it is bundled in a breaking release and listed as such, I do not see why we could not introduce the |
|
Does anyone understand how this change causes the autodiff tests to fail? |
|
I am actually guessing it's an RNG thing, it looks like these tests are still a bit brittle :( |
cf26d31 to
b489de7
Compare
* 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>
When profiling some AD-based optimizations, I noticed the
twists that occur in therrules of the tensor operations show up quite prominently sometimes. This was caused by the fact that by defaulttwistcopies its input before callingtwist!, even for tensors with bosonic braiding for whichtwist!does nothing in the end.Here I just added the check for trivial twists from
twist!totwistto avoid a copy for trivial twists. I don't know if anything really relies on the fact thattwistmakes a copy though. If this is the case, maybe there's a different way to handle trivial twists in the tensor operations pullbacks themselves?