Simplify Tensor
struct
#104
Triggered via pull request
September 26, 2023 12:07
Status
Success
Total duration
21m 37s
Artifacts
–
Annotations
5 warnings
Documenter:
../../../.julia/packages/Documenter/Meee1/src/utilities/utilities.jl#L46
failed to run `@example` block in src/examples/ad-tn.md:10-25
```@example autodiff
using Tenet
using Zygote
using Random: seed! # hide
rng = seed!(4) # hide
ψ = rand(MPS{Open}, n = 4, p = 2, χ = 2)
ϕ = rand(MPS{Open}, n = 4, p = 2, χ = 4)
ψ = rand(rng, MPS{Open}, n = 4, p = 2, χ = 2) # hide
ϕ = rand(rng, MPS{Open}, n = 4, p = 2, χ = 4) # hide
tn = hcat(ψ, ϕ)
plot(tn) # hide
```
exception =
"MPS{Open}" metadata is not valid
Stacktrace:
[1] checkansatz(tn::TensorNetwork{MPS{Open}, NamedTuple{(:plug, :interlayer, :χ), Tuple{Type{<:Plug}, Vector{Bijections.Bijection{Int64, Symbol}}, Union{Nothing, Int64}}}})
@ Tenet ~/work/Tenet.jl/Tenet.jl/src/TensorNetwork.jl:69
[2] (TensorNetwork{MPS{Open}})(tensors::Vector{Tensor}; metadata::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:plug, :interlayer, :χ), Tuple{DataType, Vector{Bijections.Bijection{Int64, Symbol}}, Int64}}})
@ Tenet ~/work/Tenet.jl/Tenet.jl/src/TensorNetwork.jl:52
[3] layers(tn::TensorNetwork{Tenet.Composite{Tuple{MPS{Open}, MPS{Open}}}, NamedTuple{(:plug, :interlayer, :layermeta), Tuple{Type{<:Plug}, Vector{Bijections.Bijection{Int64, Symbol}}, Vector{Dict{Symbol, Any}}}}}, i::Int64)
@ Tenet ~/work/Tenet.jl/Tenet.jl/src/Quantum/Quantum.jl:161
[4] checkmeta(As::Type{Tenet.Composite{Tuple{MPS{Open}, MPS{Open}}}}, tn::TensorNetwork{Tenet.Composite{Tuple{MPS{Open}, MPS{Open}}}, NamedTuple{(:plug, :interlayer, :layermeta), Tuple{Type{<:Plug}, Vector{Bijections.Bijection{Int64, Symbol}}, Vector{Dict{Symbol, Any}}}}})
@ Tenet ~/work/Tenet.jl/Tenet.jl/src/Quantum/Quantum.jl:129
[5] checkansatz(tn::TensorNetwork{Tenet.Composite{Tuple{MPS{Open}, MPS{Open}}}, NamedTuple{(:plug, :interlayer, :layermeta), Tuple{Type{<:Plug}, Vector{Bijections.Bijection{Int64, Symbol}}, Vector{Dict{Symbol, Any}}}}})
@ Tenet ~/work/Tenet.jl/Tenet.jl/src/TensorNetwork.jl:69
[6] (TensorNetwork{Tenet.Composite{Tuple{MPS{Open}, MPS{Open}}}})(tensors::Vector{Tensor{Float64, N, _B} where {N, _B<:AbstractArray{Float64, N}}}; metadata::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:plug, :interlayer, :layermeta), Tuple{DataType, Vector{Bijections.Bijection{Int64, Symbol}}, Vector{Dict{Symbol, Any}}}}})
@ Tenet ~/work/Tenet.jl/Tenet.jl/src/TensorNetwork.jl:52
[7] hcat(A::TensorNetwork{MPS{Open}, NamedTuple{(:plug, :interlayer, :χ), Tuple{Type{<:Plug}, Vector{Bijections.Bijection{Int64, Symbol}}, Union{Nothing, Int64}}}}, B::TensorNetwork{MPS{Open}, NamedTuple{(:plug, :interlayer, :χ), Tuple{Type{<:Plug}, Vector{Bijections.Bijection{Int64, Symbol}}, Union{Nothing, Int64}}}})
@ Tenet ~/work/Tenet.jl/Tenet.jl/src/Quantum/Quantum.jl:213
[8] top-level scope
@ ad-tn.md:22
[9] eval
@ ./boot.jl:370 [inlined]
[10] #54
@ ~/.julia/packages/Documenter/Meee1/src/expander_pipeline.jl:738 [inlined]
[11] cd(f::Documenter.var"#54#56"{Module, Expr}, dir::String)
@ Base.Filesystem ./file.jl:112
[12] (::Documenter.var"#53#55"{Documenter.Page, Module, Expr})()
@ Documenter ~/.julia/packages/Documenter/Meee1/src/expander_pipeline.jl:737
[13] (::IOCapture.var"#3#5"{DataType, Documenter.var"#53#55"{Documenter.Page, Module, Expr}, Task, IOContext{Base.PipeEndpoint}, IOContext{Base.PipeEndpoint}, IOContext{Base.PipeEndpoint}, IOContext{Base.PipeEndpoint}})()
@ IOCapture ~/.julia/packages/IOCapture/8Uj7o/src/IOCapture.jl:119
[14] with_logstate(f::Function, logstate::Any)
@ Base.CoreLogging ./logging.jl:514
[15] with_logger
@ ./logging.jl:626 [inlined]
[16] capture(f::Documenter.var"#53#55"{Documenter.Page, Module, Expr}; rethrow::Type, color::Bool)
@ IOCapture ~/.julia/packages/IOCapture/8Uj7o/src/IOCapture.jl:116
[17] runner(#unused#::Type{Documenter.Expanders.ExampleBlocks}, node::MarkdownAST.Node{Nothing}, page::Documenter.Page, doc::Documenter.Document)
@ Documenter ~/.julia/packages/Documenter/Meee1/src/expander_pipeline.jl:736
|
Documenter:
../../../.julia/packages/Documenter/Meee1/src/utilities/utilities.jl#L46
failed to run `@example` block in src/examples/ad-tn.md:44-69
```@example autodiff
η = 0.01
@time losses = map(1:200) do it
# compute gradient
loss, ∇ = withgradient(Params(arrays(ψ))) do
((contract(tn) |> first) - 1)^2
end
# direct gradient descent
for array in arrays(ψ)
array .-= η * ∇[array]
end
# normalize state
normalize!(ψ)
return loss
end
f = Figure() # hide
ax = Axis(f[1, 1], yscale = log10, xscale = identity, xlabel="Iterations") # hide
lines!(losses, label="Loss") # hide
lines!(map(x -> 1 - sqrt(x), losses), label="Overlap") # hide
f[1,2] = Legend(f, ax, framevisible=false) # hide
f # hide
```
exception =
UndefVarError: `tn` not defined
Stacktrace:
[1] _pullback(::Zygote.Context{true}, ::Main.__atexample__named__autodiff.var"#2#4")
@ Zygote ~/.julia/packages/Zygote/4SSHS/src/compiler/interface2.jl:101
[2] pullback(f::Function, ps::Zygote.Params{Zygote.Buffer{Array{Float64}, Vector{Array{Float64}}}})
@ Zygote ~/.julia/packages/Zygote/4SSHS/src/compiler/interface.jl:414
[3] withgradient(f::Function, args::Zygote.Params{Zygote.Buffer{Array{Float64}, Vector{Array{Float64}}}})
@ Zygote ~/.julia/packages/Zygote/4SSHS/src/compiler/interface.jl:154
[4] (::Main.__atexample__named__autodiff.var"#1#3")(it::Int64)
@ Main.__atexample__named__autodiff ./ad-tn.md:48
[5] iterate
@ ./generator.jl:47 [inlined]
[6] _collect(c::UnitRange{Int64}, itr::Base.Generator{UnitRange{Int64}, Main.__atexample__named__autodiff.var"#1#3"}, #unused#::Base.EltypeUnknown, isz::Base.HasShape{1})
@ Base ./array.jl:802
[7] collect_similar(cont::UnitRange{Int64}, itr::Base.Generator{UnitRange{Int64}, Main.__atexample__named__autodiff.var"#1#3"})
@ Base ./array.jl:711
[8] map(f::Function, A::UnitRange{Int64})
@ Base ./abstractarray.jl:3263
[9] top-level scope
@ ./timing.jl:273
[10] eval
@ ./boot.jl:370 [inlined]
[11] #54
@ ~/.julia/packages/Documenter/Meee1/src/expander_pipeline.jl:738 [inlined]
[12] cd(f::Documenter.var"#54#56"{Module, Expr}, dir::String)
@ Base.Filesystem ./file.jl:112
[13] (::Documenter.var"#53#55"{Documenter.Page, Module, Expr})()
@ Documenter ~/.julia/packages/Documenter/Meee1/src/expander_pipeline.jl:737
[14] (::IOCapture.var"#3#5"{DataType, Documenter.var"#53#55"{Documenter.Page, Module, Expr}, Task, IOContext{Base.PipeEndpoint}, IOContext{Base.PipeEndpoint}, IOContext{Base.PipeEndpoint}, IOContext{Base.PipeEndpoint}})()
@ IOCapture ~/.julia/packages/IOCapture/8Uj7o/src/IOCapture.jl:119
[15] with_logstate(f::Function, logstate::Any)
@ Base.CoreLogging ./logging.jl:514
[16] with_logger
@ ./logging.jl:626 [inlined]
[17] capture(f::Documenter.var"#53#55"{Documenter.Page, Module, Expr}; rethrow::Type, color::Bool)
@ IOCapture ~/.julia/packages/IOCapture/8Uj7o/src/IOCapture.jl:116
[18] runner(#unused#::Type{Documenter.Expanders.ExampleBlocks}, node::MarkdownAST.Node{Nothing}, page::Documenter.Page, doc::Documenter.Document)
@ Documenter ~/.julia/packages/Documenter/Meee1/src/expander_pipeline.jl:736
|
|
Documenter:
../../../.julia/packages/Documenter/Meee1/src/deploydocs.jl#L464
removing `stable` and linking `stable` to `v0.3.0`.
|
Documenter:
../../../.julia/packages/Documenter/Meee1/src/deploydocs.jl#L464
removing `v0.3` and linking `v0.3` to `v0.3.0`.
|