Skip to content

Commit cc5c05e

Browse files
Hubbard operators: support additional symmetries (#41)
* Hubbard operators: symmetries apart charge SU2 Implements all symmetries for the Hubbard operators apart from the charge SU(2) symmetry. This is a copy from the work done in TensorKitTensors.jl * update version
1 parent 3f9ef9a commit cc5c05e

File tree

3 files changed

+82
-10
lines changed

3 files changed

+82
-10
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "MPSKitModels"
22
uuid = "ca635005-6f8c-4cd1-b51d-8491250ef2ab"
33
authors = ["Maarten Van Damme", "Lukas Devos", "Gertian Roose", "Klaas Gunst"]
4-
version = "0.3.5"
4+
version = "0.3.6"
55

66
[deps]
77
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

src/operators/hubbardoperators.jl

Lines changed: 78 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,25 @@ function e_plusmin_up(T, ::Type{Trivial}, ::Type{Trivial})
7777
return t
7878
end
7979
function e_plusmin_up(T, ::Type{Trivial}, ::Type{U1Irrep})
80-
return error("Not implemented")
80+
t = two_site_operator(T, Trivial, U1Irrep)
81+
I = sectortype(t)
82+
t[(I(1, 1 // 2), I(0, 0), dual(I(0, 0)), dual(I(1, 1 // 2)))][1, 1, 1, 1] = 1
83+
t[(I(1, 1 // 2), I(1, -1 // 2), dual(I(0, 0)), dual(I(0, 0)))][1, 1, 1, 2] = 1
84+
t[(I(0, 0), I(0, 0), dual(I(1, -1 // 2)), dual(I(1, 1 // 2)))][2, 1, 1, 1] = -1
85+
t[(I(0, 0), I(1, -1 // 2), dual(I(1, -1 // 2)), dual(I(0, 0)))][2, 1, 1, 2] = -1
86+
return t
8187
end
8288
function e_plusmin_up(T, ::Type{Trivial}, ::Type{SU2Irrep})
8389
return error("Not implemented")
8490
end
8591
function e_plusmin_up(T, ::Type{U1Irrep}, ::Type{Trivial})
86-
return error("Not implemented")
92+
t = two_site_operator(T, U1Irrep, Trivial)
93+
I = sectortype(t)
94+
t[(I(1, 1), I(0, 0), dual(I(0, 0)), dual(I(1, 1)))][1, 1, 1, 1] = 1
95+
t[(I(1, 1), I(1, 1), dual(I(0, 0)), dual(I(0, 2)))][1, 2, 1, 1] = 1
96+
t[(I(0, 2), I(0, 0), dual(I(1, 1)), dual(I(1, 1)))][1, 1, 2, 1] = -1
97+
t[(I(0, 2), I(1, 1), dual(I(1, 1)), dual(I(0, 2)))][1, 2, 2, 1] = -1
98+
return t
8799
end
88100
function e_plusmin_up(T, ::Type{U1Irrep}, ::Type{U1Irrep})
89101
t = two_site_operator(T, U1Irrep, U1Irrep)
@@ -124,13 +136,25 @@ function e_plusmin_down(T, ::Type{Trivial}, ::Type{Trivial})
124136
return t
125137
end
126138
function e_plusmin_down(T, ::Type{Trivial}, ::Type{U1Irrep})
127-
return error("Not implemented")
139+
t = two_site_operator(T, Trivial, U1Irrep)
140+
I = sectortype(t)
141+
t[(I(1, -1 // 2), I(0, 0), dual(I(0, 0)), dual(I(1, -1 // 2)))][1, 1, 1, 1] = 1
142+
t[(I(1, -1 // 2), I(1, 1 // 2), dual(I(0, 0)), dual(I(0, 0)))][1, 1, 1, 2] = -1
143+
t[(I(0, 0), I(0, 0), dual(I(1, 1 // 2)), dual(I(1, -1 // 2)))][2, 1, 1, 1] = 1
144+
t[(I(0, 0), I(1, 1 // 2), dual(I(1, 1 // 2)), dual(I(0, 0)))][2, 1, 1, 2] = -1
145+
return t
128146
end
129147
function e_plusmin_down(T, ::Type{Trivial}, ::Type{SU2Irrep})
130148
return error("Not implemented")
131149
end
132150
function e_plusmin_down(T, ::Type{U1Irrep}, ::Type{Trivial})
133-
return error("Not implemented")
151+
t = two_site_operator(T, U1Irrep, Trivial)
152+
I = sectortype(t)
153+
t[(I(1, 1), I(0, 0), dual(I(0, 0)), dual(I(1, 1)))][2, 1, 1, 2] = 1
154+
t[(I(1, 1), I(1, 1), dual(I(0, 0)), dual(I(0, 2)))][2, 1, 1, 1] = -1
155+
t[(I(0, 2), I(0, 0), dual(I(1, 1)), dual(I(1, 1)))][1, 1, 1, 2] = 1
156+
t[(I(0, 2), I(1, 1), dual(I(1, 1)), dual(I(0, 2)))][1, 1, 1, 1] = -1
157+
return t
134158
end
135159
function e_plusmin_down(T, ::Type{U1Irrep}, ::Type{U1Irrep})
136160
t = two_site_operator(T, U1Irrep, U1Irrep)
@@ -192,6 +216,23 @@ function e_plusmin(T, particle_symmetry::Type{<:Sector}, spin_symmetry::Type{<:S
192216
return e_plusmin_up(T, particle_symmetry, spin_symmetry) +
193217
e_plusmin_down(T, particle_symmetry, spin_symmetry)
194218
end
219+
function e_plusmin(T, ::Type{Trivial}, ::Type{SU2Irrep})
220+
t = two_site_operator(T, Trivial, SU2Irrep)
221+
I = sectortype(t)
222+
f1 = only(fusiontrees((I(0, 0), I(1, 1 // 2)), I(1, 1 // 2)))
223+
f2 = only(fusiontrees((I(1, 1 // 2), I(0, 0)), I(1, 1 // 2)))
224+
t[f1, f2][1, 1, 1, 1] = 1
225+
f3 = only(fusiontrees((I(1, 1 // 2), I(0, 0)), I(1, 1 // 2)))
226+
f4 = only(fusiontrees((I(0, 0), I(1, 1 // 2)), I(1, 1 // 2)))
227+
t[f3, f4][1, 2, 2, 1] = -1
228+
f5 = only(fusiontrees((I(0, 0), I(0, 0)), I(0, 0)))
229+
f6 = only(fusiontrees((I(1, 1 // 2), I(1, 1 // 2)), I(0, 0)))
230+
t[f5, f6][1, 2, 1, 1] = sqrt(2)
231+
f7 = only(fusiontrees((I(1, 1 // 2), I(1, 1 // 2)), I(0, 0)))
232+
f8 = only(fusiontrees((I(0, 0), I(0, 0)), I(0, 0)))
233+
t[f7, f8][1, 1, 2, 1] = sqrt(2)
234+
return t
235+
end
195236
function e_plusmin(T, ::Type{U1Irrep}, ::Type{SU2Irrep})
196237
t = two_site_operator(T, U1Irrep, SU2Irrep)
197238
I = sectortype(t)
@@ -237,13 +278,21 @@ function e_number_up(T::Type{<:Number}, ::Type{Trivial}=Trivial, ::Type{Trivial}
237278
return t
238279
end
239280
function e_number_up(T, ::Type{Trivial}, ::Type{U1Irrep})
240-
return error("Not implemented")
281+
t = single_site_operator(T, Trivial, U1Irrep)
282+
I = sectortype(t)
283+
t[(I(1, 1 // 2), dual(I(1, 1 // 2)))][1, 1] = 1
284+
t[(I(0, 0), dual(I(0, 0)))][2, 2] = 1
285+
return t
241286
end
242287
function e_number_up(T, ::Type{Trivial}, ::Type{SU2Irrep})
243288
throw(ArgumentError("`e_number_up` is not symmetric under `SU2Irrep` spin symmetry"))
244289
end
245290
function e_number_up(T, ::Type{U1Irrep}, ::Type{Trivial})
246-
return error("Not implemented")
291+
t = single_site_operator(T, U1Irrep, Trivial)
292+
I = sectortype(t)
293+
block(t, I(1, 1))[1, 1] = 1
294+
block(t, I(0, 2))[1, 1] = 1
295+
return t
247296
end
248297
function e_number_up(T, ::Type{U1Irrep}, ::Type{U1Irrep})
249298
t = single_site_operator(T, U1Irrep, U1Irrep)
@@ -280,13 +329,21 @@ function e_number_down(T::Type{<:Number}, ::Type{Trivial}=Trivial, ::Type{Trivia
280329
return t
281330
end
282331
function e_number_down(T, ::Type{Trivial}, ::Type{U1Irrep})
283-
return error("Not implemented")
332+
t = single_site_operator(T, Trivial, U1Irrep)
333+
I = sectortype(t)
334+
t[(I(1, -1 // 2), dual(I(1, -1 // 2)))][1, 1] = 1
335+
t[(I(0, 0), I(0, 0))][2, 2] = 1
336+
return t
284337
end
285338
function e_number_down(T, ::Type{Trivial}, ::Type{SU2Irrep})
286339
throw(ArgumentError("`e_number_down` is not symmetric under `SU2Irrep` spin symmetry"))
287340
end
288341
function e_number_down(T, ::Type{U1Irrep}, ::Type{Trivial})
289-
return error("Not implemented")
342+
t = single_site_operator(T, U1Irrep, Trivial)
343+
I = sectortype(t)
344+
block(t, I(1, 1))[2, 2] = 1 # expected to be [1,2]
345+
block(t, I(0, 2))[1, 1] = 1
346+
return t
290347
end
291348
function e_number_down(T, ::Type{U1Irrep}, ::Type{U1Irrep})
292349
t = single_site_operator(T, U1Irrep, U1Irrep)
@@ -319,6 +376,13 @@ function e_number(T, particle_symmetry::Type{<:Sector}, spin_symmetry::Type{<:Se
319376
return e_number_up(T, particle_symmetry, spin_symmetry) +
320377
e_number_down(T, particle_symmetry, spin_symmetry)
321378
end
379+
function e_number(T, ::Type{Trivial}, ::Type{SU2Irrep})
380+
t = single_site_operator(T, Trivial, SU2Irrep)
381+
I = sectortype(t)
382+
block(t, I(1, 1 // 2))[1, 1] = 1
383+
block(t, I(0, 0))[2, 2] = 2
384+
return t
385+
end
322386
function e_number(T, ::Type{U1Irrep}, ::Type{SU2Irrep})
323387
t = single_site_operator(T, U1Irrep, SU2Irrep)
324388
I = sectortype(t)
@@ -339,6 +403,12 @@ function e_number_updown(T, particle_symmetry::Type{<:Sector},
339403
return e_number_up(T, particle_symmetry, spin_symmetry) *
340404
e_number_down(T, particle_symmetry, spin_symmetry)
341405
end
406+
function e_number_updown(T, ::Type{Trivial}, ::Type{SU2Irrep})
407+
t = single_site_operator(T, Trivial, SU2Irrep)
408+
I = sectortype(t)
409+
block(t, I(0, 0))[2, 2] = 1
410+
return t
411+
end
342412
function e_number_updown(T, ::Type{U1Irrep}, ::Type{SU2Irrep})
343413
t = single_site_operator(T, U1Irrep, SU2Irrep)
344414
I = sectortype(t)

test/hubbardoperators.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ using TensorKit
33
using MPSKitModels.HubbardOperators
44
using LinearAlgebra: eigvals
55

6-
implemented_symmetries = [(Trivial, Trivial), (U1Irrep, U1Irrep), (U1Irrep, SU2Irrep)]
6+
implemented_symmetries = [(Trivial, Trivial), (Trivial, U1Irrep), (Trivial, SU2Irrep),
7+
(U1Irrep, Trivial), (U1Irrep, U1Irrep), (U1Irrep, SU2Irrep)]
8+
79
@testset "basic properties" begin
810
for particle_symmetry in (Trivial, U1Irrep, SU2Irrep),
911
spin_symmetry in (Trivial, U1Irrep, SU2Irrep)

0 commit comments

Comments
 (0)