Skip to content

Commit

Permalink
Merge pull request #1 from phyjswang/U1andNoSymSpinLocalSpace
Browse files Browse the repository at this point in the history
add U1 and no sym spin local space
  • Loading branch information
Qiaoyi-Li authored Feb 22, 2024
2 parents 655d86c + fdaacdf commit a418709
Show file tree
Hide file tree
Showing 3 changed files with 146 additions and 3 deletions.
49 changes: 48 additions & 1 deletion example/Models/Heisenberg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,51 @@ function SU₂Heisenberg(Latt::AbstractLattice; J::Number=1, J′::Number=0)

return InteractionTree(Root)

end
end

function U₁Heisenberg(Latt::AbstractLattice; J::Number=1, J′::Number=0)

# note J > 0 means AFM

Root = InteractionTreeNode(IdentityOperator(0), nothing)

# get the distance of NN and NNN pairs
lsd = map(1:length(Latt)) do i
metric(Latt, Latt[i])
end |> sort |> unique
i = 1
while i < length(lsd)
if lsd[i] lsd[i+1]
deleteat!(lsd, i + 1)
else
i += 1
end
end

let LocalSpace = U₁Spin

# NN interaction
for pairs in neighbor(Latt; d=lsd[1])
addIntr2!(Root, (LocalSpace.Sz, LocalSpace.Sz), pairs,
J; name=(:Sz, :Sz))
addIntr2!(Root, LocalSpace.S₋₊, pairs,
J/2; name=(:Sm, :Sp))
addIntr2!(Root, LocalSpace.S₊₋, pairs,
J/2; name=(:Sp, :Sm))
end

# NNN interaction
for pairs in neighbor(Latt; d=lsd[2])
addIntr2!(Root, (LocalSpace.Sz, LocalSpace.Sz), pairs,
J′; name=(:Sz, :Sz))
addIntr2!(Root, LocalSpace.S₋₊, pairs,
J′/2; name=(:Sm, :Sp))
addIntr2!(Root, LocalSpace.S₊₋, pairs,
J′/2; name=(:Sp, :Sm))
end

end

return InteractionTree(Root)

end
2 changes: 1 addition & 1 deletion src/FiniteMPS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ include("Observables/convert.jl")


# predefined local spaces
export SU₂Spin, SU2Spin, U₁SU₂Fermion, U1SU2Fermion, ℤ₂SU₂Fermion, Z2SU2Fermion, U₁SpinlessFermion, U1SpinlessFermion, U₁SU₂tJFermion, U1SU2tJFermion, U₁U₁Fermion, U1U1Fermion
export SU₂Spin, SU2Spin, U₁Spin, U1Spin, NoSymSpinOneHalf, U₁SU₂Fermion, U1SU2Fermion, ℤ₂SU₂Fermion, Z2SU2Fermion, U₁SpinlessFermion, U1SpinlessFermion, U₁SU₂tJFermion, U1SU2tJFermion, U₁U₁Fermion, U1U1Fermion
include("LocalSpace/Spin.jl")
include("LocalSpace/Fermion.jl")
include("LocalSpace/tJFermion.jl")
Expand Down
98 changes: 97 additions & 1 deletion src/LocalSpace/Spin.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,100 @@ end
"""
const SU2Spin = SU₂Spin
"""
const SU2Spin = SU₂Spin
const SU2Spin = SU₂Spin

"""
module U₁Spin
Prepare the local space of U₁ spin-1/2.
# Fields
pspace::VectorSpace
Local `d = 2` Hilbert space.
Sz::TensorMap
Rank-`2` spin-z operator `Sz = (n↑ - n↓)/2`.
S₊₋::NTuple{2, TensorMap}
S₋₊::NTuple{2, TensorMap}
Two rank-`3` operators of `S₊₋` and `S₋₊` interaction. Note Heisenberg `S⋅S = SzSz + (S₊₋ + S₋₊)/2`.
"""
module U₁Spin

using TensorKit

const pspace = Rep[U₁](-1 // 2 => 1, 1 // 2 => 1)

const Sz = let
Sz = TensorMap(ones, pspace, pspace)
block(Sz, Irrep[U₁](1 // 2)) .= 1/2
block(Sz, Irrep[U₁](-1 // 2)) .= -1/2
Sz
end

# S+ S- interaction
# convention: S⋅S = SzSz + (S₊₋ + S₋₊)/2
const S₊₋ = let
aspace = Rep[U₁](1 => 1)
S₊ = TensorMap(ones, pspace, pspace aspace)
S₋ = TensorMap(ones, aspace pspace, pspace)
S₊, S₋
end

const S₋₊ = let
aspace = Rep[U₁](1 => 1)
iso = isometry(aspace, flip(aspace))
@tensor S₋[a; c d] := S₊₋[1]'[a, b, c] * iso'[d, b]
@tensor S₊[d a; c] := S₊₋[2]'[a, b, c] * iso[b, d]
S₋, S₊
end

end

const U1Spin = U₁Spin

"""
module NoSymSpinOneHalf
Prepare the local space of U₁ spin-1/2. Basis convention is `{|↑⟩, |↓⟩}`.
# Fields
pspace::VectorSpace
Local `d = 2` Hilbert space.
Sz::TensorMap
Sx::TensorMap
Sy::TensorMap
Rank-`2` spin-1/2 operators.
S₊::TensorMap
Rank-`2` spin-plus operator `S₊ = Sx + iSy`.
S₋::TensorMap
Rank-`2` spin-minus operator `S₋ = Sx - iSy`.
"""
module NoSymSpinOneHalf

using TensorKit

const pspace =^2

const Sz = let
mat = Float64[1/2 0; 0 -1/2]
TensorMap(mat, pspace, pspace)
end

const S₊ = let
mat = Float64[0 1; 0 0]
TensorMap(mat, pspace, pspace)
end

const S₋ = let
mat = Float64[0 0; 1 0]
TensorMap(mat, pspace, pspace)
end

const Sx = (S₊ + S₋) / 2.

const Sy = (S₊ - S₋) / (2. * 1im)

end

0 comments on commit a418709

Please sign in to comment.