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

Improve warnings in AD rules #122

Merged
merged 2 commits into from
May 12, 2024
Merged

Improve warnings in AD rules #122

merged 2 commits into from
May 12, 2024

Conversation

lkdvos
Copy link
Collaborator

@lkdvos lkdvos commented May 8, 2024

Adds some extra infomation to the AD gauge-dependence warnings:

  • which function it is a contangent for
  • severity of dependence

Copy link

codecov bot commented May 8, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 81.44%. Comparing base (370dd92) to head (0a3c649).
Report is 2 commits behind head on master.

Files Patch % Lines
ext/TensorKitChainRulesCoreExt.jl 50.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #122      +/-   ##
==========================================
- Coverage   81.46%   81.44%   -0.02%     
==========================================
  Files          42       42              
  Lines        5588     5588              
==========================================
- Hits         4552     4551       -1     
- Misses       1036     1037       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@warn "`svd` cotangents sensitive to gauge choice: (|aUΔU| = $aUΔUpart_norm)"
aVΔVpart_norm = norm(view(aVΔV, rprange, rprange), Inf)
aVΔVpart_norm < tol ||
@warn "`svd` cotangents sensitive to gauge choice: (|aVΔV| = $aVΔVpart_norm)"
end
Copy link
Owner

@Jutho Jutho May 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe remove the warnings above, have a single warning below the end and replace the aUΔUpart_norm and aVΔVpart_norm parts, i.e. as follows:

gaugepart = norm(view(aUΔU, mask) + view(aVΔV, mask), Inf)
if p > r
  rprange = (r + 1):p
  gaugepart = max(gaugepart, norm(view(aUΔU, rprange, rprange), Inf))
  gaugepart = max(gaugepart, norm(view(aVΔV, rprange, rprange), Inf))
end
gaugepart < tol ||
         @warn "`svd` cotangents sensitive to gauge choice: (|ΔGauge| = $gaugepart)"

@Jutho Jutho merged commit 4607691 into master May 12, 2024
12 of 14 checks passed
@lkdvos lkdvos deleted the ad-warnings branch May 13, 2024 05:25
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.

None yet

2 participants