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

reverse AD doesn't support planarspace #156

Open
XingyuZhang2018 opened this issue Oct 9, 2024 · 1 comment
Open

reverse AD doesn't support planarspace #156

XingyuZhang2018 opened this issue Oct 9, 2024 · 1 comment

Comments

@XingyuZhang2018
Copy link

XingyuZhang2018 commented Oct 9, 2024

A MVE:

using Test, Random, TensorKit, Zygote
using TensorKit: ℙ

@testset "plansor" begin
    vecspace = ℙ # ℂ works
    A = TensorMap(randn, ComplexF64, vecspace^2 ← vecspace^2)
    x = TensorMap(randn, ComplexF64, vecspace^2 ← vecspace^2)

    function f(x)
        @plansor y[-1; -2] := A[-1; 1] * x[1; -2]
        return real(dot(y, y))
    end
    @show f(x)
    @show Zygote.gradient(f, x)
end

Output:

f(x) = 1.2352920663031943
plansor: Error During Test at c:\Users\86412\Desktop\research\MPSKit.jl\test\ad.jl:56
  Got exception outside of a @test
  Can't differentiate foreigncall expression $(Expr(:foreigncall, :(Core.tuple(:zgemm_64_, LinearAlgebra.BLAS.libblastrampoline)), Nothing, svec(Ref{UInt8}, Ref{UInt8}, Ref{Int64}, Ref{Int64}, Ref{Int64}, Ref{ComplexF64}, Ptr{ComplexF64}, Ref{Int64}, Ptr{ComplexF64}, Ref{Int64}, Ref{ComplexF64}, Ptr{ComplexF64}, Ref{Int64}, Int32, Int32), 0, :(:ccall), %69, %71, %73, %75, %77, %79, %81, %83, %85, %87, %89, %91, %93, %94, %95, %67, %66, %65, %61, %59, %57, %53, %51, %47, %45, %43, %41, %39, %37, %35)).
  You might want to check the Zygote limitations documentation.
  https://fluxml.ai/Zygote.jl/latest/limitations
@lkdvos
Copy link
Collaborator

lkdvos commented Oct 9, 2024

See also #124

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

2 participants