Skip to content

Commit

Permalink
semi docs
Browse files Browse the repository at this point in the history
  • Loading branch information
annamariadziubyna committed Jun 16, 2021
1 parent d460eeb commit 75562ed
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 9 deletions.
1 change: 1 addition & 0 deletions Project.toml
Expand Up @@ -4,6 +4,7 @@ version = "0.2.0"

[deps]
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0"
Expand Down
6 changes: 6 additions & 0 deletions docs/Project.toml
Expand Up @@ -3,4 +3,10 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
SpinGlassEngine = "0563570f-ea1b-4080-8a64-041ac6565a4e"
SpinGlassNetworks = "b7f6bd3e-55dc-4da6-96a9-ef9dbec6ac19"
SpinGlassPEPS = "2c514f87-1261-494e-8566-326879aaf4fe"
SpinGlassTensors = "7584fc6a-5a23-4eeb-8277-827aab0146ea"

[compat]
SpinGlassEngine = "0.1"
SpinGlassNetworks = "0.1"
SpinGlassTensors = "0.1"
9 changes: 5 additions & 4 deletions docs/make.jl
Expand Up @@ -57,10 +57,11 @@ makedocs(
"Home" => "index.md",
"Contents" => "contents.md",
"Examples" => "examples.md",
"Library" => ["Index" => "lib/SpinGlassPEPS.md",
"SpinGlassEngine" => "lib/SpinGlassEngine.md",
"SpinGlassTensors" => "lib/SpinGlassTensors.md",
"SpinGlassNetwork" => "lib/SpinGlassNetwork.md"]
"Index" => "lib/SpinGlassPEPS.md"
#"Library" => ["Index" => "lib/SpinGlassPEPS.md"],
# "SpinGlassEngine" => "lib/SpinGlassEngine.md",
# "SpinGlassTensors" => "lib/SpinGlassTensors.md",
# "SpinGlassNetwork" => "lib/SpinGlassNetwork.md"]
]
)

Expand Down
Binary file added docs/src/assets/images/pathological.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/src/contents.md
Expand Up @@ -25,6 +25,9 @@ SpinGlassNetworks.ising_graph
SpinGlassNetworks.gibbs_tensor
```
```@docs
SpinGlassTensors.left_env
```
```@docs
SpinGlassNetworks.energy
```
```@docs
Expand Down
4 changes: 2 additions & 2 deletions docs/src/examples.md
Expand Up @@ -8,7 +8,7 @@ E = -\sum_{<i,j> \in \mathcal{E}} J_{ij} s_i s_j - \sum_j h_i s_j.
```
where ``s`` is a configuration of ``N`` classical spins taking values ``s_i = \pm 1``
and ``J_{ij}, h_i \in \mathbb{R}`` are input parameters of a given problem instance.
Nonzero couplings ``J_{ij}`` form a graph ``\mathcal{E}``.
Nonzero couplings ``J_{ij}`` form a graph ``\mathcal{E}``. Edges of ``\mathcal{E}`` form a quasi-two-dimensional structure, where we focus in particular on the chimera graph with up to 2048 spins.


## Finding structure of low energy states
Expand All @@ -18,7 +18,7 @@ E = -1.0 \cdot s_1 \cdot s_2 + 0.5 \cdot s_1 + 0.75 \cdot s_2
```
In two-spin system we have four possible states: ``[-1, -1], [1, 1], [1, -1], [-1, 1]`` with energies ``-2.25, 0.25, 0.75, 1.25`` respectively.

We can calculate it using `SpinGlassPEPS`. First we define model's parameters, grid and control parameters such as `num_states` - maximal number of low energy states to be found. Then we are ready to create `ising_graph` using grid defined before.
We can calculate spectrum using `SpinGlassPEPS`. First we define model's parameters, grid and control parameters such as `num_states` - maximal number of low energy states to be found. Then we are ready to create Ising spin-glass model by`ising_graph` using grid defined before.


```jldoctest
Expand Down
79 changes: 78 additions & 1 deletion docs/src/index.md
Expand Up @@ -3,6 +3,9 @@ Author = "Krzysztof Domino, Bartłomiej Gardas, Konrad Jałowiecki, Łukasz Pawe
```

