bsc-quantic / Tenet.jl

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

Refactor visualization functions #19

Closed jofrevalles closed 1 year ago

jofrevalles commented 1 year ago

Plot recipes currently describe plot primitives that live in an Axis but can not change the Axis parameters. Therefore, with plot recipes, we can't currently include Colorbars, add interactions, and in general, customize the Axis. In this PL we address #5, and we change the plot function so now it can take a GridPosition and plot into it. This enabled us to add the following features:

Example:

julia> using Tenet
julia> using Makie
julia> using GLMakie
julia> tn = rand(TensorNetwork, 60, 3)
TensorNetwork{Arbitrary}(#tensors=60, #inds=90)
julia> f = Figure(backgroundcolor="ivory", resolution=(1000, 700))
julia> scatter(f[1,1], 1..4, log)
Makie.AxisPlot(Axis (1 plots), Scatter{Tuple{Vector{Point{2, Float32}}}})
julia> lines(f[2,1], 1..10, cos)
Makie.AxisPlot(Axis (1 plots), Lines{Tuple{Vector{Point{2, Float32}}}})
julia> using NetworkLayout
julia> plot!(f[1:2,2], tn; layout=Spring(dim=3))
(Combined{GraphMakie.graphplot, Tuple{Graphs.SimpleGraphs.SimpleGraph{Int64}}}, LScene())

image

codecov[bot] commented 1 year ago

Codecov Report

Merging #19 (2126cd0) into master (7fd9ee5) will decrease coverage by 0.22%. The diff coverage is n/a.

@@            Coverage Diff             @@
##           master      #19      +/-   ##
==========================================
- Coverage   73.64%   73.43%   -0.22%     
==========================================
  Files           9        9              
  Lines         444      448       +4     
==========================================
+ Hits          327      329       +2     
- Misses        117      119       +2     
Impacted Files Coverage Δ
src/TensorNetwork.jl 76.15% <0.00%> (-0.84%) :arrow_down:
src/Tensor.jl 76.38% <0.00%> (ø)

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