Skip to content

Commit

Permalink
Update actions and docs index page (#32)
Browse files Browse the repository at this point in the history
* Update coverage and documentation CI

* Update docs index page to reflect new README
  • Loading branch information
leburgel authored May 17, 2024
1 parent bc2dd93 commit 798814d
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
JULIA_NUM_THREADS: 4
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
if: always()
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,4 @@ jobs:
- name: Build and deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # For authentication with GitHub Actions token
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} # For authentication with SSH deploy key
run: julia --project=docs/ docs/make.jl
58 changes: 57 additions & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,61 @@
# PEPSKit.jl

[![docs][docs-dev-img]][docs-dev-url] ![CI][ci-url] [![codecov][codecov-img]][codecov-url]

[docs-dev-img]: https://img.shields.io/badge/docs-dev-blue.svg
[docs-dev-url]: https://quantumghent.github.io/PEPSKit.jl/dev/

[codecov-img]: https://codecov.io/gh/quantumghent/PEPSKit.jl/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/quantumghent/PEPSKit.jl

[ci-url]: https://github.com/quantumghent/PEPSKit.jl/workflows/CI/badge.svg

**Tools for working with projected entangled-pair states**

It contracts, it optimizes, it may be broken at any point.
It contracts, it optimizes, it may break.

## Installation

The package can be installed through the Julia general registry, via the package manager:

```julia-repl
pkg> add PEPSKit
```

## Quickstart

After following the installation process, it should now be possible to load the packages and start simulating.
For example, in order to obtain the groundstate of the 2D Heisenberg model, we can use the following code:

```julia
using TensorKit, PEPSKit, KrylovKit, OptimKit

# constructing the Hamiltonian:
Jx, Jy, Jz = (-1, 1, -1) # sublattice rotation to obtain single-site unit cell
physical_space = ComplexSpace(2)
T = ComplexF64
σx = TensorMap(T[0 1; 1 0], physical_space, physical_space)
σy = TensorMap(T[0 im; -im 0], physical_space, physical_space)
σz = TensorMap(T[1 0; 0 -1], physical_space, physical_space)
H = (Jx * σx σx) + (Jy * σy σy) + (Jz * σz σz)
Heisenberg_hamiltonian = NLocalOperator{NearestNeighbor}(H / 4)

# configuring the parameters
D = 2
chi = 20
ctm_alg = CTMRG(; trscheme = truncdim(chi), tol=1e-20, miniter=4, maxiter=100, verbosity=1)
opt_alg = PEPSOptimize(;
boundary_alg=ctm_alg,
optimizer=LBFGS(4; maxiter=100, gradtol=1e-4, verbosity=2),
gradient_alg=GMRES(; tol=1e-6, maxiter=100),
reuse_env=true,
verbosity=2,
)

# ground state search
state = InfinitePEPS(2, D)
ctm = leading_boundary(CTMRGEnv(state; Venv=ComplexSpace(chi)), state, ctm_alg)
result = fixedpoint(state, Heisenberg_hamiltonian, opt_alg, ctm)

@show result.E # -0.6625...
```

0 comments on commit 798814d

Please sign in to comment.