QuantumBFS / ZXCalculus.jl

An implementation of ZX-calculus in Julia
http://yaoquantum.org/ZXCalculus.jl/dev/
MIT License
48 stars 7 forks source link

Cannot Plot ZXDiagram with YaoPlots #100

Closed contra-bit closed 8 months ago

contra-bit commented 1 year ago

Dear Developers.

Please help me to get this library to Plot ZXDiagrams. I cannot run the examples provided in this repository.

After installing ZXCalculus and YaoPlots. I tried running the examples from the shell, repl and in Pluto.

julia example/ex1.jl 
julia example/ex2.jl

Everytime I get the a *. See Stacktrace:

LoadError: BoundsError: attempt to access 1-element Vector{Int64} at index [2]
Stacktrace:
 [1] getindex
   @ ./array.jl:805 [inlined]
 [2] indexed_iterate
   @ ./tuple.jl:87 [inlined]
 [3] layout2locs(zxd::ZXDiagram{Int64, ZXCalculus.Phase})
   @ YaoPlots ~/.julia/packages/YaoPlots/U4hOY/src/zx_plot.jl:108
 [4] plot(zxd::ZXDiagram{Int64, ZXCalculus.Phase}; size_x::Nothing, size_y::Nothing, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ YaoPlots ~/.julia/packages/YaoPlots/U4hOY/src/zx_plot.jl:176
 [5] plot(zxd::ZXDiagram{Int64, ZXCalculus.Phase})
   @ YaoPlots ~/.julia/packages/YaoPlots/U4hOY/src/zx_plot.jl:171
 [6] top-level scope
   @ ~/src/quantum-circuits/software/ZXCalculus.jl/example/ex2.jl:84

PS: Should this issue be moved to YaoPlots?

ChenZhao44 commented 1 year ago

The ZXCalculus support of YaoPlots has been removed. Could you tell me which version of YaoPlots are you using?

contra-bit commented 8 months ago

102 closes this issue