Dear ITensor team,
I am a fresh man to using the ITensor library and want to test some physical systems. I make a DMRG calculation for the one dimensional half-filling spinless fermions which have a simplest Hamiltonian,
I employ both the periodic boundary condition (PBC) and the open boundary condition (OBC) for a 32-site chain. When using the PBC, the density profile shows some unexpected density waves. While when applying the OBC, I get the desired results that each site has an averaged particle number 0.5. So, do I missed something? Is this just the boundary effect or something else? I known that the OBC is naturally for DMRG, but when I want to extract the central charge, PBC is better. I really appreciate if someone can help me fix this issue.
Best,
Crliu
The code is as following,
using ITensors
include(get(ARGS, 1, "input.jl"))
sweeps = Sweeps(nsweep, sweeps_args)
sites = siteinds("Fermion", N;conserve_qns=true)
os = OpSum()
for b in 1:N-1
os .+= -Jf, "Cdag", b, "C", b + 1
os .+= -Jf, "Cdag", b + 1, "C", b
end
os .+= -Jf, "Cdag", 1, "C", N
os .+= -Jf, "Cdag", N, "C",1
H = MPO(os, sites)
state = [isodd(n) ? "0" : "1" for n in 1:N]
# Initialize wavefunction to be bond
# dimension 10 random MPS with number
# of particles the same as `state`
psi0 = MPS(sites, state)
# Check total number of particles:
@show flux(psi0)
# Start DMRG calculation:
energy, psi = dmrg(H, psi0,sweeps)
nmea = fill(0.0, N)
for j in 1:N
orthogonalize!(psi, j)
psidag_j = dag(prime(psi[j], "Site"))
nmea[j] = scalar(psidag_j * op(sites, "N", j) * psi[j])
end
println("Density:")
for j in 1:N
println("$j $(nmea[j])")
end
println()
And the input file is,
N = 32
Jf = 1.0
nsweep = 10
sweeps_args = [
"maxdim" "mindim" "cutoff" "noise"
50 20 1e-12 1e-6
100 20 1e-12 1e-7
200 20 1e-12 1e-8
800 20 1e-12 0
800 20 1e-12 0
800 20 1e-12 0
800 20 1e-12 0
1000 20 1e-12 0
1000 20 1e-12 0
1000 20 1e-12 0
1000 20 1e-12 0
2000 20 1e-12 0
2000 20 1e-12 0
2000 20 1e-12 0
2000 20 1e-12 0
2000 20 1e-12 0]
The output file with PBC is,
flux(psi0) = QN("Nf",16,-1)
After sweep 1 energy=-19.868252432167086 maxlinkdim=4 maxerr=1.08E-06 time=59.945
After sweep 2 energy=-20.008149046553754 maxlinkdim=16 maxerr=4.15E-08 time=0.688
After sweep 3 energy=-20.302023339629734 maxlinkdim=64 maxerr=6.89E-09 time=1.267
After sweep 4 energy=-20.306338337138502 maxlinkdim=249 maxerr=9.99E-13 time=14.975
After sweep 5 energy=-20.30634077359003 maxlinkdim=471 maxerr=9.99E-13 time=5.642
After sweep 6 energy=-20.306340774982772 maxlinkdim=506 maxerr=9.99E-13 time=7.296
After sweep 7 energy=-20.306340775016608 maxlinkdim=512 maxerr=9.99E-13 time=5.241
After sweep 8 energy=-20.30634077502393 maxlinkdim=513 maxerr=9.99E-13 time=5.692
After sweep 9 energy=-20.30634077502555 maxlinkdim=513 maxerr=1.00E-12 time=6.103
After sweep 10 energy=-20.30634077503053 maxlinkdim=513 maxerr=1.00E-12 time=6.827
Density:
1 0.5152587190593534
2 0.48474128093742286
3 0.5152587190477542
4 0.4847412809299222
5 0.5152587190423987
6 0.484741280930165
7 0.5152587190337196
8 0.4847412809547065
9 0.515258719018605
10 0.4847412809674652
11 0.5152587190184027
12 0.48474128096861385
13 0.5152587190222062
14 0.48474128097003827
15 0.5152587190276828
16 0.4847412809691997
17 0.5152587190297699
18 0.48474128097246433
19 0.5152587190266187
20 0.4847412809774208
21 0.5152587190301435
22 0.484741280978604
23 0.5152587190263962
24 0.48474128098039276
25 0.5152587190355917
26 0.4847412809718471
27 0.5152587190679927
28 0.4847412809648106
29 0.5152587190729093
30 0.4847412809555902
31 0.5152587190666889
32 0.4847412809451359
The output file with OBC is,
flux(psi0) = QN("Nf",16,-1)
After sweep 1 energy=-19.86890676875406 maxlinkdim=4 maxerr=4.17E-07 time=48.451
After sweep 2 energy=-20.01340215325526 maxlinkdim=16 maxerr=4.14E-08 time=0.374
After sweep 3 energy=-20.016383335926896 maxlinkdim=58 maxerr=4.17E-09 time=0.538
After sweep 4 energy=-20.01638789703774 maxlinkdim=76 maxerr=9.97E-13 time=10.015
After sweep 5 energy=-20.016387900367846 maxlinkdim=80 maxerr=9.96E-13 time=0.808
After sweep 6 energy=-20.01638790036378 maxlinkdim=80 maxerr=9.92E-13 time=0.599
After sweep 7 energy=-20.016387900365576 maxlinkdim=80 maxerr=9.95E-13 time=0.501
After sweep 8 energy=-20.01638790036632 maxlinkdim=80 maxerr=9.92E-13 time=0.510
After sweep 9 energy=-20.016387900366198 maxlinkdim=80 maxerr=9.92E-13 time=0.507
After sweep 10 energy=-20.016387900366222 maxlinkdim=80 maxerr=9.92E-13 time=0.565
Density:
1 0.49999999999686257
2 0.4999999999986735
3 0.49999999999702505
4 0.5000000000001048
5 0.4999999999989829
6 0.5000000000007757
7 0.4999999999958785
8 0.5000000000068969
9 0.49999999999552275
10 0.5000000000020647
11 0.4999999999967063
12 0.50000000000123
13 0.5000000000002627
14 0.5000000000039149
15 0.49999999999395034
16 0.5000000000026557
17 0.500000000004377
18 0.49999999999983447
19 0.49999999999801303
20 0.4999999999986424
21 0.49999999999657146
22 0.49999999999759576
23 0.5000000000047478
24 0.499999999992202
25 0.5000000000000361
26 0.49999999999460587
27 0.500000000002678
28 0.5000000000010292
29 0.5000000000047818
30 0.4999999999884952
31 0.5000000000208796
32 0.5000000000039868