-
Notifications
You must be signed in to change notification settings - Fork 126
Add write-to-disk during DMRG with SerializedElementArrays.jl
#648
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
dafdd2a
Add write-to-disk during DMRG with SerializedElementArrays
mtfishman c86e823
Format
mtfishman 76967cd
Do a bit better with memory caching during write-to-disk
mtfishman 1356eda
Merge branch 'main' into write_to_disk
mtfishman 65700fc
Add SerializedElementArrays as a dependency
mtfishman 8e34f23
Change master to main in docs and CI workflows
mtfishman 73ce2aa
Change benchmark CI baseline from master to main branch
mtfishman 0378ad0
Fix keyword argument type declaration
mtfishman 19bc224
Formatting
mtfishman bc32b99
Formatting, remove setting BLAS threads from write-to-disk DMRG example
mtfishman e454452
Improve caching in makeL and makeR
mtfishman cc27773
Start adding OneITensor to simplify code logic
mtfishman 398fc54
Simplify makeL logic a little bit
mtfishman 2557ae7
Clean up and fix more ProjMPO code, like noise term, eltype, size, etc.
mtfishman cab003c
Merge branch 'main' into write_to_disk
mtfishman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ jobs: | |
- name: Install dependencies | ||
run: julia -e 'using Pkg; pkg"add PkgBenchmark [email protected]"' | ||
- name: Run benchmarks | ||
run: julia -e 'using BenchmarkCI; BenchmarkCI.judge()' | ||
run: julia -e 'using BenchmarkCI; BenchmarkCI.judge(; baseline="origin/main")' | ||
- name: Post results | ||
run: julia -e 'using BenchmarkCI; BenchmarkCI.postjudge()' | ||
env: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name: Documentation | |
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
tags: '*' | ||
pull_request: | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name: format-check | |
on: | ||
push: | ||
branches: | ||
- 'master' | ||
- 'main' | ||
- 'release-' | ||
tags: '*' | ||
pull_request: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ name: Tests | |
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
tags: '*' | ||
pull_request: | ||
jobs: | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
*.o | ||
*.swp | ||
.tmp | ||
benchmark/mult | ||
Manifest.toml | ||
test/data.h5 | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
using ITensors | ||
using ITensors.Strided | ||
using LinearAlgebra | ||
using Printf | ||
using Random | ||
|
||
Random.seed!(1234) | ||
BLAS.set_num_threads(1) | ||
Strided.set_num_threads(1) | ||
|
||
let | ||
N = 100 | ||
|
||
sites = siteinds("S=1", N; conserve_qns=true) | ||
|
||
ampo = AutoMPO() | ||
for j in 1:(N - 1) | ||
ampo .+= 0.5, "S+", j, "S-", j + 1 | ||
ampo .+= 0.5, "S-", j, "S+", j + 1 | ||
ampo .+= "Sz", j, "Sz", j + 1 | ||
end | ||
H = MPO(ampo, sites) | ||
|
||
# This step makes the MPO more sparse. | ||
# It generally improves DMRG performance | ||
# at large bond dimensions but makes DMRG slower at | ||
# small bond dimensions. | ||
H = splitblocks(linkinds, H) | ||
|
||
state = [isodd(n) ? "Up" : "Dn" for n in 1:N] | ||
psi0 = randomMPS(sites, state, 10) | ||
|
||
# Plan to do 5 DMRG sweeps: | ||
sweeps = Sweeps(5) | ||
# Set maximum MPS bond dimensions for each sweep | ||
setmaxdim!(sweeps, 10, 20, 100, 100, 200) | ||
# Set maximum truncation error allowed when adapting bond dimensions | ||
setcutoff!(sweeps, 1E-10) | ||
@show sweeps | ||
|
||
# Run the DMRG algorithm, returning energy and optimized MPS | ||
energy, psi = dmrg(H, psi0, sweeps; write_when_maxdim_exceeds=25) | ||
@printf("Final energy = %.12f\n", energy) | ||
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.