-
Notifications
You must be signed in to change notification settings - Fork 5
Pullbacks for Diagonal inputs
#156
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
base: main
Are you sure you want to change the base?
Conversation
|
FWIW there was some work done for this in the |
|
So you might be able to cannibalize part of that |
|
Ahh, thanks! let me first revisit that then :) |
|
Just grab whatever you need from there imo and I can rebase on top of this once it's merged |
Codecov Report❌ Patch coverage is
🚀 New features to boost your workflow:
|
de0c3b6 to
48fe1a9
Compare
48fe1a9 to
be7d543
Compare
| degeneracy_atol::Real = default_pullback_rank_atol(DV[1]), | ||
| gauge_atol::Real = default_pullback_gauge_atol(ΔDV[2]) | ||
| ) | ||
| ΔA_full = zero!(similar(ΔA, size(ΔA))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oof, this might become a lot of allocations for large diagonals... Is there no way for us to write a little more sophisticated rule that only computes the diagonal components of ΔA_full?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is A itself also Diagonal? In that case, I think we have ΔA = ΔD. The contribution from ΔV` should be completely off-diagonal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in these cases yes?
Ran into some issues in QuantumKitHub/TensorKit.jl#350, we are currently not testing pullbacks for$\Delta A$ , but we need an additional projection on the diagonal subspace.
Diagonalinputs, and apparently this is not working right now.The issue is that we want to in-place add to
I'm guessing similar issues would appear for other restricted input vector spaces, for now I'd be okay with this simple fix only for diagonal.
I'll try add a similar thing for the other pullbacks as well. In principle we can probably improve the performance a bit more but I'm not sure if this is worth the effort.