Skip to content

Commit 195bbf9

Browse files
committed
Using InfiniteSum{ITensor} instead of InfiniteSum{MPO} in some examples
1 parent a6ed6d9 commit 195bbf9

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

examples/vumps/vumps_hubbard_extended.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ maxdim = 30 # Maximum bond dimension
99
cutoff = 1e-6 # Singular value cutoff when increasing the bond dimension
1010
max_vumps_iters = 200 # Maximum number of iterations of the VUMPS algorithm at each bond dimension
1111
outer_iters = 5 # Number of times to increase the bond dimension
12-
localham_type = ITensor
12+
localham_type = ITensor # or MPO
1313

1414
model_params = (t=1.0, U=10.0, V=0.0)
1515

@@ -19,6 +19,9 @@ model_params = (t=1.0, U=10.0, V=0.0)
1919

2020
N = 2 # Unit cell size
2121

22+
@show N
23+
@show localham_type
24+
2225
function electron_space_shift(q̃nf, q̃sz)
2326
return [
2427
QN(("Nf", 0 - q̃nf, -1), ("Sz", 0 - q̃sz)) => 1,
@@ -53,9 +56,9 @@ subspace_expansion_kwargs = (cutoff=cutoff, maxdim=maxdim)
5356
# a larger bond dimension)
5457

5558
println("\nRun VUMPS on initial product state, unit cell size $N")
56-
ψ = vumps(H, ψ; vumps_kwargs...)
59+
ψ = @time vumps(H, ψ; vumps_kwargs...)
5760

58-
for _ in 1:outer_iters
61+
@time for _ in 1:outer_iters
5962
println("\nIncrease bond dimension")
6063
global ψ = subspace_expansion(ψ, H; subspace_expansion_kwargs...)
6164
println("Run VUMPS with new bond dimension")

examples/vumps/vumps_ising.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ solver_tol = (x -> x / 100) # Tolerance for the local solver (eigsolve in VUMPS
1515
multisite_update_alg = "parallel" # Choose between ["sequential", "parallel"]. Only parallel works with TDVP.
1616
conserve_qns = true # Whether or not to conserve spin parity
1717
nsite = 2 # Number of sites in the unit cell
18-
localham_type = MPO # Can choose `ITensor` or `MPO`
18+
localham_type = ITensor # Can choose `ITensor` or `MPO`
1919

2020
# Parameters of the transverse field Ising model
2121
model_params = (J=1.0, h=0.9)

examples/vumps/vumps_localham.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ h = 1.5
2222
model = Model(:ising)
2323

2424
# Form the Hamiltonian
25-
Σ∞h = InfiniteSum{MPO}(model, s; J=J, h=h)
25+
Σ∞h = InfiniteSum{ITensor}(model, s; J=J, h=h)
2626

2727
χ = 6
2828
ψ = InfiniteMPS(s; space=χ)

examples/vumps/vumps_localham_qns.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ energy_finite, ψfinite = dmrg(Hfinite, ψfinite, sweeps)
3131
@show energy_finite / Nfinite
3232

3333
# Form the Hamiltonian
34-
Σ∞h = InfiniteSum{MPO}(model, s; model_kwargs...)
34+
Σ∞h = InfiniteSum{ITensor}(model, s; model_kwargs...)
3535

3636
d = 1
3737
χ = [QN("SzParity", 1, 2) => d, QN("SzParity", 0, 2) => d]

0 commit comments

Comments
 (0)