Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.

Commit

Permalink
Init docs skeleton
Browse files Browse the repository at this point in the history
  • Loading branch information
mofeing committed Nov 3, 2023
1 parent 8e8d704 commit f8bd062
Show file tree
Hide file tree
Showing 6 changed files with 162 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[deps]
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a"
NetworkLayout = "46757867-2c16-5918-afeb-47bfcb05e46a"

[compat]
Documenter = "1"
26 changes: 26 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Pkg
Pkg.activate(@__DIR__)
Pkg.develop(path = joinpath(@__DIR__, ".."))
Pkg.instantiate()

using Documenter
using Qrochet

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

makedocs(
modules = [Qrochet],
sitename = "Tenet.jl",
authors = "Sergio Sánchez Ramírez and contributors",
pages = Any[
"Home"=>"index.md",
"Matrix Product States (MPS)"=>"quantum/mps.md",
"Projected Entangled Pair States (PEPS)"=>"quantum/peps.md",
],
format = Documenter.HTML(prettyurls = false, assets = ["assets/youtube.css"]),
plugins = [],
checkdocs = :exports,
warnonly = true,
)

deploydocs(repo = "github.com/bsc-quantic/Qrochet.jl.git", devbranch = "master", push_preview = true)
6 changes: 6 additions & 0 deletions docs/src/assets/youtube.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.youtube-video {
margin-left: auto;
margin-right: auto;
text-align: center;
height: 315px;
}
12 changes: 12 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Qrochet.jl

!!! info "BSC-Quantic's Registry"
`Tenet` and some of its dependencies are located in our [own Julia registry](https://github.com/bsc-quantic/Registry).
In order to download `Tenet`, add our registry to your Julia installation by using the [Pkg mode](https://docs.julialang.org/en/v1/stdlib/REPL/#Pkg-mode) in a REPL session,

```julia
using Pkg
pkg"registry add https://github.com/bsc-quantic/Registry"
```

`Qrochet` is a quantum tensor network library based on [`Tenet`](https://github.com/bsc-quantic/Tenet.jl).
58 changes: 58 additions & 0 deletions docs/src/mps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Matrix Product States (MPS)

Matrix Product States (MPS) are a Quantum Tensor Network ansatz whose tensors are laid out in a 1D chain.
Due to this, these networks are also known as _Tensor Trains_ in other mathematical fields.
Depending on the boundary conditions, the chains can be open or closed (i.e. periodic boundary conditions).

```@setup viz
using Makie
Makie.inline!(true)
set_theme!(resolution=(800,200))
using CairoMakie
using Qrochet
using NetworkLayout
```

```@example viz
fig = Figure() # hide
tn_open = rand(MatrixProduct{State,Open}, n=10, χ=4) # hide
tn_periodic = rand(MatrixProduct{State,Periodic}, n=10, χ=4) # hide
plot!(fig[1,1], tn_open, layout=Spring(iterations=1000, C=0.5, seed=100)) # hide
plot!(fig[1,2], tn_periodic, layout=Spring(iterations=1000, C=0.5, seed=100)) # hide
Label(fig[1,1, Bottom()], "Open") # hide
Label(fig[1,2, Bottom()], "Periodic") # hide
fig # hide
```

## Matrix Product Operators (MPO)

Matrix Product Operators (MPO) are the operator version of [Matrix Product State (MPS)](#matrix-product-states-mps).
The major difference between them is that MPOs have 2 indices per site (1 input and 1 output) while MPSs only have 1 index per site (i.e. an output).

```@example viz
fig = Figure() # hide
tn_open = rand(MatrixProduct{Operator,Open}, n=10, χ=4) # hide
tn_periodic = rand(MatrixProduct{Operator,Periodic}, n=10, χ=4) # hide
plot!(fig[1,1], tn_open, layout=Spring(iterations=1000, C=0.5, seed=100)) # hide
plot!(fig[1,2], tn_periodic, layout=Spring(iterations=1000, C=0.5, seed=100)) # hide
Label(fig[1,1, Bottom()], "Open") # hide
Label(fig[1,2, Bottom()], "Periodic") # hide
fig # hide
```

In `Tenet`, the generic `MatrixProduct` ansatz implements this topology. Type variables are used to address their functionality (`State` or `Operator`) and their boundary conditions (`Open` or `Periodic`).

```@docs
MatrixProduct
MatrixProduct(::Any)
```
52 changes: 52 additions & 0 deletions docs/src/peps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Projected Entangled Pair States (PEPS)

Projected Entangled Pair States (PEPS) are a Quantum Tensor Network ansatz whose tensors are laid out in a 2D lattice. Depending on the boundary conditions, the chains can be open or closed (i.e. periodic boundary conditions).

```@setup viz
using Makie
Makie.inline!(true)
set_theme!(resolution=(800,400))
using CairoMakie
CairoMakie.activate!(type = "svg")
using Qrochet
using NetworkLayout
```

```@example viz
fig = Figure() # hide
tn_open = rand(PEPS{Open}, rows=10, cols=10, χ=4) # hide
tn_periodic = rand(PEPS{Periodic}, rows=10, cols=10, χ=4) # hide
plot!(fig[1,1], tn_open, layout=Stress(seed=1)) # hide
plot!(fig[1,2], tn_periodic, layout=Stress(seed=10,dim=2,iterations=100000)) # hide
Label(fig[1,1, Bottom()], "Open") # hide
Label(fig[1,2, Bottom()], "Periodic") # hide
fig # hide
```

## Projected Entangled Pair Operators (PEPO)

```@example viz
fig = Figure() # hide
tn_open = rand(PEPO{Open}, rows=10, cols=10, χ=4) # hide
tn_periodic = rand(PEPO{Periodic}, rows=10, cols=10, χ=4) # hide
plot!(fig[1,1], tn_open, layout=Stress(seed=1)) # hide
plot!(fig[1,2], tn_periodic, layout=Stress(seed=10,dim=2,iterations=100000)) # hide
Label(fig[1,1, Bottom()], "Open") # hide
Label(fig[1,2, Bottom()], "Periodic") # hide
fig # hide
```

```@docs
ProjectedEntangledPair
ProjectedEntangledPair(::Any)
```

0 comments on commit f8bd062

Please sign in to comment.