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

[ITensorMakie] [BUG] Unable to use ITensorGLMakie at all #1219

Closed
AmdaU opened this issue Oct 25, 2023 · 2 comments
Closed

[ITensorMakie] [BUG] Unable to use ITensorGLMakie at all #1219

AmdaU opened this issue Oct 25, 2023 · 2 comments
Labels
bug Something isn't working ITensorMakie Issues related to the ITensorMakie module.

Comments

@AmdaU
Copy link

AmdaU commented Oct 25, 2023

Description of bug

I tried to get the ITensorGLMakie backend to work in various situations but to no avail.

Minimal runnable code

using ITensors
using ITensorGLMakie

i = Index(2, "index_i")
j = Index(10, "index_j")
k = Index(40, "index_k")
l = Index(40, "index_l")
m = Index(40, "index_m")
A = randomITensor(i, j, l)
B = randomITensor(i, j, l, m)
C = randomITensor(k, m)

ABC = @visualize A * B * C

observed behavior
I would expect a window to appear with the visualization. The visualization works when using ITensorUnicodePlots instead.

Output of minimal runnable code

ERROR: LoadError: MethodError: no method matching iterate(::Observables.Observable{Any})

Closest candidates are:
  iterate(::Union{LinRange, StepRangeLen})
   @ Base range.jl:880
  iterate(::Union{LinRange, StepRangeLen}, ::Integer)
   @ Base range.jl:880
  iterate(::T) where T<:Union{Base.KeySet{<:Any, <:Dict}, Base.ValueIterator{<:Dict}}
   @ Base dict.jl:698
  ...

