bsc-quantic / Tenet.jl

Composable Tensor Network library in Julia
https://bsc-quantic.github.io/Tenet.jl/
Apache License 2.0
17 stars 1 forks source link

Add `labels` keyword argument into plot functions #20

Closed jofrevalles closed 1 year ago

jofrevalles commented 1 year ago

Summary

We add labels as a keyword argument into both plot and plot! functions. This argument is false by default, but if it's true, the plot displays the index label of each edge.

Example

julia> using Tenet
julia> using CairoMakie
julia> using Makie
julia> tn = rand(TensorNetwork, 10, 3)
TensorNetwork{Arbitrary}(#tensors=10, #inds=15)
julia> plot(tn; labels=true)
(Scene (800px, 600px):
  0 Plots
  1 Child Scene:
    └ Scene (800px, 600px), Axis (1 plots), Combined{GraphMakie.graphplot, Tuple{Graphs.SimpleGraphs.SimpleGraph{Int64}}})
julia> [tensor.labels for tensor in tn.tensors]
10-element Vector{Tuple{Symbol, Vararg{Symbol}}}:
 (:m, :d, :j)
 (:k, :i, :o)
 (:c, :f, :d)
 (:l, :c, :f)
 (:a, :m, :n, :j, :g, :o)
 (:h,)
 (:k, :b, :i)
 (:a, :e)
 (:e, :l)
 (:h, :g, :b, :n)

image

codecov[bot] commented 1 year ago

Codecov Report

Merging #20 (9f582a7) into master (1f750c8) will not change coverage. The diff coverage is n/a.

:exclamation: Current head 9f582a7 differs from pull request most recent head e870753. Consider uploading reports for the commit e870753 to get more accurate results

@@           Coverage Diff           @@
##           master      #20   +/-   ##
=======================================
  Coverage   71.36%   71.36%           
=======================================
  Files           9        9           
  Lines         461      461           
=======================================
  Hits          329      329           
  Misses        132      132           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.