Skip to content

Commit

Permalink
Merge pull request #10 from iitis/lp/docs-example
Browse files Browse the repository at this point in the history
Documentation
  • Loading branch information
lpawela committed Nov 20, 2020
2 parents 5825566 + 47d85e9 commit f1ffa5a
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 1 deletion.
23 changes: 23 additions & 0 deletions .github/workflows/Documenter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Documentation

on:
push:
branches:
- lp/docs-example
tags: '*'
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
with:
version: '1.5'
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.add("Documenter"); Pkg.add("DocumenterCitations"); Pkg.add(PackageSpec(path=pwd())); Pkg.instantiate();'
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: julia --project=docs/ docs/make.jl
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
*.npy
*.pdf
results
docs/build
4 changes: 4 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ Requires = "ae029012-a4dd-5104-9daa-d747884805df"
TensorCast = "02d47bb6-7ce6-556a-be16-bb1710789e2b"
TensorOperations = "6aa20fa7-93e2-5fca-9bc0-fbd0db3c71a2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
TensorOperations = "3.0.1"
julia = "1.4, 1.5"
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[![Docs](https://img.shields.io/badge/docs-dev-blue.svg)](https://iitis.github.io/SpinGlassPEPS.jl/dev/)
[![Build Status](https://travis-ci.org/iitis/SpinGlassPEPS.jl.svg?branch=master)](https://travis-ci.org/iitis/SpinGlassPEPS.jl)
[![Coverage Status](https://coveralls.io/repos/github/iitis/SpinGlassPEPS.jl/badge.svg?branch=master)](https://coveralls.io/github/iitis/SpinGlassPEPS.jl?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/iitis/SpinGlassPEPS.jl/badge.svg?branch=master)](https://coveralls.io/github/iitis/SpinGlassPEPS.jl?branch=master)
40 changes: 40 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
using Documenter, SpinGlassPEPS

format = Documenter.HTML(
edit_link = "master",
prettyurls = !("local" in ARGS),
mathengine = mathengine = MathJax3(Dict(
:tex=>Dict(
"inlineMath"=>[ ["\$","\$"], ["\\(","\\)"] ],
"processEscapes"=>true,
"macros"=>Dict(
"bra"=> ["{\\langle #1|}",1],
"ket"=> ["{| #1\\rangle}",1],
"ketbra"=> ["{\\left| #1 \\rangle \\langle #2 \\right|}",2],
"braket"=> ["{\\langle #1|#2\\rangle}",2],
"Tr"=> ["\\mathrm{Tr}",0],
"tr"=> ["\\Tr",0],
"ee"=> ["\\mathrm{e}"],
"ii"=> ["\\mathrm{i}"],
"dd"=> ["\\mathrm{d}"],
"1"=> ["{\\mathbb{1}}"]
)
)
))
)

makedocs(
clean = true,
format = format,
sitename = "SpinGlassPEPS.jl",
authors = "Krzysztof Domino, Bartłomiej Gardas, Konrad Jałowiecki, Łukasz Pawela, Marek Rams",
pages = [
"Home" => "index.md",
"Library" => "lib/SpinGlassPEPS.md"
]
)

deploydocs(
repo = "github.com/iitis/SpinGlassPEPS.jl.git",
devbranch = "lp/docs-example"
)
7 changes: 7 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```@meta
Author = "Krzysztof Domino, Bartłomiej Gardas, Konrad Jałowiecki, Łukasz Pawela, Marek Rams"
```

# Home

A Julia package for numerical computation in quantum information theory.
14 changes: 14 additions & 0 deletions docs/src/lib/SpinGlassPEPS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Documentation


## Index

A list of all documentation sorted by module.

```@index
```


```@autodocs
Modules = [SpinGlassPEPS]
```
3 changes: 3 additions & 0 deletions src/contractions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ function right_env(ϕ::MPS, ψ::MPS)
R
end


"""
$(TYPEDSIGNATURES)
Expand All @@ -89,6 +90,7 @@ Calculates the matrix element of \$O\$
```
in one pass, utlizing `TensorOperations`.
"""

function LinearAlgebra.dot::MPS, O::Union{Vector, NTuple}, ψ::MPS) #where T <: AbstractMatrix
S = promote_type(eltype(ψ), eltype(ϕ), eltype(O[1]))
C = ones(S, 1, 1)
Expand All @@ -102,6 +104,7 @@ function LinearAlgebra.dot(ϕ::MPS, O::Union{Vector, NTuple}, ψ::MPS) #where T
tr(C)
end


function LinearAlgebra.dot(O::AbstractMPO, ψ::T) where {T <: AbstractMPS}
L = length(ψ)
S = promote_type(eltype(ψ), eltype(O))
Expand Down

0 comments on commit f1ffa5a

Please sign in to comment.