Stacktrace:
  [1] merge(a::NamedTuple{(:color, :marker, :markersize, :strokewidth), Tuple{Observables.Observable{ColorTypes.RGB{FixedPointNumbers.N0f8}}, Observables.Observable{Char}, Observables.Observable{Vector{Int64}}, Observables.Observable{Int64}}}, itr::Observables.Observable{Any})
    @ Base ./namedtuple.jl:303
  [2] plot!(gp::MakieCore.Combined{GraphMakie.graphplot, Tuple{MetaGraphs.MetaDiGraph{Int64, Float64}}})
    @ GraphMakie ~/.julia/packages/GraphMakie/yyvus/src/recipes.jl:323
  [3] plot!(scene::Makie.Scene, P::Type{MakieCore.Combined{GraphMakie.graphplot, Tuple{MetaGraphs.MetaDiGraph{Int64, Float64}}}}, attributes::MakieCore.Attributes, input::Tuple{Observables.Observable{MetaGraphs.MetaDiGraph{Int64, Float64}}}, args::Observables.Observable{Tuple{MetaGraphs.MetaDiGraph{Int64, Float64}}})
    @ Makie ~/.julia/packages/Makie/NrrbP/src/interfaces.jl:398
  [4] plot!(scene::Makie.Scene, P::Type{MakieCore.Combined{GraphMakie.graphplot}}, attributes::MakieCore.Attributes, args::MetaGraphs.MetaDiGraph{Int64, Float64}; kw_attributes::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Makie ~/.julia/packages/Makie/NrrbP/src/interfaces.jl:310
  [5] plot!(scene::Makie.Scene, P::Type{MakieCore.Combined{GraphMakie.graphplot}}, attributes::MakieCore.Attributes, args::MetaGraphs.MetaDiGraph{Int64, Float64})
    @ Makie ~/.julia/packages/Makie/NrrbP/src/interfaces.jl:275
  [6] get_axis(fig::Any, P::Any, axis_kw::Dict, plot_attr::Any, plot_args::Any)
    @ Makie ~/.julia/packages/Makie/NrrbP/src/figureplotting.jl:43
  [7] plot(P::Type{MakieCore.Combined{GraphMakie.graphplot}}, gp::GridLayoutBase.GridPosition, args::MetaGraphs.MetaDiGraph{Int64, Float64}; axis::NamedTuple{(), Tuple{}}, kw_attributes::Base.Pairs{Symbol, Any, NTuple{20, Symbol}, NamedTuple{(:layout, :node_size, :node_color, :node_marker, :node_attr, :nlabels, :nlabels_textsize, :nlabels_color, :nlabels_align, :edge_width, :edge_color, :elabels, :elabels_textsize, :elabels_color, :selfedge_width, :selfedge_direction, :selfedge_size, :arrow_show, :arrow_size, :arrow_shift), Tuple{NetworkLayout.Spring{2, Float64}, Vector{Int64}, ColorTypes.RGB{FixedPointNumbers.N0f8}, Char, NamedTuple{(:strokecolor, :strokewidth), Tuple{Symbol, Int64}}, Vector{String}, Int64, ColorTypes.RGB{FixedPointNumbers.N0f8}, Tuple{Symbol, Symbol}, Vector{Float64}, ColorTypes.RGB{FixedPointNumbers.N0f8}, Vector{String}, Int64, ColorTypes.RGB{FixedPointNumbers.N0f8}, Float64, GeometryBasics.Point2{Int64}, Int64, Bool, Int64, Float64}}})
    @ Makie ~/.julia/packages/Makie/NrrbP/src/figureplotting.jl:96
  [8] plot
    @ ~/.julia/packages/Makie/NrrbP/src/figureplotting.jl:79 [inlined]
  [9] #graphplot#15
    @ ~/.julia/packages/MakieCore/7iPhv/src/recipes.jl:35 [inlined]
 [10] graphplot
    @ ~/.julia/packages/MakieCore/7iPhv/src/recipes.jl:34 [inlined]
 [11] visualize!(b::ITensorVisualizationBase.Backend{:Makie}, f::GridLayoutBase.GridPosition, g::MetaGraphs.MetaDiGraph{Int64, Float64}; interactive::Bool, ndims::Int64, layout::NetworkLayout.Spring{2, Float64}, vertex_labels_prefix::String, vertex_labels::Vector{String}, vertex_size::Int64, vertex_textsize::Int64, edge_textsize::Int64, edge_widths::Vector{Float64}, edge_labels::IndexLabels, arrow_show::Bool, arrow_size::Int64, siteinds_direction::GeometryBasics.Point2{Int64})
    @ ITensorMakie ~/.julia/packages/ITensorMakie/13kVC/src/ITensorMakie.jl:136
 [12] #visualize#1
    @ ~/.julia/packages/ITensorMakie/13kVC/src/ITensorMakie.jl:45 [inlined]
 [13] visualize
    @ ~/.julia/packages/ITensorMakie/13kVC/src/ITensorMakie.jl:43 [inlined]
 [14] #visualize#18
    @ ~/.julia/packages/ITensorVisualizationBase/kPYZF/src/visualize.jl:106 [inlined]
 [15] visualize
    @ ~/.julia/packages/ITensorVisualizationBase/kPYZF/src/visualize.jl:104 [inlined]
 [16] #visualize#19
    @ ~/.julia/packages/ITensorVisualizationBase/kPYZF/src/visualize.jl:110 [inlined]
 [17] visualize
    @ ~/.julia/packages/ITensorVisualizationBase/kPYZF/src/visualize.jl:109 [inlined]
 [18] visualize(tn::Tuple{ITensor, ITensor, ITensor}, args::Nothing; kwargs::Base.Pairs{Symbol, Vector{String}, Tuple{Symbol}, NamedTuple{(:vertex_labels,), Tuple{Vector{String}}}})
    @ ITensorVisualizationBase ~/.julia/packages/ITensorVisualizationBase/kPYZF/src/visualize.jl:118
 [19] visualize
    @ ~/.julia/packages/ITensorVisualizationBase/kPYZF/src/visualize.jl:117 [inlined]
 [20] #visualize#34
    @ ~/.julia/packages/ITensorVisualizationBase/kPYZF/src/visualize.jl:167 [inlined]
 [21] top-level scope
    @ ~/.julia/packages/ITensors/52gcm/src/ITensorVisualizationCore/visualize_macro.jl:94
 [22] include(fname::String)
    @ Base.MainInclude ./client.jl:478
 [23] top-level scope
    @ REPL[4]:1
in expression starting at /home/amda/Documents/maitrise/julia_tests/visual_test.jl:13

Version information

  • Output from versioninfo():
julia> versioninfo()
Julia Version 1.9.3
Commit bed2cd540a (2023-08-24 14:43 UTC)
Build Info:

    Note: This is an unofficial build, please report bugs to the project
    responsible for this build and not to the Julia project unless you can
    reproduce the issue using official builds available at https://julialang.org/downloads

Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: 16 × 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, tigerlake)
  Threads: 1 on 16 virtual cores
  • Output from using Pkg; Pkg.status("ITensors"):
julia> using Pkg; Pkg.status("ITensors")
Status `~/Documents/maitrise/julia_tests/test_env/Project.toml`
  [9136182c] ITensors v0.3.46
@AmdaU AmdaU added bug Something isn't working ITensorMakie Issues related to the ITensorMakie module. labels Oct 25, 2023
@mtfishman
Copy link
Member

mtfishman commented Oct 25, 2023

Thanks, we're aware if this issue: MakieOrg/GraphMakie.jl#142. It was fixed in MakieOrg/Makie.jl#3284 which will be made available when a new version of Makie is released.

@mtfishman
Copy link
Member

For the time being it should work if you use Makie v0.19.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ITensorMakie Issues related to the ITensorMakie module.
Projects
None yet
Development

No branches or pull requests

2 participants