Skip to content

Commit d075f60

Browse files
committed
Simplify and fix issue with densitymatrix subspace expansion by having it take truncation parameters from factorize_kwargs.
1 parent 6aad2cd commit d075f60

4 files changed

Lines changed: 8 additions & 6 deletions

File tree

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "ITensorNetworks"
22
uuid = "2919e153-833c-4bdc-8836-1ea460a35fc7"
33
authors = ["Matthew Fishman <mfishman@flatironinstitute.org>, Joseph Tindall <jtindall@flatironinstitute.org> and contributors"]
4-
version = "0.15.5"
4+
version = "0.15.6"
55

66
[deps]
77
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"

src/solvers/eigsolve.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ function eigsolve(
6767
nsweeps;
6868
nsites,
6969
factorize_kwargs,
70-
subspace_expand!_kwargs = (; eigen_kwargs = factorize_kwargs),
7170
sweep_kwargs...,
7271
)
7372
prob = problem(sweep_solve!(sweep_iter))

src/solvers/subspace/densitymatrix.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ function subspace_expand!(
88
expansion_factor = 1.5,
99
maxexpand = typemax(Int),
1010
north_pass = 1,
11-
eigen_kwargs = (;),
1211
)
1312
prob = problem(region_iter)
1413

@@ -29,7 +28,7 @@ function subspace_expand!(
2928
isnothing(a) && return region_iter, local_state
3029
basis_size = prod(dim.(uniqueinds(A, C)))
3130

32-
trunc_kwargs = truncation_parameters(region_iter.which_sweep; eigen_kwargs...)
31+
trunc_kwargs = truncation_parameters(region_iter.which_sweep; region_kwargs(factorize, region_iter)...)
3332
expanded_maxdim = compute_expansion(
3433
dim(a), basis_size; expansion_factor, maxexpand, trunc_kwargs.maxdim
3534
)

test/solvers/test_eigsolve.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Test: @test, @testset
22
using ITensors
3-
using ITensorNetworks: siteinds, ttn, dmrg
3+
using ITensorNetworks: dmrg, maxlinkdim, siteinds, ttn
44
using Graphs: dst, edges, src, vertices
55
using ITensorMPS: OpSum
66
using TensorOperations: TensorOperations #For contraction order finding
@@ -58,12 +58,16 @@ include("utilities/tree_graphs.jl")
5858
#
5959
nsites = 1
6060
nsweeps = 5
61-
factorize_kwargs = (; cutoff = [1.0e-5, 1.0e-6], maxdim = [8, 16, 32])
61+
maxdim = [8, 16, 32]
62+
factorize_kwargs = (; cutoff = [1.0e-5, 1.0e-6], maxdim)
6263
extract!_kwargs = (; subspace_algorithm = "densitymatrix")
6364
E, psi = dmrg(H, psi0; extract!_kwargs, factorize_kwargs, nsites, nsweeps, outputlevel)
6465
(outputlevel >= 1) && println("1-site+subspace DMRG energy = ", E)
6566
@test E Ex atol = 1.0e-5
6667

68+
# Regression test that subspace expansion feature obeys maxdim limit
69+
@test maxlinkdim(psi) <= last(maxdim)
70+
6771
#
6872
# Test passing cutoff and maxdim as a vector of values
6973
#

0 commit comments

Comments
 (0)