# Welcome to SpinGlassPEPS documentation!
![CI](https://github.com/iitis/SpinGlassPEPS.jl/workflows/CI/badge.svg?branch=master)
[![version](https://juliahub.com/docs/SpinGlassPEPS/version.svg)](https://juliahub.com/ui/Packages/SpinGlassPEPS/bUwXr)

## Home
`SpinGlassPEPS` is an open-source Julia package for numerical computation in quantum information theory.

Expand All @@ -27,6 +30,70 @@ The package `SpinGlassPEPS` includes:
## Quick example
Let us consider optimization problem defined on a pathological instance defined as follows.

![summary_time](../assets/images/pathological.png)

```@raw html
<img src="../assets/images/pathological.png" width="25%"/>
```

```{execute="false"}
Pkg.add("GraphPlot")
```

```julia
using GraphPlot
```

```julia
using LightGraphs
using PlotRecipes
using Colors


# construct a simple undirected graph
g = SimpleGraph(36)
add_edge!(g, 1, 4)
add_edge!(g, 1, 5)
add_edge!(g, 1, 6)
add_edge!(g, 4, 7)
add_edge!(g, 4, 6)
add_edge!(g, 5, 16)
add_edge!(g, 6, 16)
add_edge!(g, 5, 7)
add_edge!(g, 6, 8)
add_edge!(g, 6, 9)
add_edge!(g, 6, 18)
add_edge!(g, 16, 18)
add_edge!(g, 1, 13)
add_edge!(g, 13, 16)
add_edge!(g, 13, 18)
add_edge!(g, 18, 28)
add_edge!(g, 28, 29)
add_edge!(g, 29, 30)
add_edge!(g, 28, 30)
add_edge!(g, 28, 31)
add_edge!(g, 28, 32)
add_edge!(g, 28, 33)
add_edge!(g, 29, 31)
add_edge!(g, 29, 32)
add_edge!(g, 29, 33)
add_edge!(g, 30, 31)
add_edge!(g, 30, 32)
add_edge!(g, 30, 33)

nodelabel = collect(1:36)
#num_vertices(g)
membership = [1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7,8,8,8,9,9,9,10, 10, 10, 11, 11,11,12,12,12]
#nodecolor = [colorant"lightseagreen", colorant"orange"]
nodecolor = [RGBA(0.0,0.8,0.8,i) for i in 1:12]
# membership color
nodefillc = nodecolor[membership]
gplot(g, nodefillc=nodefillc, nodelabel=nodelabel)
# just plot it
#gplot(g)

```

We can find a ground state of this instance using SpinGlassPEPS interface via the procedure below.

```jldoctest
Expand Down Expand Up @@ -78,4 +145,14 @@ We aim to provide fast, reliable and easy to use emulator of D-Wave ``2000``Q qu
## Citing SpinGlassPEPS
If you use `SpinGlassPEPS` for academic research and wish to cite it, please use the following paper:

K. Jałowiecki, K. Domino, A. M. Dziubyna, M. M. Rams, B. Gardas and Ł. Pawela, *“SpinGlassPEPS.jl: software to emulate quantum annealing processors”*
K. Jałowiecki, K. Domino, A. M. Dziubyna, M. M. Rams, B. Gardas and Ł. Pawela, *“SpinGlassPEPS.jl: software to emulate quantum annealing processors”*

## Contributing
Contributions are always welcome:
* Please report any issues and bugs that you encounter in Issues
* Questions about `SpinGlassPEPS.jl` can be asked by directly opening up an Issue on its GitHub page
* If you plan to contribute new features, extensions, bug fixes, etc, please first open an issue and discuss the feature with us.

!!! info "Report the bug"
Filling an issue to report a bug, counterintuitive behavior, or even to request a feature is extremely valuable in helping us prioritize what to work on, so don't hestitate.

3 changes: 1 addition & 2 deletions docs/src/lib/SpinGlassPEPS.md
@@ -1,6 +1,5 @@
# Documentation


## Index

A list of all documentation sorted by module.
Expand All @@ -10,5 +9,5 @@ A list of all documentation sorted by module.


```@autodocs
Modules = [SpinGlassPEPS, SpinGlassTensors, SpinGlassNetwork, SpinGlassEngine]
Modules = [SpinGlassPEPS, SpinGlassTensors, SpinGlassNetworks, SpinGlassEngine]
```

0 comments on commit 75562ed

Please sign in to comment.