Skip to content

Conversation

@leburgel
Copy link
Member

@leburgel leburgel commented Nov 5, 2025

A follow-up on the issue with the accuracy of the SVD pullback for tensors with a very small initial norm (see #276 and QuantumKitHub/MatrixAlgebraKit.jl#89). With the changes here, I managed to achieve the same accuracy that's achieved after #276, but without explicitly normalizing the halfinfinite and infinite environments before the SVD in the forward pass through CTMRG. This doesn't necessarily need to be merged, since I'm not exactly in a rush to remove the normalization before the SVD again now that it's cleat that this massively improved the accuracy of our gradients. Rather, it serves as a demonstration of some underlying issues that could be solved in the future (in particular in MatrixAlgebraKit.jl).

The issues I tracked down and their solutions(?):

  • The most important one is that all the default tolerances for the SVD pullback should really be scaled with the norm of the input to the primal computation. In particular, this means
  • In addition, I had to square the broadening coefficient ε as used in _lorentz_broaden to make sure the pullback remained accurate with varying initial normalization. This is more of a heuristic than anything else, but in practice the added square seems to be consistent with how things scale under scaling of the primal input.
    • This also means I had to tweak the default broadening setting and the corresponding test, since now this parameter needs to be larger to get the same relative broadening as before. Things seem to work for a new default value of 1.0e-10, but this was very much more just a guess than anything else.

TLDR: while I definitely don't think we should remove the normalization before the SVD in the CTMRG projector computation in PEPSKit.jl for now, this reflects some of the changes that should end up in MatrixAlgebraKit.jl if we want an SVD pullback whose accuracy is independent of the normalization of the primal input.

Tagging @lkdvos, @pbrehmer and @Jutho.

@leburgel leburgel marked this pull request as draft November 5, 2025 17:01
@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/Defaults.jl 85.71% <ø> (ø)
src/utility/svd.jl 88.80% <100.00%> (+1.29%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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

Successfully merging this pull request may close these issues.

2 participants