Skip to content

Commit

Permalink
Merge branch 'master' into compathelper/new_version/2024-07-16-01-03-…
Browse files Browse the repository at this point in the history
…33-194-02569453628
  • Loading branch information
pbrehmer authored Jan 21, 2025
2 parents fa3bd1c + 1782beb commit 89b7499
Show file tree
Hide file tree
Showing 64 changed files with 6,403 additions and 1,867 deletions.
49 changes: 0 additions & 49 deletions .github/workflows/CI.yml

This file was deleted.

41 changes: 4 additions & 37 deletions .github/workflows/FormatCheck.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,14 @@
name: FormatCheck
name: "Format Check"

on:
push:
branches:
- 'main'
- 'master'
- 'release-'
tags: '*'
pull_request:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
version:
- '1' # automatically expands to the latest stable 1.x release of Julia
os:
- ubuntu-latest
arch:
- x64
steps:
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}

- uses: actions/checkout@v4
- name: Install JuliaFormatter and format
# This will use the latest version by default but you can set the version like so:
#
# julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter", version="0.13.0"))'
run: |
julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))'
julia -e 'using JuliaFormatter; format(".", verbose=true)'
- name: Format check
run: |
julia -e '
out = Cmd(`git diff --name-only`) |> read |> String
if out == ""
exit(0)
else
@error "Some files have not been formatted !!!"
write(stdout, out)
exit(1)
end'
format-check:
name: "Format Check"
uses: "QuantumKitHub/.github/.github/workflows/formatcheck.yml@main"
44 changes: 44 additions & 0 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Tests
on:
push:
branches:
- 'master'
- 'main'
- 'release-'
tags: '*'
paths-ignore:
- 'docs/**'
pull_request:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
# Cancel intermediate builds: only if it is a pull request build.
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
tests:
name: "Tests"
strategy:
fail-fast: false
matrix:
version:
- 'lts' # minimal supported version
- '1' # latest released Julia version
group:
- ctmrg
- boundarymps
- examples
- utility
os:
- ubuntu-latest
- macOS-latest
- windows-latest
uses: "QuantumKitHub/QuantumKitHubActions/.github/workflows/Tests.yml@main"
with:
group: "${{ matrix.group }}"
julia-version: "${{ matrix.version }}"
os: "${{ matrix.os }}"
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
docs/build
Manifest.toml
examples/.ipynb_checkpoints
.vscode/
.vscode/
.DS_Store
18 changes: 18 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: Brehmer
given-names: Paul
orcid: https://orcid.org/0009-0007-9953-2929
- family-names: "Burgelman"
given-names: "Lander"
orcid: "https://orcid.org/0000-0003-1724-5330"
- family-names: "Devos"
given-names: "Lukas"
orcid: "https://orcid.org/0000-0002-0256-4200"
title: "PEPSKit"
version: 0.2.2
identifiers:
- type: doi
value: 10.5281/zenodo.13938737
date-released: 2021-10-16
21 changes: 15 additions & 6 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
name = "PEPSKit"
uuid = "52969e89-939e-4361-9b68-9bc7cde4bdeb"
authors = ["Maarten Vandamme", "Paul Brehmer", "Lander Burgelman", "Rui-Zhen Huang", "Daan Maertens", "Lukas Devos <[email protected]"]
version = "0.1.0"
authors = ["Paul Brehmer", "Lander Burgelman", "Lukas Devos <[email protected]>"]
version = "0.3.0"

[deps]
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LoggingExtras = "e6f89c97-d47a-5376-807f-9c37f3926c36"
MPSKit = "bb1c41ca-d63c-52ed-829e-0820dda26502"
MPSKitModels = "ca635005-6f8c-4cd1-b51d-8491250ef2ab"
OhMyThreads = "67456a42-1dca-4109-a031-0a68de7e3ad5"
OptimKit = "77e91f04-9b3b-57a6-a776-40b61faaebe0"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand All @@ -24,24 +27,30 @@ Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
Accessors = "0.1"
ChainRulesCore = "1.0"
Compat = "3.46, 4.2"
FiniteDifferences = "0.12"
KrylovKit = "0.8"
LinearAlgebra = "1"
LoggingExtras = "1"
MPSKit = "0.11"
MPSKitModels = "0.3.5"
OhMyThreads = "0.7"
OptimKit = "0.3"
Printf = "1"
QuadGK = "2.11.1"
Random = "1"
Statistics = "1"
TensorKit = "0.12.5"
TensorOperations = "4, 5"
VectorInterface = "0.4"
TensorOperations = "5"
VectorInterface = "0.4, 0.5"
Zygote = "0.6"
julia = "1.9"
julia = "1.10"

[extras]
ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc"
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "SafeTestsets", "ChainRulesTestUtils", "FiniteDifferences"]
test = ["Test", "SafeTestsets", "ChainRulesTestUtils", "FiniteDifferences", "QuadGK"]
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

