Skip to content

Commit 7bcde00

Browse files
committed
Update particle number density implementation in bose_hubbard_model
1 parent b2c370e commit 7bcde00

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/models/hamiltonians.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,11 +331,14 @@ end
331331
332332
MPO for the hamiltonian of the Bose-Hubbard model, as defined by
333333
```math
334-
H = -t \\sum_{\\langle i,j \\rangle} \\left( a_{i}^+ a_{j}^- + a_{i}^- a_{j}^+ \\right) - \\sum_i \\mu N_i + \\frac{U}{2} \\sum_i N_i(N_i - 1).
334+
H = -t \\sum_{\\langle i,j \\rangle} \\left( a_{i}^+ a_{j}^- + a_{i}^- a_{j}^+ \\right) - \\mu \\sum_i N_i + \\frac{U}{2} \\sum_i N_i(N_i - 1).
335335
```
336336
where ``N`` is the bosonic number operator [`a_number`](@ref).
337337
338-
By default, the model is defined on an infinite chain with unit lattice spacing, without any symmetries and with `ComplexF64` entries of the tensors. The Hilbert space is truncated such that at maximum of `cutoff` bosons can be at a single site. If the `symmetry` is not `Trivial`, a fixed particle number density `n` can be imposed.
338+
By default, the model is defined on an infinite chain with unit lattice spacing, without any
339+
symmetries and with `ComplexF64` entries of the tensors. The Hilbert space is truncated such
340+
that at maximum of `cutoff` bosons can be at a single site. If the `symmetry` is not
341+
`Trivial`, a fixed (halfinteger) particle number density `n` can be imposed.
339342
"""
340343
function bose_hubbard_model end
341344
function bose_hubbard_model(lattice::AbstractLattice; kwargs...)
@@ -348,7 +351,7 @@ end
348351
function bose_hubbard_model(elt::Type{<:Number}=ComplexF64,
349352
symmetry::Type{<:Sector}=Trivial,
350353
lattice::AbstractLattice=InfiniteChain(1);
351-
cutoff::Integer=5, t=1.0, U=1.0, mu=0.0, n::Integer=0)
354+
cutoff::Integer=5, t=1.0, U=1.0, mu=0.0, n=0)
352355
hopping_term = a_plusmin(elt, symmetry; cutoff=cutoff) +
353356
a_minplus(elt, symmetry; cutoff=cutoff)
354357
N = a_number(elt, symmetry; cutoff=cutoff)
@@ -368,7 +371,7 @@ function bose_hubbard_model(elt::Type{<:Number}=ComplexF64,
368371
elseif symmetry === U1Irrep
369372
isinteger(2n) ||
370373
throw(ArgumentError("`U₁` symmetry requires halfinteger particle number"))
371-
H = MPSKit.add_physical_charge(H, fill(U1Irrep(n), length(H)))
374+
H = MPSKit.add_physical_charge(H, fill(U1Irrep(-n), length(H)))
372375
else
373376
throw(ArgumentError("symmetry not implemented"))
374377
end

0 commit comments

Comments
 (0)