Optimize fermions#1713
Merged
Merged
Conversation
Member
Author
|
The time overhead is now down to about 5-10% for a Hubbard model DMRG calculation on a length 10 chain with 6 sweeps ramping up to a bond dimension of 200, and the allocation overhead is minimal. The overhead decreases with larger bond dimensions (or more specifically, larger block dimensions) and system sizes. Some example runs for that case: julia> @time mps_dmrg_bench(; use_auto_fermion = false)
mps.maxlinkdim(H_mps) = 6
After sweep 1 energy=-11.969543558445253 maxlinkdim=10 maxerr=1.49E-03 time=0.034
After sweep 2 energy=-12.116369527016067 maxlinkdim=20 maxerr=1.37E-04 time=0.128
After sweep 3 energy=-12.118011427386474 maxlinkdim=40 maxerr=1.14E-05 time=0.213
After sweep 4 energy=-12.118221850986792 maxlinkdim=80 maxerr=5.02E-08 time=0.260
After sweep 5 energy=-12.118222536641227 maxlinkdim=160 maxerr=2.75E-10 time=0.323
After sweep 6 energy=-12.118222538380001 maxlinkdim=200 maxerr=9.94E-11 time=0.359
DMRG energy = -12.118222538380001
1.325985 seconds (14.83 M allocations: 2.267 GiB, 12.80% gc time)
julia> @time mps_dmrg_bench(; use_auto_fermion = true)
mps.maxlinkdim(H_mps) = 6
After sweep 1 energy=-11.96954355844525 maxlinkdim=10 maxerr=1.49E-03 time=0.031
After sweep 2 energy=-12.116369527016055 maxlinkdim=20 maxerr=1.37E-04 time=0.135
After sweep 3 energy=-12.118011427386506 maxlinkdim=40 maxerr=1.14E-05 time=0.231
After sweep 4 energy=-12.118221850986796 maxlinkdim=80 maxerr=5.02E-08 time=0.275
After sweep 5 energy=-12.11822253664123 maxlinkdim=160 maxerr=2.75E-10 time=0.341
After sweep 6 energy=-12.118222538379994 maxlinkdim=200 maxerr=9.94E-11 time=0.373
DMRG energy = -12.118222538379994
1.392076 seconds (14.83 M allocations: 2.298 GiB, 10.65% gc time) |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related to #1712, these are all of the optimizations that AI came up with. This version removes all extra allocations in the fermion code.
Closes #1709, closes #1712.