Skip to content

Commit d9aa070

Browse files
committed
Add test of passing vectors of maxdim and cutoff values
1 parent e73ece0 commit d9aa070

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

test/solvers/test_eigsolve.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,22 @@ include("utilities/tree_graphs.jl")
5353

5454
#
5555
# Test 1-site DMRG with subspace expansion
56+
# and cutoff and maxdim as vectors of values
5657
#
5758
nsites = 1
5859
nsweeps = 5
60+
factorize_kwargs = (; cutoff = [1.0e-5, 1.0e-6], maxdim = [8, 16, 32])
5961
extract!_kwargs = (; subspace_algorithm = "densitymatrix")
6062
E, psi = dmrg(H, psi0; extract!_kwargs, factorize_kwargs, nsites, nsweeps, outputlevel)
6163
(outputlevel >= 1) && println("1-site+subspace DMRG energy = ", E)
6264
@test E Ex atol = 1.0e-5
65+
66+
#
67+
# Test passing cutoff and maxdim as a vector of values
68+
#
69+
nsites = 2
70+
factorize_kwargs = (; cutoff = [1.0e-5, 1.0e-6], maxdim = [8, 16, 32])
71+
E, psi = dmrg(H, psi0; factorize_kwargs, nsites, nsweeps, outputlevel)
72+
(outputlevel >= 1) && println("2-site DMRG energy = ", E)
73+
@test E Ex atol = 1.0e-5
6374
end

0 commit comments

Comments
 (0)