Open hz-xiaxz opened 1 month ago
After learning from the document, I found this feature is well-supported by the TermAmplitude
parameter. So I hacked to add my onsite disorder term $ \sumi \sum{\sigma} \omegai c^\dagger{i,\sigma} c_{i, \sigma} $ to the Fermi-Hubbard model
# define the terms, i.e. the nearest-neighbor hopping and the Hubbard interaction
t_term = Hopping(:t, -t, 1)
U_term = Hubbard(:U, U)
#########################
function disorder(bond::Bond)
coordinate = bond.points[1].rcoordinate
onsite = omega_reshape[Int(coordinate[1])+1, Int(coordinate[2])+1]
return onsite
end
ω_up = Term{:Onsite}(:ωup, 1.0, 0, Coupling(Index(:, FID{:f}(:, 1 // 2, 2)), Index(:, FID{:f}(:, 1 // 2, 1))), true; amplitude=disorder, ismodulatable=true)
ω_down = Term{:Onsite}(:ωdown, 1.0, 0, Coupling(Index(:, FID{:f}(:, -1 // 2, 2)), Index(:, FID{:f}(:, -1 // 2, 1))), true; amplitude=disorder, ismodulatable=true)
###########################
# define the exact diagonalization algorithm for the Fermi Hubbard model
ed = ED(lattice, hilbert, (t_term, U_term, ω_up, ω_down), quantumnumber)
I wonder if I got all things right? Thanks for your assistance!
Hello, thanks for your robust and elegant package!
I'm using this package to perform benchmark of Anderson-Hubbard Model (ref). It is simply a Hubbard model with random onsite energy for each site.
I read the source code and find that an
array
input for theOnsite
function will cause the assertion error:AssertionError: Term error: only real values are allowed. Complex values always have the positive directions, therefore, they must be specified by the amplitude function.
I wonder if it is possible to support non-uniform Onsite energy assignment according to the id's of lattice sites?