-
Notifications
You must be signed in to change notification settings - Fork 117
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
[ITensors][BUG] Derivative of gate application of non-Hermitian MPOs with apply_dag=true
#1314
Comments
Thanks for the report. Good to hear it's only an issue with The logic handling |
Something that sticks out to me is that it seems like you are testing on a non-Hermitian MPO. Does it seem like it works on Hermitian MPOs? Looking at https://github.com/ITensor/ITensors.jl/blob/v0.3.55/src/ITensorChainRules/mps/abstractmps.jl#L101-L105, I see that it only applies the gate to one side of the MPO, and then doubles the result to compute the pullback. That logic would only work for Hermitian MPOs. I think we just didn't consider someone would use |
I confirmed that the issue is specific to taking derivatives through gate application of non-Hermitian MPOs using |
apply_dag=true
apply_dag=true
apply_dag=true
Hey sorry for not answering the last days. I can try to write some function i case I find the time. Should be straight forward to define the |
Sounds good, thanks. Would be great to get a proper fix for that! |
…ring the MPO to be hermitian. Related Issue: ITensor#1314
Description of bug
Hey, I found that the application of an ITensor gate$G$ acting on some MPO $A$ in the adjoint representation:
leads to a wrong pullback. The normal left action$G\to GA$ is working properly (see minimal example). Also the adjoint action on a plain ITensor is also working as expected.
Minimal code demonstrating the bug or unexpected behavior
Minimal runnable code
Expected output or behavior
I expect all the tests in the example to return
true
. This would be equivalent to the output:Actual output or behavior
Instead of getting the expected behavior, the last check fails, indicating that the adjoint application of the ITensor gate onto the MPO leads to a different pullback compared to the matrix and the ITensor version. Also the numerical values are far of being comparable with the other versions.
Version information
versioninfo()
:using Pkg; Pkg.status("ITensors")
:The text was updated successfully, but these errors were encountered: