Skip to content
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

Warning: svd cotangents sensitive to gauge choice #54

Open
drichg opened this issue Jul 15, 2024 · 5 comments
Open

Warning: svd cotangents sensitive to gauge choice #54

drichg opened this issue Jul 15, 2024 · 5 comments

Comments

@drichg
Copy link

drichg commented Jul 15, 2024

Hi,

I am running a 2×2 unit cell Heisenberg model and repeatedly receive the following warning:
┌ Warning: svd cotangents sensitive to gauge choice: (|Δgauge| = 1.0548972842168783e-8) └ @ TensorKitChainRulesCoreExt C:\Users\dgj\.julia\packages\TensorKit\Fz2UW\ext\TensorKitChainRulesCoreExt\factorizations.jl:257.
Could you please provide guidance on how to address or mitigate this issue? Any suggestions for changes or improvements in the code or parameters that could help avoid this warning would be greatly appreciated.
Thank you!

@lkdvos
Copy link
Member

lkdvos commented Jul 16, 2024

Hi!

Am I correct in assuming that the algorithm still runs, but it is now very verbose because it prints a lot of warnings?

I agree that these warnings are a bit annoying, but currently they are also a bit hard to control. From the message you get, it seems like the actual gauge dependency is quite low, such that in principle, I would guess that it is safe to ignore this warning.

If the "console spam" is a bit annoying, one thing you could consider is to disable this specific warning. This can be done by attempting to intercept the message id and then disabling it through the logging utilities of Julia.

Alternatively, it seems like this issue is more prevalent when using the GMRES solver for the fixedpoint equation of the gradient. You could try and switch this to GeomSum or ManualIter, but from my experience these are a little less performant.

I will keep this issue open for now and think about a better way to mitigate these warnings. We are working on alternative methods that should be less prone to this, so it is definitely on our radar.

@pbrehmer
Copy link
Collaborator

pbrehmer commented Jul 17, 2024

Another thing you can try is to switch the way the CTMRG iteration is differentiated. Currently the default way to do this is by gauge-fixing a pre-computed SVD to reach an element-wise converged environment. I also found that this way can lead to quite a few (mostly harmless) warnings regarding gauge sensitivity depending on the model.

Alternatively, you can differentiate a gauge-fixing step additionally to the CTMRG iteration. This is enabled via the iterscheme=:diffgauge setting in the gradient algorithm. More concretely, you could use e.g.

gradient_alg=LinSolver(; solver=GMRES(; tol=1e-6), iterscheme=:diffgauge)

in an instance of PEPSOptimize. However, this is computationally more expensive since you have to differentiate through the additional gauge-fixing step and for bigger bond/environment dimensions this might slow you down. Hope this helps!

@lkdvos
Copy link
Member

lkdvos commented Jul 17, 2024

(keep in mind that that feature is the default in the released version though)

@drichg
Copy link
Author

drichg commented Jul 18, 2024

Another thing you can try is to switch the way the CTMRG iteration is differentiated. Currently the default way to do this is by gauge-fixing a pre-computed SVD to reach an element-wise converged environment. I also found that this way can lead to quite a few (mostly harmless) warnings regarding gauge sensitivity depending on the model.

Alternatively, you can differentiate a gauge-fixing step additionally to the CTMRG iteration. This is enabled via the iterscheme=:diffgauge setting in the gradient algorithm. More concretely, you could use e.g.

gradient_alg=LinSolver(; solver=GMRES(; tol=1e-6), iterscheme=:diffgauge)

in an instance of PEPSOptimize. However, this is computationally more expensive since you have to differentiate through the additional gauge-fixing step and for bigger bond/environment dimensions this might slow you down. Hope this helps!

Thanks for your attention. Following your suggestion, the warning has disappeared.

@Gertian
Copy link
Contributor

Gertian commented Aug 19, 2024

Hi all,

I had the same issue but setting
gradient_alg=LinSolver(; solver=GMRES(; tol=1e-6), iterscheme=:diffgauge)
did not solve it for me .

I should note that in my case, the error is :
┌ Warning: svd cotangents sensitive to gauge choice: (|Δgauge| = 0.0) └ @ TensorKitChainRulesCoreExt C:\Users\dgj\.julia\packages\TensorKit\Fz2UW\ext\TensorKitChainRulesCoreExt\factorizations.jl:257.
i.e. the error is exactly zero but stil the error is generated.

Does anyone have any idea where this might be coming from ?

All the best.
Gertian

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

No branches or pull requests

4 participants