Skip to content

Commit 9460c2c

Browse files
committed
Minor edits
1 parent 2a01e61 commit 9460c2c

File tree

1 file changed

+23
-17
lines changed
  • examples/quantum1d/8.bose-hubbard

1 file changed

+23
-17
lines changed

examples/quantum1d/8.bose-hubbard/main.jl

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ using matrix product states. For the most part, we replicate the results present
1313
[**Phys. Rev. B 105,
1414
134502**](https://journals.aps.org/prb/abstract/10.1103/PhysRevB.105.134502), which can be
1515
consulted for any statements in this tutorial that are not otherwise cited. The Hamiltonian
16-
under study is now defined as follows:
16+
under study is defined as follows:
1717
1818
$$H = -t \sum_{i} (\hat{a}_i^{\dagger} \hat{a}_{i+1} + \hat{a}_{i+1}^{\dagger} \hat{a}_i) + \frac{U}{2} \sum_i \hat{n}_i(\hat{n}_i - 1) - \mu \sum_i \hat{n}_i$$
1919
@@ -61,7 +61,7 @@ Typically, such models are studied on a finite chain of $N$ sites with periodic
6161
conditions, but this introduces finite-size effects that are rather annoying to deal with.
6262
In contrast, the MPS framework allows us to work directly in the thermodynamic limit,
6363
avoiding such artifacts. We will follow this line of exploration in this tutorial and leave
64-
finite systems for another time.
64+
finite systems for another example.
6565
6666
In order to work in the thermodynamic limit, we will have to create an
6767
[`InfiniteMPS`](@ref). A complete specification of the MPS requires us to define the
@@ -99,12 +99,12 @@ md"""
9999
100100
The [] accessor lets us see the underlying array, and indeed the operators are exactly what
101101
we require. Similarly, the Bose Hubbard model is also predefined in
102-
[`MPSKitModels.bose_hubbard_model`](@extref) also predefined (although we will construct our
103-
own variant later on).
102+
[`MPSKitModels.bose_hubbard_model`](@extref) (although we will construct our own variant
103+
later on).
104104
105105
"""
106106

107-
hamiltonian = bose_hubbard_model(InfiniteChain(1), cutoff = cutoff, U = 1, mu = 0.5, t = 0.2) # It is not strictly required to pass InfiniteChain() and is only included for clarity; one may instead pass FiniteChain(N) as well
107+
hamiltonian = bose_hubbard_model(InfiniteChain(1); cutoff = cutoff, U = 1, mu = 0.5, t = 0.2) # It is not strictly required to pass InfiniteChain() and is only included for clarity; one may instead pass FiniteChain(N) as well
108108

109109
md"""
110110
This has created the Hamiltonian operator as a [matrix product operator](@ref
@@ -118,13 +118,13 @@ ground_state, _, _ = find_groundstate(initial_state, hamiltonian, VUMPS(tol = 1.
118118
println("Energy: ", expectation_value(ground_state, hamiltonian))
119119

120120
md"""
121-
This automatically runs the algorithm until a certain error [measure](@ref
121+
This automatically runs the algorithm until a certain [error measure](@ref
122122
MPSKit.calc_galerkin) falls below the specified tolerance or the maximum iterations is
123123
reached. Let us wrap all this into a convenient function.
124124
"""
125125

126126
function get_ground_state(mu, t, cutoff, D; kwargs...)
127-
hamiltonian = bose_hubbard_model(InfiniteChain(), cutoff = cutoff, U = 1, mu = mu, t = t)
127+
hamiltonian = bose_hubbard_model(InfiniteChain(); cutoff = cutoff, U = 1, mu = mu, t = t)
128128
state = InfiniteMPS(ℂ^(cutoff + 1), ℂ^D)
129129
state, _, _ = find_groundstate(state, hamiltonian, VUMPS(; kwargs...))
130130

@@ -161,10 +161,11 @@ $\lim_{i \to \infty}\langle\hat{a}_i^{\dagger} \hat{a}_j\rangle ≈ \langle \hat
161161
This is a signature of long-range order and suggests the existence of a Bose-Einstein
162162
condensate. However, this is a bit odd since at zero temperature, the Bose Hubbard model is
163163
not expected to break any continuous symmetries ($U(1)$ in this case, corresponding to
164-
particle number conservation) due to the Mermin-Wagner theorem. The source of this
165-
contradiction lies in the fact that the true 1D superfluid ground state is an extended
166-
critical phase exhibiting algebraic decay, however, a finite bond-dimension MPS can only
167-
capture exponentially decaying correlations. As a result, the finite bond dimension
164+
particle number conservation) due to the
165+
[Mermin-Wagner theorem](https://en.wikipedia.org/wiki/Mermin%E2%80%93Wagner_theorem). The
166+
source of this contradiction lies in the fact that the true 1D superfluid ground state is an
167+
extended critical phase exhibiting algebraic decay, however, a finite bond-dimension MPS can
168+
only capture exponentially decaying correlations. As a result, the finite bond dimension
168169
effectively introduces a length scale into the system in a similar manner as finite-size
169170
effects. We can see this clearly by increasing the bond dimension. We also see that the
170171
correlation length seems to depend algebraically on the bond dimension as expected from
@@ -177,7 +178,7 @@ mu, t = 0.5, 0.2
177178
states = Vector{InfiniteMPS}(undef, length(Ds))
178179

179180
Threads.@threads for idx in eachindex(Ds)
180-
states[idx] = get_ground_state(mu, t, cutoff, Ds[idx], tol = 1.0e-7, verbosity = 1, maxiter = 500)
181+
states[idx] = get_ground_state(mu, t, cutoff, Ds[idx]; tol = 1.0e-7, verbosity = 1, maxiter = 500)
181182
end
182183

183184
npoints = 400
@@ -225,7 +226,9 @@ system which vanishes as $D \to \infty$.
225226
quasicondensate_density = map(state -> abs2(expectation_value(state, (0,) => a_op)), states)
226227

227228
md"""
228-
We may now also visualize the momentum distribution function, which is obtained as the Fourier transform of the single-particle density matrix. Starting from the definition of the momentum occupation operator:
229+
We may now also visualize the momentum distribution function, which is obtained as the
230+
Fourier transform of the single-particle density matrix. Starting from the definition of the
231+
momentum occupation operators:
229232
230233
```math
231234
\hat{a}_k = \frac{1}{\sqrt{L}} \sum_j e^{-ikj} \hat{a}_j, \qquad
@@ -272,7 +275,6 @@ momentum_distribution = vcat(momentum_distribution...)'
272275
plot(ks, momentum_distribution, lab = "D = " .* string.(permutedims(Ds)), lw = 1.5, xlabel = "Momentum k", ylabel = L"\langle n_k \rangle", ylim = [0, 50])
273276

274277
md"""
275-
276278
We see that the density seems to peak around $k=0$, this time seemingly becoming more
277279
prominent as $D \to \infty$ which seems to suggest again that there is a condensate.
278280
However, going by the Penrose-Onsager criterion, the existence of a condensate can be
@@ -335,9 +337,13 @@ function superfluid_stiffness_profile(t, mu, D, cutoff, ϵ = 1.0e-4, npoints = 1
335337
energies = zeros(length(phis))
336338

337339
Threads.@threads for idx in eachindex(phis)
338-
hamiltonian_twisted = bose_hubbard_model_twisted_bc(cutoff = cutoff, t = t, mu = mu, U = 1, phi = phis[idx])
340+
hamiltonian_twisted = bose_hubbard_model_twisted_bc(;
341+
cutoff = cutoff, t = t, mu = mu, U = 1, phi = phis[idx]
342+
)
339343
state = InfiniteMPS(ℂ^(cutoff + 1), ℂ^D)
340-
state_twisted, _, _ = find_groundstate(state, hamiltonian_twisted, VUMPS(; tol = 1.0e-8, verbosity = 0))
344+
state_twisted, _, _ = find_groundstate(
345+
state, hamiltonian_twisted, VUMPS(; tol = 1.0e-8, verbosity = 0)
346+
)
341347
energies[idx] = real(expectation_value(state_twisted, hamiltonian_twisted))
342348
end
343349

@@ -367,7 +373,7 @@ a_op = a_min(cutoff = cutoff)
367373
order_parameters = zeros(length(ts), length(mus))
368374

369375
Threads.@threads for (i, j) in collect(Iterators.product(eachindex(mus), eachindex(ts)))
370-
hamiltonian = bose_hubbard_model(InfiniteChain(), cutoff = cutoff, U = 1, mu = mus[i], t = ts[j])
376+
hamiltonian = bose_hubbard_model(InfiniteChain(); cutoff = cutoff, U = 1, mu = mus[i], t = ts[j])
371377
init_state = InfiniteMPS(ℂ^(cutoff + 1), ℂ^D)
372378
state, _, _ = find_groundstate(init_state, hamiltonian, VUMPS(; tol = 1.0e-8, verbosity = 0))
373379
order_parameters[i, j] = abs(expectation_value(state, 0 => a_op))

0 commit comments

Comments
 (0)