bsc-quantic/Quac.jl

`draw` crashes on `Sd` gate type

Closed this issue · 1 comments

Summary

Currently the draw(::Gate) function does not support the Sd gate:

julia> draw(Sd)
ERROR: MethodError: no method matching text(::LaTeXStrings.LaTeXString; valign=:middle, halign=:center)
Closest candidates are:
  text(::LaTeXStrings.LaTeXString, ::Luxor.Point; valign, halign, angle, rotationfixed, paths, kwargs...) at ~/.julia/packages/Luxor/hQ5tt/src/latex.jl:115
  text(::AbstractString, ::Luxor.Point; halign, valign, angle) at ~/.julia/packages/Luxor/hQ5tt/src/text.jl:31
  text(::String; kwargs...) at ~/.julia/packages/Luxor/hQ5tt/src/text.jl:83
  ...
Stacktrace:
 [1] macro expansion
   @ ~/git/Quac.jl/src/Visualization.jl:126 [inlined]
 [2] macro expansion
   @ ~/.julia/packages/Luxor/hQ5tt/src/drawings.jl:1351 [inlined]
 [3] draw_block(label::LaTeXStrings.LaTeXString; top::Bool, bottom::Bool)
   @ Quac ~/git/Quac.jl/src/Visualization.jl:107
 [4] draw_block(label::LaTeXStrings.LaTeXString)
   @ Quac ~/git/Quac.jl/src/Visualization.jl:106
 [5] draw(::Type{Sd}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Quac ~/git/Quac.jl/src/Visualization.jl:72
 [6] draw(::Type{Sd})
   @ Quac ~/git/Quac.jl/src/Visualization.jl:72
 [7] top-level scope
   @ REPL[20]:1

This seems to be a problem with the way Quac calls Luxor.text.