# PEPSKit.jl

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

[docs-dev-img]: https://img.shields.io/badge/docs-dev-blue.svg
[docs-dev-url]: https://QuantumKitHub.github.io/PEPSKit.jl/dev/
Expand All @@ -15,6 +15,9 @@

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

[doi-url]: https://doi.org/10.5281/zenodo.13938736
[doi-img]: https://zenodo.org/badge/DOI/10.5281/zenodo.13938737.svg

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

It contracts, it optimizes, it may break.
Expand All @@ -36,18 +39,17 @@ For example, in order to obtain the groundstate of the 2D Heisenberg model, we c
using TensorKit, PEPSKit, KrylovKit, OptimKit

# constructing the Hamiltonian:
H = square_lattice_heisenberg(; Jx=-1, Jy=1, Jz=-1) # sublattice rotation to obtain single-site unit cell
H = heisenberg_XYZ(InfiniteSquare(); Jx=-1, Jy=1, Jz=-1) # sublattice rotation to obtain single-site unit cell

# configuring the parameters
D = 2
chi = 20
ctm_alg = CTMRG(; tol=1e-10, miniter=4, maxiter=100, verbosity=1, trscheme=truncdim(chi))
ctm_alg = SimultaneousCTMRG(; tol=1e-10, trscheme=truncdim(chi))
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),
gradient_alg=LinSolver(),
reuse_env=true,
verbosity=2,
)

# ground state search
Expand Down
7 changes: 3 additions & 4 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,17 @@ For example, in order to obtain the groundstate of the 2D Heisenberg model, we c
using TensorKit, PEPSKit, KrylovKit, OptimKit

# constructing the Hamiltonian:
H = square_lattice_heisenberg(; Jx=-1, Jy=1, Jz=-1) # sublattice rotation to obtain single-site unit cell
H = heisenberg_XYZ(InfiniteSquare(); Jx=-1, Jy=1, Jz=-1) # sublattice rotation to obtain single-site unit cell

# configuring the parameters
D = 2
chi = 20
ctm_alg = CTMRG(; tol=1e-10, miniter=4, maxiter=100, verbosity=1, trscheme=truncdim(chi))
ctm_alg = SimultaneousCTMRG(; tol=1e-10, trscheme=truncdim(chi))
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),
gradient_alg=LinSolver(),
reuse_env=true,
verbosity=2,
)

# ground state search
Expand Down
8 changes: 6 additions & 2 deletions examples/boundary_mps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ mps, envs, ϵ = leading_boundary(mps, T, VUMPS())
N = abs(prod(expectation_value(mps, T)))

# This can be compared to the result obtained using the CTMRG algorithm
ctm = leading_boundary(peps, CTMRG(; verbosity=1), CTMRGEnv(peps, ComplexSpace(20)))
ctm = leading_boundary(
peps, SimultaneousCTMRG(; verbosity=1), CTMRGEnv(peps, ComplexSpace(20))
)
= abs(norm(peps, ctm))

@show abs(N - N´) / N
Expand All @@ -53,7 +55,9 @@ mps2 = PEPSKit.initializeMPS(T2, fill(ComplexSpace(20), 2, 2))
mps2, envs2, ϵ = leading_boundary(mps2, T2, VUMPS())
N2 = abs(prod(expectation_value(mps2, T2)))

ctm2 = leading_boundary(peps2, CTMRG(; verbosity=1), CTMRGEnv(peps2, ComplexSpace(20)))
ctm2 = leading_boundary(
peps2, SimultaneousCTMRG(; verbosity=1), CTMRGEnv(peps2, ComplexSpace(20))
)
N2´ = abs(norm(peps2, ctm2))

@show abs(N2 - N2´) / N2
Expand Down
7 changes: 3 additions & 4 deletions examples/heisenberg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@ using PEPSKit, KrylovKit
# We use the parameters (J₁, J₂, J₃) = (-1, 1, -1) by default to capture
# the ground state in a single-site unit cell. This can be seen from
# sublattice rotating H from parameters (1, 1, 1) to (-1, 1, -1).
H = square_lattice_heisenberg(; Jx=-1, Jy=1, Jz=-1)
H = heisenberg_XYZ(InfiniteSquare(); Jx=-1, Jy=1, Jz=-1)

# Parameters
χbond = 2
χenv = 20
ctm_alg = CTMRG(; tol=1e-10, miniter=4, maxiter=100, verbosity=1, trscheme=truncdim(χenv))
ctm_alg = SimultaneousCTMRG(; tol=1e-10, verbosity=2)
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),
gradient_alg=LinSolver(; solver=GMRES(; tol=1e-6, maxiter=100)),
reuse_env=true,
verbosity=2,
)

# Ground state search
Expand Down
Loading

0 comments on commit 89b7499

Please sign in to comment.