@@ -13,8 +13,8 @@ outer_iters = 5 # Number of times to increase the bond dimension
1313time_step = - Inf # -Inf corresponds to VUMPS, finite time_step corresponds to TDVP
1414solver_tol = (x -> x / 100 ) # Tolerance for the local solver (eigsolve in VUMPS and exponentiate in TDVP)
1515multisite_update_alg = " parallel" # Choose between ["sequential", "parallel"]. Only parallel works with TDVP.
16- conserve_qns = false
17- N = 2 # Number of sites in the unit cell (1-site unit cell is currently broken)
16+ conserve_qns = true # Whether or not to conserve spin parity
17+ nsite = 2 # Number of sites in the unit cell
1818
1919# Parameters of the transverse field Ising model
2020model_params = (J= 1.0 , h= 0.9 )
@@ -33,16 +33,19 @@ function space_shifted(::Model"ising", q̃sz; conserve_qns=true)
3333 end
3434end
3535
36- space_ = fill (space_shifted (model, 0 ; conserve_qns= conserve_qns), N)
37- s = infsiteinds (" S=1/2" , N; space= space_)
36+ # Shift the QNs by 1 so that the flux of the unit cell is zero
37+ # and therefore the flux density of the uniform state is zero
38+ # to avoid diverging flux in the thermodynamic limit.
39+ space_ = fill (space_shifted (model, 1 ; conserve_qns= conserve_qns), nsite)
40+ s = infsiteinds (" S=1/2" , nsite; space= space_)
3841initstate (n) = " ↑"
3942ψ = InfMPS (s, initstate)
4043
4144# Form the Hamiltonian
4245H = InfiniteITensorSum (model, s; model_params... )
4346
4447# Check translational invariance
45- @show norm (contract (ψ. AL[1 : N ]. .. , ψ. C[N ]) - contract (ψ. C[0 ], ψ. AR[1 : N ]. .. ))
48+ @show norm (contract (ψ. AL[1 : nsite ]. .. , ψ. C[nsite ]) - contract (ψ. C[0 ], ψ. AR[1 : nsite ]. .. ))
4649
4750vumps_kwargs = (
4851 tol= tol,
@@ -51,7 +54,6 @@ vumps_kwargs = (
5154 multisite_update_alg= multisite_update_alg,
5255)
5356subspace_expansion_kwargs = (cutoff= cutoff, maxdim= maxdim)
54- # ψ = tdvp(H, ψ; time_step=time_step, vumps_kwargs...)
5557
5658# Alternate steps of running VUMPS and increasing the bond dimension
5759@time for _ in 1 : outer_iters
@@ -62,22 +64,22 @@ subspace_expansion_kwargs = (cutoff=cutoff, maxdim=maxdim)
6264end
6365
6466# Check translational invariance
65- @show norm (contract (ψ. AL[1 : N ]. .. , ψ. C[N ]) - contract (ψ. C[0 ], ψ. AR[1 : N ]. .. ))
67+ @show norm (contract (ψ. AL[1 : nsite ]. .. , ψ. C[nsite ]) - contract (ψ. C[0 ], ψ. AR[1 : nsite ]. .. ))
6668
6769#
6870# Compare to DMRG
6971#
7072
71- Nfinite = 100
72- sfinite = siteinds (" S=1/2" , Nfinite ; conserve_szparity= true )
73- Hfinite = MPO (model, sfinite ; model_params... )
74- ψfinite = randomMPS (sfinite , initstate)
75- @show flux (ψfinite )
73+ nsite_finite = 100
74+ s_finite = siteinds (" S=1/2" , nsite_finite ; conserve_szparity= true )
75+ H_finite = MPO (model, s_finite ; model_params... )
76+ ψ_finite = randomMPS (s_finite , initstate)
77+ @show flux (ψ_finite )
7678sweeps = Sweeps (10 )
7779setmaxdim! (sweeps, maxdim)
7880setcutoff! (sweeps, cutoff)
79- energy_finite_total, ψfinite = @time dmrg (Hfinite, ψfinite , sweeps)
80- @show energy_finite_total / Nfinite
81+ energy_finite_total, ψ_finite = @time dmrg (H_finite, ψ_finite , sweeps)
82+ @show energy_finite_total / nsite_finite
8183
8284function energy_local (ψ1, ψ2, h)
8385 ϕ = ψ1 * ψ2
9092
9193# Exact energy at criticality: 4/pi = 1.2732395447351628
9294
93- nfinite = Nfinite ÷ 2
94- orthogonalize! (ψfinite, nfinite )
95- hnfinite = ITensor (model, sfinite[nfinite ], sfinite[nfinite + 1 ]; model_params... )
96- energy_finite = energy_local (ψfinite[nfinite ], ψfinite[nfinite + 1 ], hnfinite )
95+ n_finite = nsite_finite ÷ 2
96+ orthogonalize! (ψ_finite, n_finite )
97+ hn_finite = ITensor (model, s_finite[n_finite ], s_finite[n_finite + 1 ]; model_params... )
98+ energy_finite = energy_local (ψ_finite[n_finite ], ψ_finite[n_finite + 1 ], hn_finite )
9799energy_infinite = energy_local (ψ. AL[1 ], ψ. AL[2 ] * ψ. C[2 ], H[(1 , 2 )])
98100@show energy_finite, energy_infinite
99101@show abs (energy_finite - energy_infinite)
100102
101103energy_exact = reference (model, Observable (" energy" ); model_params... )
102104@show energy_exact
103105
104- Sz1_finite = expect (ψfinite[nfinite ], " Sz" )
105- orthogonalize! (ψfinite, nfinite + 1 )
106- Sz2_finite = expect (ψfinite[nfinite + 1 ], " Sz" )
106+ Sz1_finite = expect (ψ_finite[n_finite ], " Sz" )
107+ orthogonalize! (ψ_finite, n_finite + 1 )
108+ Sz2_finite = expect (ψ_finite[n_finite + 1 ], " Sz" )
107109Sz1_infinite = expect (ψ. AL[1 ] * ψ. C[1 ], " Sz" )
108110Sz2_infinite = expect (ψ. AL[2 ] * ψ. C[2 ], " Sz" )
109111
0 commit comments