Skip to content

Commit

Permalink
Merge branch 'master' into TimeEvolved-WindowsMPS
Browse files Browse the repository at this point in the history
Basis merge of master. The following things were hastily merged:

WindowArray (relax the vector typing?)
expectation value for window stuff
tests
  • Loading branch information
DaanMaertens committed Nov 28, 2024
2 parents 7fcf8a1 + 66d346e commit d61e8ba
Show file tree
Hide file tree
Showing 79 changed files with 7,319 additions and 2,718 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.6' # LTS version
- '1.8' # LTS version
- '1' # automatically expands to the latest stable 1.x release of Julia
os:
- ubuntu-latest
Expand All @@ -41,13 +41,13 @@ jobs:
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v1
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
env:
JULIA_NUM_THREADS: 4
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
- uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
Expand All @@ -71,7 +71,7 @@ jobs:
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v1
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
env:
Expand Down
41 changes: 34 additions & 7 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,45 @@
name: CompatHelper

on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:

permissions:
contents: write
pull-requests: write
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
- name: Check if Julia is already available in the PATH
id: julia_in_path
run: which julia
continue-on-error: true
- name: Install Julia, but only if it is not already available in the PATH
uses: julia-actions/setup-julia@v2
with:
version: '1'
arch: ${{ runner.arch }}
if: steps.julia_in_path.outcome != 'success'
- name: "Add the General registry via Git"
run: |
import Pkg
ENV["JULIA_PKG_SERVER"] = ""
Pkg.Registry.add("General")
shell: julia --color=yes {0}
- name: "Install CompatHelper"
run: |
import Pkg
name = "CompatHelper"
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
version = "3"
Pkg.add(; name, uuid, version)
shell: julia --color=yes {0}
- name: "Run CompatHelper"
run: |
import CompatHelper
CompatHelper.main()
shell: julia --color=yes {0}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
# COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
# COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
4 changes: 4 additions & 0 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Documentation

permissions:
contents: write
pages: write

on:
push:
branches:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ jobs:
code-style:
runs-on: ubuntu-latest
steps:
- uses: julia-actions/julia-format@v2
- uses: julia-actions/julia-format@v3
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
docs/build
Manifest.toml
.vscode
.DS_Store
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
repos:

- repo: https://github.com/qiaojunfeng/pre-commit-julia-format
rev: v0.2.0 # use the most recent version
hooks:
- id: julia-format # formatter for Julia code
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ title: "MPSKit"
version: 0.10.2
doi: 10.5281/zenodo.10654901
date-released: 2024-02-13
url: "https://github.com/maartenvd/MPSKit.jl"
url: "https://github.com/QuantumKitHub/MPSKit.jl"
10 changes: 5 additions & 5 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MPSKit"
uuid = "bb1c41ca-d63c-52ed-829e-0820dda26502"
authors = ["Maarten Van Damme", "Jutho Haegeman", "Lukas Devos", "Gertian Roose", "Markus Hauru", "Daan Maertens"]
version = "0.10.2"
version = "0.11.4"

[deps]
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
Expand All @@ -26,19 +26,19 @@ Accessors = "0.1"
FLoops = "0.1, 0.2"
FastClosures = "0.3"
FoldsThreads = "0.1"
KrylovKit = "0.4 - 0.7"
KrylovKit = "0.8.3"
LinearAlgebra = "1.6"
LoggingExtras = "1"
OptimKit = "0.3.1"
Preferences = "1"
Printf = "1"
RecipesBase = "1.1"
TensorKit = "0.12"
TensorKitManifolds = "0.5, 0.6"
TensorKitManifolds = "0.5, 0.6, 0.7"
TensorOperations = "4"
Transducers = "0.4"
VectorInterface = "0.2, 0.3, 0.4"
julia = "1.6"
VectorInterface = "0.2, 0.3, 0.4, 0.5"
julia = "1.8"

[extras]
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Expand Down
26 changes: 12 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<img src="https://github.com/maartenvd/MPSKit.jl/blob/master/docs/src/assets/logo.svg" width="150">
<img src="https://github.com/QuantumKitHub/MPSKit.jl/blob/master/docs/src/assets/logo.svg" width="150">

# MPSKit.jl

Expand All @@ -15,19 +15,19 @@ and matrix product operators (MPO), both finite and infinite.
| [![CI][ci-img]][ci-url] | [![PkgEval][pkgeval-img]][pkgeval-url] | [![Codecov][codecov-img]][codecov-url] |

[docs-stable-img]: https://img.shields.io/badge/docs-stable-blue.svg
[docs-stable-url]: https://maartenvd.github.io/MPSKit.jl/stable
[docs-stable-url]: https://QuantumKitHub.github.io/MPSKit.jl/stable

[docs-dev-img]: https://img.shields.io/badge/docs-dev-blue.svg
[docs-dev-url]: https://maartenvd.github.io/MPSKit.jl/dev
[docs-dev-url]: https://QuantumKitHub.github.io/MPSKit.jl/dev

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

[codecov-img]: https://codecov.io/gh/maartenvd/MPSKit.jl/branch/master/graph/badge.svg
[codecov-url]: https://codecov.io/gh/maartenvd/MPSKit.jl
[codecov-img]: https://codecov.io/gh/QuantumKitHub/MPSKit.jl/graph/badge.svg?token=rmp3bu7qn3
[codecov-url]: https://codecov.io/gh/QuantumKitHub/MPSKit.jl

