ITensor / ITensor/ITensorMPS.jl
`productMPS` not differentiable
Open
Nobody has claimed this yet.
bug
- Dominant language
- Julia
- Stars
- 85
- Forks
- 27
- Avg merge
- 22m
- Merged PRs (30d)
- 1
Description
sites = siteinds("Qubit", 3)
function f(x)
ψ = productMPS(sites, "0")
return x * inner(ψ,ψ)
end
f'(2.0)
Error:
ERROR: TypeError: in Type, in parameter, expected Type, got a value of type ITensor
Stacktrace:
[1] _pullback
@ ~/.julia/dev/ITensors/src/physics/sitetype.jl:106 [inlined]
[2] _pullback(ctx::Zygote.Context, f::Type{SiteType}, args::UInt128)
@ Zygote ~/.julia/packages/Zygote/Lw5Kf/src/compiler/interface2.jl:0
[3] _pullback
@ ~/.julia/dev/ITensors/src/physics/sitetype.jl:187 [inlined]
[4] _pullback(ctx::Zygote.Context, f::typeof(ITensors._sitetypes), args::TagSet)
@ Zygote ~/.julia/packages/Zygote/Lw5Kf/src/compiler/interface2.jl:0
[5] _pullback
@ ~/.julia/dev/ITensors/src/physics/sitetype.jl:190 [inlined]
[6] _pullback(ctx::Zygote.Context, f::typeof(ITensors._sitetypes), args::Index{Int64})
@ Zygote ~/.julia/packages/Zygote/Lw5Kf/src/compiler/interface2.jl:0
[7] _pullback
@ ~/.julia/dev/ITensors/src/physics/sitetype.jl:462 [inlined]
[8] _pullback(::Zygote.Context, ::ITensors.var"##state#927", ::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}, ::typeof(state), ::Index{Int64}, ::String)
@ Zygote ~/.julia/packages/Zygote/Lw5Kf/src/compiler/interface2.jl:0
[9] _pullback
@ ~/.julia/dev/ITensors/src/physics/sitetype.jl:462 [inlined]
[10] _pullback
...
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the example in the issue and start at physics/sitetype.jl:106, where the stack trace reports the TypeError during differentiation. Trace the productMPS/site-type path to determine the needed fix; done means f'(2.0) runs without this error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100