From c21f2cd35611575f91ef1e0480306b2c99aecf77 Mon Sep 17 00:00:00 2001 From: lkdvos Date: Sat, 26 Oct 2024 11:39:32 +0200 Subject: [PATCH 1/2] Add utility function `InfiniteSquare` --- src/operators/lattices/squarelattice.jl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/operators/lattices/squarelattice.jl b/src/operators/lattices/squarelattice.jl index 097a4f7..a2f3d9b 100644 --- a/src/operators/lattices/squarelattice.jl +++ b/src/operators/lattices/squarelattice.jl @@ -12,6 +12,8 @@ struct InfiniteSquare <: AbstractLattice{2} end end +Base.size(lattice::InfiniteSquare) = (lattice.Nrows, lattice.Ncols) + function vertices(lattice::InfiniteSquare) return CartesianIndices((1:(lattice.Nrows), 1:(lattice.Ncols))) end From 49a6e22b847b8124caf38659214fec116d31b8e7 Mon Sep 17 00:00:00 2001 From: lkdvos Date: Sat, 26 Oct 2024 11:50:19 +0200 Subject: [PATCH 2/2] Add Hubbard model --- src/operators/models.jl | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/operators/models.jl b/src/operators/models.jl index 324397f..f066c37 100644 --- a/src/operators/models.jl +++ b/src/operators/models.jl @@ -122,3 +122,27 @@ function pwave_superconductor( (neighbor => hy for neighbor in y_neighbors)..., ) end + +function MPSKitModels.hubbard_model( + T::Type{<:Number}, + particle_symmetry::Type{<:Sector}, + spin_symmetry::Type{<:Sector}, + lattice::InfiniteSquare; + t=1.0, + U=1.0, + mu=0.0, + n::Integer=0, +) + @assert n == 0 "Currently no support for imposing a fixed particle number" + hopping = + MPSKitModels.e⁺e⁻(T, particle_symmetry, spin_symmetry) + + MPSKitModels.e⁻e⁺(T, particle_symmetry, spin_symmetry) + interaction_term = MPSKitModels.nꜛnꜜ(T, particle_symmetry, spin_symmetry) + N = MPSKitModels.e_number(T, particle_symmetry, spin_symmetry) + + return LocalOperator( + fill(domain(hopping)[1], size(lattice)), + (neighbor => -t * hopping for neighbor in nearest_neighbours(lattice))..., + ((idx,) => U * interaction_term - mu * N for idx in vertices(lattice))..., + ) +end