Skip to content

Commit

Permalink
Try fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Apr 30, 2024
1 parent beaf390 commit e9464c3
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
3 changes: 2 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ using Documenter
using DocumenterCitations
using Tenet
using CairoMakie
using GraphMakie
using LinearAlgebra

DocMeta.setdocmeta!(Tenet, :DocTestSetup, :(using Tenet); recursive=true)

bib = CitationBibliography(joinpath(@__DIR__, "refs.bib"); style=:authoryear)

makedocs(;
modules=[Tenet, Base.get_extension(Tenet, :TenetMakieExt)],
modules=[Tenet, Base.get_extension(Tenet, :TenetGraphMakieExt)],
sitename="Tenet.jl",
authors="Sergio Sánchez Ramírez and contributors",
pages=Any[
Expand Down
3 changes: 1 addition & 2 deletions docs/src/tensor-network.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,9 @@ delete!(::Tenet.TensorNetwork, ::Any)
replace!
```

## Selection
## Slicing

```@docs
select
selectdim
slice!
view(::Tenet.TensorNetwork)
Expand Down
21 changes: 11 additions & 10 deletions docs/src/transformations.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
```@setup plot
using Makie
Makie.inline!(true)
using GraphMakie
using CairoMakie
using Tenet
using NetworkLayout
Expand Down Expand Up @@ -56,6 +56,7 @@ transform!

```@docs
Tenet.HyperFlatten
Tenet.HyperGroup
```

### Diagonal reduction
Expand Down Expand Up @@ -96,7 +97,7 @@ smooth_annotation!( #hide
num_waves = 6, #hide
fluctuation_amplitude = 0.02, #hide
phase_shift = 0.0) #hide
plot!(fig[1, 1], tn, layout=Spring(iterations=1000, C=0.5, seed=100); node_color=[red, orange, orange]) #hide
graphplot!(fig[1, 1], tn, layout=Spring(iterations=1000, C=0.5, seed=100); node_color=[red, orange, orange]) #hide
smooth_annotation!( #hide
fig[1, 2]; #hide
Expand All @@ -110,7 +111,7 @@ smooth_annotation!( #hide
num_waves = 5, #hide
fluctuation_amplitude = 0.02, #hide
phase_shift = 1.9) #hide
plot!(fig[1, 2], reduced, layout=Spring(iterations=1000, C=0.5, seed=100), node_color=[orange, orange, red, :black]) #hide
graphplot!(fig[1, 2], reduced, layout=Spring(iterations=1000, C=0.5, seed=100), node_color=[orange, orange, red, :black]) #hide
Label(fig[1, 1, Bottom()], "Original") #hide
Label(fig[1, 2, Bottom()], "Transformed") #hide
Expand All @@ -124,7 +125,7 @@ fig #hide
Tenet.AntiDiagonalGauging
```

### Rank simplification
### Contraction simplification

```@docs
Tenet.ContractSimplification
Expand Down Expand Up @@ -154,7 +155,7 @@ smooth_annotation!( #hide
num_waves = 6, #hide
fluctuation_amplitude = 0.01, #hide
phase_shift = 0.0) #hide
plot!(fig[1, 1], tn, layout=Spring(iterations=1000, C=0.5, seed=20); node_color=[orange, red, orange, orange]) #hide
graphplot!(fig[1, 1], tn, layout=Spring(iterations=1000, C=0.5, seed=20); node_color=[orange, red, orange, orange]) #hide
smooth_annotation!( #hide
fig[1, 2]; #hide
Expand All @@ -168,7 +169,7 @@ smooth_annotation!( #hide
num_waves = 5, #hide
fluctuation_amplitude = 0.01, #hide
phase_shift = 0) #hide
plot!(fig[1, 2], reduced, layout=Spring(iterations=1000, C=0.5, seed=1); node_color=[red, orange, orange]) #hide
graphplot!(fig[1, 2], reduced, layout=Spring(iterations=1000, C=0.5, seed=1); node_color=[red, orange, orange]) #hide
Label(fig[1, 1, Bottom()], "Original") #hide
Label(fig[1, 2, Bottom()], "Transformed") #hide
Expand Down Expand Up @@ -208,7 +209,7 @@ smooth_annotation!( #hide
num_waves = 4, #hide
fluctuation_amplitude = 0.02, #hide
phase_shift = 0.0) #hide
plot!(fig[1, 1], tn, layout=Spring(iterations=1000, C=0.5, seed=6); node_color=[red, orange, orange]) #hide
graphplot!(fig[1, 1], tn, layout=Spring(iterations=1000, C=0.5, seed=6); node_color=[red, orange, orange]) #hide
smooth_annotation!( #hide
fig[1, 2]; #hide
Expand All @@ -225,7 +226,7 @@ smooth_annotation!( #hide
Label(fig[1, 1, Bottom()], "Original") #hide
Label(fig[1, 2, Bottom()], "Transformed") #hide
plot!(fig[1, 2], reduced, layout=Spring(iterations=2000, C=40, seed=8); node_color=[red, orange, orange]) #hide
graphplot!(fig[1, 2], reduced, layout=Spring(iterations=2000, C=40, seed=8); node_color=[red, orange, orange]) #hide
fig #hide
```
Expand Down Expand Up @@ -262,7 +263,7 @@ smooth_annotation!( #hide
num_waves = 5, #hide
fluctuation_amplitude = 0.015, #hide
phase_shift = 0.0) #hide
plot!(fig[1, 1], tn, layout=Spring(iterations=10000, C=0.5, seed=12); node_color=[red, orange, orange]) #hide
graphplot!(fig[1, 1], tn, layout=Spring(iterations=10000, C=0.5, seed=12); node_color=[red, orange, orange]) #hide
smooth_annotation!( #hide
fig[1, 2]; #hide
Expand All @@ -279,7 +280,7 @@ smooth_annotation!( #hide
Label(fig[1, 1, Bottom()], "Original") #hide
Label(fig[1, 2, Bottom()], "Transformed") #hide
plot!(fig[1, 2], reduced, layout=Spring(iterations=10000, C=13, seed=151); node_color=[orange, orange, red, red, red]) #hide
graphplot!(fig[1, 2], reduced, layout=Spring(iterations=10000, C=13, seed=151); node_color=[orange, orange, red, red, red]) #hide
fig #hide
```
5 changes: 3 additions & 2 deletions docs/src/visualization.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

```@setup viz
using Makie
using GraphMakie
Makie.inline!(true)
set_theme!(resolution=(800,400))
Expand All @@ -14,10 +15,10 @@ using Tenet
`Tenet` provides a Package Extension for `Makie` support. You can just import a `Makie` backend and call [`Makie.plot`](@ref) on a [`TensorNetwork`](@ref).

```@docs
Makie.plot(::Tenet.TensorNetwork)
GraphMakie.graphplot(::Tenet.TensorNetwork)
```

```@example viz
tn = rand(TensorNetwork, 14, 4, seed=0) # hide
plot(tn, labels=true)
graphplot(tn, labels=true)
```

0 comments on commit e9464c3

Please sign in to comment.