Ensure dynamic tolerance scaling works for every gradient algorithm - #421
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests.
🚀 New features to boost your workflow:
|
… using implicit gradient
leburgel
enabled auto-merge (squash)
August 26, 2026 11:47
leburgel
disabled auto-merge
August 27, 2026 06:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Missed in #413 after #410 was merged, but the fact that the custom
MPSKit._updatetolimplementation was specialized toFixedPointGradientmeant that the new default configuration for an optimization usingfixedpointwas broken when using anImplicitGradient.I added such a run to the example tests, to test
ImplicitGradientvia the public interface, and not just through raw gradient accuracy tests.UPDATE: This exposed some issues with the corner type of the environment returned by
leading_boundarywhen using implicit differentiation. In this case, we return the corner as a complex non-diagonal tensor map before evaluating the energy density, since the implicit differentiation approach relies on allowing complex non-diagonal adjoints of the corner. When settingreuse_env = true, theupdate!runs into a type mismatch between the initial environment (which will have a real diagonal corner when using aC4vEighProjector) and the corner to be updated (complex non-diagonal when used to evaluate the energy). Instead of converting the initial environment to have a complex non-diagonal corner, I opted to convert the corner type of the updated environment to a real diagonal if necessary.