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

small fix in backward rule for leftorth, rightorth #123

Merged
merged 2 commits into from
May 12, 2024

Conversation

tangwei94
Copy link
Contributor

Previously, the backwards for leftorth and rightorth occasionally give wrong results when R or L are not used in forward computations.
For example,

    function f(C1)
        U, _ = leftorth(C1; alg=QRpos())
        return norm(tr(U))
    end
    C = TensorMap(rand, ComplexF64,  ℂ^4,  ℂ^4);
    f'(C) # this gradient may be wrong

Copy link

codecov bot commented May 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.44%. Comparing base (79c2ae0) to head (225a423).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #123   +/-   ##
=======================================
  Coverage   81.44%   81.44%           
=======================================
  Files          42       42           
  Lines        5588     5588           
=======================================
  Hits         4551     4551           
  Misses       1037     1037           

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

ext/TensorKitChainRulesCoreExt.jl Outdated Show resolved Hide resolved
ext/TensorKitChainRulesCoreExt.jl Outdated Show resolved Hide resolved
@Jutho
Copy link
Owner

Jutho commented May 12, 2024

Well spotted, I can imagine that this was a tough one to debug. I will merge as soon as CI finished running.

@Jutho Jutho merged commit 7ee775b into Jutho:master May 12, 2024
13 checks passed
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.

3 participants