[ci-img]: https://github.com/maartenvd/MPSKit.jl/actions/workflows/CI.yml/badge.svg
[ci-url]: https://github.com/maartenvd/MPSKit.jl/actions/workflows/CI.yml
[ci-img]: https://github.com/QuantumKitHub/MPSKit.jl/actions/workflows/CI.yml/badge.svg
[ci-url]: https://github.com/QuantumKitHub/MPSKit.jl/actions/workflows/CI.yml

[pkgeval-img]: https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/T/MPSKit.svg
[pkgeval-url]: https://JuliaCI.github.io/NanosoldierReports/pkgeval_badges/T/MPSKit.html
Expand All @@ -38,7 +38,7 @@ generic symmetries.

The toolbox contains different algorithms for finding MPS representations of groundstates or
leading boundary states, performing time evolution, finding excitations and much more. Check
out the [examples](https://maartenvd.github.io/MPSKit.jl/dev/examples/) for concrete
out the [examples](https://QuantumKitHub.github.io/MPSKit.jl/dev/examples/) for concrete
use-cases.

This package is under active development and new algorithms are added regularly.
Expand All @@ -57,13 +57,13 @@ Because of the heavy use of [TensorKit.jl](https://github.com/jutho/TensorKit.jl
recommended to install the latest version of this package as well. Additionally, several
extension packages exist that provide additional symmetries, which should all be compatible
with MPSKit. For example, to install the package with support for SU(N) symmetries,
[SUNRepresentations.jl](https://github.com/maartenvd/SUNRepresentations.jl) can be used.
[SUNRepresentations.jl](https://github.com/QuantumKitHub/SUNRepresentations.jl) can be used.

```julia-repl
pkg> add TensorKit
```

Finally, several pre-defined operators, hamiltonians and statistical mechanics models are available in [MPSKitModels.jl](https://github.com/maartenvd/MPSKitModels.jl). It is recommended to install this package too.
Finally, several pre-defined operators, hamiltonians and statistical mechanics models are available in [MPSKitModels.jl](https://github.com/QuantumKitHub/MPSKitModels.jl). It is recommended to install this package too.

```julia-repl
pkg> add MPSKitModels
Expand All @@ -84,12 +84,11 @@ D = 4 # bonddimension
init_state = FiniteMPS(L, ℂ^2, ℂ^D)

g_values = 0:0.1:2
Z = @mpoham sum(σᶻ(){i} for i in vertices(FiniteChain(L)))

M = @showprogress map(g_values) do g
H = periodic_boundary_conditions(transverse_field_ising(; g=g), L)
groundstate, environment, δ = find_groundstate(init_state, H; verbosity=0)
return abs(sum(expectation_value(groundstate, Z))) / L
return abs(sum(expectation_value(groundstate, i => σᶻ()) for i in 1:L)) / L
end

scatter(g_values, M, xlabel="g", ylabel="M", label="D=$D", title="Magnetization")
Expand All @@ -108,12 +107,11 @@ D = 4 # bonddimension
init_state = InfiniteMPS(ℂ^2, ℂ^D)

g_values = 0.1:0.1:2
Z = @mpoham sum(σᶻ(){i} for i in vertices(InfiniteChain()))

M = @showprogress map(g_values) do g
H = transverse_field_ising(; g=g)
groundstate, environment, δ = find_groundstate(init_state, H, VUMPS(; verbosity=0))
return abs(sum(expectation_value(groundstate, Z)))
return abs(expectation_value(groundstate, 1 => σᶻ()))
end

scatter(g_values, M, xlabel="g", ylabel="M", label="D=$D", title="Magnetization")
Expand Down
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ MPSKit = "bb1c41ca-d63c-52ed-829e-0820dda26502"
MPSKitModels = "ca635005-6f8c-4cd1-b51d-8491250ef2ab"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
TensorKit = "07d1fe3e-3e46-537d-9eac-e9e13d0d4cec"
TensorOperations = "6aa20fa7-93e2-5fca-9bc0-fbd0db3c71a2"

Expand Down
7 changes: 4 additions & 3 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ quantum_pages = map(readdir(joinpath(example_dir, "quantum1d"))) do dir
end

# include MPSKit in all doctests
DocMeta.setdocmeta!(MPSKit, :DocTestSetup, :(using MPSKit); recursive=true)
DocMeta.setdocmeta!(MPSKit, :DocTestSetup, :(using MPSKit, TensorKit); recursive=true)

mathengine = MathJax3(Dict(:loader => Dict("load" => ["[tex]/physics"]),
:tex => Dict("inlineMath" => [["\$", "\$"], ["\\(", "\\)"]],
Expand All @@ -38,9 +38,10 @@ makedocs(;
"man/operators.md",
"man/algorithms.md",
"man/environments.md",
"man/parallelism.md"],
"man/parallelism.md",
"man/lattices.md"],
"Examples" => "examples/index.md",
"Library" => "lib/lib.md"],
warnonly=true)

deploydocs(; repo="github.com/maartenvd/MPSKit.jl.git")
deploydocs(; repo="github.com/QuantumKitHub/MPSKit.jl.git")
53 changes: 53 additions & 0 deletions docs/src/assets/mpo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d61e8ba

Please sign in to comment.