Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ITensorNetworks"
uuid = "2919e153-833c-4bdc-8836-1ea460a35fc7"
authors = ["Matthew Fishman <mfishman@flatironinstitute.org>, Joseph Tindall <jtindall@flatironinstitute.org> and contributors"]
version = "0.15.2"
version = "0.15.3"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
Expand Down
3 changes: 2 additions & 1 deletion src/solvers/insert.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ function insert!(region_iter, local_tensor; normalize = false, set_orthogonal_re
indsTe = inds(psi[first(region)])
tags = ITensors.tags(psi, e)

trunc_kwargs = truncation_parameters(region_iter.which_sweep; region_kwargs(factorize, region_iter)...)
U, C, spectrum = factorize(
local_tensor, indsTe; tags, region_kwargs(factorize, region_iter)...
local_tensor, indsTe; tags, trunc_kwargs...
)

@preserve_graph psi[first(region)] = U
Expand Down
5 changes: 3 additions & 2 deletions src/solvers/subspace/densitymatrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ function subspace_expand!(
isnothing(a) && return region_iter, local_state
basis_size = prod(dim.(uniqueinds(A, C)))

trunc_kwargs = truncation_parameters(region_iter.which_sweep; eigen_kwargs...)
expanded_maxdim = compute_expansion(
dim(a), basis_size; expansion_factor, maxexpand, eigen_kwargs.maxdim
dim(a), basis_size; expansion_factor, maxexpand, trunc_kwargs.maxdim
)
expanded_maxdim <= 0 && return region_iter, local_state

Expand All @@ -48,7 +49,7 @@ function subspace_expand!(
sqrt_rho = conj_proj_A(sqrt_rho)
end
rho = sqrt_rho * dag(noprime(sqrt_rho))
D, U = eigen(rho; eigen_kwargs..., ishermitian = true)
D, U = eigen(rho; trunc_kwargs..., ishermitian = true)

Uproj(T) = (T - prime(A, a) * (dag(prime(A, a)) * T))
for _ in 1:north_pass
Expand Down
11 changes: 11 additions & 0 deletions test/solvers/test_eigsolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,22 @@ include("utilities/tree_graphs.jl")

#
# Test 1-site DMRG with subspace expansion
# and cutoff and maxdim as vectors of values
#
nsites = 1
nsweeps = 5
factorize_kwargs = (; cutoff = [1.0e-5, 1.0e-6], maxdim = [8, 16, 32])
extract!_kwargs = (; subspace_algorithm = "densitymatrix")
E, psi = dmrg(H, psi0; extract!_kwargs, factorize_kwargs, nsites, nsweeps, outputlevel)
(outputlevel >= 1) && println("1-site+subspace DMRG energy = ", E)
@test E ≈ Ex atol = 1.0e-5

#
# Test passing cutoff and maxdim as a vector of values
#
nsites = 2
factorize_kwargs = (; cutoff = [1.0e-5, 1.0e-6], maxdim = [8, 16, 32])
E, psi = dmrg(H, psi0; factorize_kwargs, nsites, nsweeps, outputlevel)
(outputlevel >= 1) && println("2-site DMRG energy = ", E)
@test E ≈ Ex atol = 1.0e-5
end
Loading